CVE-2025-59351: Dragonfly possibly panics due to nil pointer dereference when using variables created alongside an error
Impact We found two instances in the DragonFly codebase where the first return value of a function is dereferenced even when the function returns an error (figures 9.1 and 9.2). This can result in a nil dereference, and cause code to panic. The codebase may contain additional instances of the bug.
golang request, err := source.NewRequestWithContext(ctx, parentReq.Url, parentReq.UrlMeta.Header) if err != nil { log.Errorf("generate url [%v] request error: %v", request.URL, err) span.RecordError(err) return err }
Eve is a malicious actor operating a peer machine. She sends a dfdaemonv1.DownRequest request to her peer Alice. Alice’s machine receives the request, resolves a nil variable in the server.Download method, and panics.
Patches
- Dragonfy v2.1.0 and above.
Workarounds
There are no effective workarounds, beyond upgrading.
References
A third party security audit was performed by Trail of Bits, you can see the full report.
If you have any questions or comments about this advisory, please email us at dragonfly-maintainers@googlegroups.com.
Other sources
Dragonfly is an open source P2P-based file distribution and image acceleration system. Prior to 2.1.0, the first return value of a function is dereferenced even when the function returns an error. This can result in a nil dereference, and cause code to panic. This vulnerability is fixed in 2.1.0.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2025-59351?
CVE-2025-59351 has been classified as a critical severity vulnerability due to its potential to cause code to panic from nil dereference.
How do I fix CVE-2025-59351?
To fix CVE-2025-59351, upgrade Dragonfly to version 2.1.0 or later where this issue has been resolved.
What systems are affected by CVE-2025-59351?
CVE-2025-59351 affects all versions of Dragonfly prior to 2.1.0.
What kind of vulnerability is CVE-2025-59351?
CVE-2025-59351 is a nil dereference vulnerability that can lead to application crashes.
Can CVE-2025-59351 be exploited remotely?
Yes, CVE-2025-59351 can potentially be exploited by an attacker if they can invoke the vulnerable function in the affected software.