VYPR
High severity7.5NVD Advisory· Published Jun 2, 2025· Updated Apr 15, 2026

CVE-2025-29785

CVE-2025-29785

Description

quic-go is an implementation of the QUIC protocol in Go. The loss recovery logic for path probe packets that was added in the v0.50.0 release can be used to trigger a nil-pointer dereference by a malicious QUIC client. In order to do so, the attacker first sends valid QUIC packets from different remote addresses (thereby triggering the newly added path validation logic: the server sends path probe packets), and then sending ACKs for packets received from the server specifically crafted to trigger the nil-pointer dereference. v0.50.1 contains a patch that fixes the vulnerability. This release contains a test that generates random sequences of sent packets (both regular and path probe packets), that was used to verify that the patch actually covers all corner cases. No known workarounds are available.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/quic-go/quic-goGo
>= 0.50.0, < 0.50.10.50.1

Patches

1
b90058aba5f6

ackhandler: fix panic in probe packet tracking logic (#4998)

https://github.com/quic-go/quic-goMarten SeemannMar 21, 2025via ghsa
2 files changed · +98 4
  • internal/ackhandler/sent_packet_handler.go+3 4 modified
    @@ -460,10 +460,10 @@ func (h *sentPacketHandler) detectAndRemoveAckedPackets(ack *wire.AckFrame, encL
     		}
     		if p.isPathProbePacket {
     			probePacket := pnSpace.history.RemovePathProbe(p.PacketNumber)
    -			if probePacket == nil {
    -				panic(fmt.Sprintf("path probe doesn't exist: %d", p.PacketNumber))
    +			// the probe packet might already have been declared lost
    +			if probePacket != nil {
    +				h.ackedPackets = append(h.ackedPackets, probePacket)
     			}
    -			h.ackedPackets = append(h.ackedPackets, probePacket)
     			continue
     		}
     		h.ackedPackets = append(h.ackedPackets, p)
    @@ -658,7 +658,6 @@ func (h *sentPacketHandler) detectLostPathProbes(now time.Time) {
     		for _, f := range p.Frames {
     			f.Handler.OnLost(f.Frame)
     		}
    -		h.appDataPackets.history.Remove(p.PacketNumber)
     		h.appDataPackets.history.RemovePathProbe(p.PacketNumber)
     	}
     }
    
  • internal/ackhandler/sent_packet_handler_test.go+95 0 modified
    @@ -1,7 +1,9 @@
     package ackhandler
     
     import (
    +	"encoding/binary"
     	"fmt"
    +	"math/rand/v2"
     	"slices"
     	"testing"
     	"time"
    @@ -39,6 +41,11 @@ type packetTracker struct {
     	Lost  []protocol.PacketNumber
     }
     
    +func (t *packetTracker) Reset() {
    +	t.Acked = nil
    +	t.Lost = nil
    +}
    +
     func (t *packetTracker) NewPingFrame(pn protocol.PacketNumber) Frame {
     	return Frame{
     		Frame: &wire.PingFrame{},
    @@ -1227,3 +1234,91 @@ func TestSentPacketHandlerPathProbeAckAndLoss(t *testing.T) {
     
     	require.Equal(t, t2.Add(pathProbePacketLossTimeout), sph.GetLossDetectionTimeout())
     }
    +
    +// The packet tracking logic is pretty complex.
    +// We test it with a randomized approach, to make sure that it doesn't panic under any circumstances.
    +func TestSentPacketHandlerRandomized(t *testing.T) {
    +	seed := uint64(time.Now().UnixNano())
    +	for i := range 5 {
    +		t.Run(fmt.Sprintf("run %d (seed %d)", i+1, seed), func(t *testing.T) {
    +			testSentPacketHandlerRandomized(t, seed)
    +		})
    +		seed++
    +	}
    +}
    +
    +func testSentPacketHandlerRandomized(t *testing.T, seed uint64) {
    +	var b [32]byte
    +	binary.BigEndian.PutUint64(b[:], seed)
    +	r := rand.New(rand.NewChaCha8(b))
    +
    +	var rttStats utils.RTTStats
    +	rtt := []time.Duration{10 * time.Millisecond, 100 * time.Millisecond, 1000 * time.Millisecond}[r.IntN(3)]
    +	t.Logf("rtt: %dms", rtt.Milliseconds())
    +	rttStats.UpdateRTT(rtt, 0) // RTT of the original path
    +
    +	randDuration := func(min, max time.Duration) time.Duration {
    +		return time.Duration(rand.Int64N(int64(max-min))) + min
    +	}
    +
    +	sph := newSentPacketHandler(
    +		0,
    +		1200,
    +		&rttStats,
    +		true,
    +		false,
    +		protocol.PerspectiveClient,
    +		nil,
    +		utils.DefaultLogger,
    +	)
    +	sph.DropPackets(protocol.EncryptionInitial, time.Now())
    +	sph.DropPackets(protocol.EncryptionHandshake, time.Now())
    +
    +	var packets packetTracker
    +	sendPacket := func(ti time.Time, isPathProbe bool) protocol.PacketNumber {
    +		pn := sph.PopPacketNumber(protocol.Encryption1RTT)
    +		sph.SentPacket(ti, pn, protocol.InvalidPacketNumber, nil, []Frame{packets.NewPingFrame(pn)}, protocol.Encryption1RTT, protocol.ECNNon, 1200, false, isPathProbe)
    +		return pn
    +	}
    +
    +	now := time.Now()
    +	start := now
    +	var pns []protocol.PacketNumber
    +	for range 4 {
    +		isProbe := r.Int()%2 == 0
    +		pn := sendPacket(now, isProbe)
    +		t.Logf("t=%dms: sending packet %d (probe packet: %t)", now.Sub(start).Milliseconds(), pn, isProbe)
    +		pns = append(pns, pn)
    +		now = now.Add(randDuration(0, 500*time.Millisecond))
    +		if r.Int()%3 == 0 {
    +			sph.OnLossDetectionTimeout(now)
    +			t.Logf("t=%dms: loss detection timeout (lost: %v)", now.Sub(start).Milliseconds(), packets.Lost)
    +			packets.Reset()
    +			now = now.Add(randDuration(0, 500*time.Millisecond))
    +		}
    +		if r.Int()%3 == 0 {
    +			// acknowledge up to 2 random packet numbers from the pns slice
    +			var ackPns []protocol.PacketNumber
    +			if len(pns) > 0 {
    +				numToAck := min(1+r.IntN(2), len(pns))
    +				for range numToAck {
    +					ackPns = append(ackPns, pns[r.IntN(len(pns))])
    +				}
    +			}
    +			if len(ackPns) > 1 {
    +				slices.Sort(ackPns)
    +				ackPns = slices.Compact(ackPns)
    +			}
    +			sph.ReceivedAck(&wire.AckFrame{AckRanges: ackRanges(ackPns...)}, protocol.Encryption1RTT, now)
    +			t.Logf("t=%dms: received ACK for packets %v (acked: %v, lost: %v)", now.Sub(start).Milliseconds(), ackPns, packets.Acked, packets.Lost)
    +			packets.Reset()
    +			now = now.Add(randDuration(0, 500*time.Millisecond))
    +		}
    +		if r.Int()%10 == 0 {
    +			sph.MigratedPath(now, 1200)
    +			now = now.Add(randDuration(0, 500*time.Millisecond))
    +		}
    +	}
    +	t.Logf("t=%dms: loss detection timeout (lost: %v)", now.Sub(start).Milliseconds(), packets.Lost)
    +	sph.OnLossDetectionTimeout(now)
    +}
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.