{"id":"CVE-2025-59351","aliases":["CVE-2025-59351","GHSA-4mhv-8rh3-4ghw","GO-2025-3970"],"related":[],"kind":"vulnerability","state":"published","title":"Dragonfly possibly panics due to nil pointer dereference when using variables created alongside an error","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nWe 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.\n\n```golang\nrequest, err := source.NewRequestWithContext(ctx, parentReq.Url,\nparentReq.UrlMeta.Header)\nif err != nil {\n       log.Errorf(\"generate url [%v] request error: %v\", request.URL, err)\n       span.RecordError(err)\n       return err\n}\n```\n\nEve 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.\n\n### Patches\n\n- Dragonfy v2.1.0 and above.\n\n### Workarounds\n\nThere are no effective workarounds, beyond upgrading.\n\n### References\n\nA third party security audit was performed by Trail of Bits, you can see the [full report](https://github.com/dragonflyoss/dragonfly/blob/main/docs/security/dragonfly-comprehensive-report-2023.pdf).\n\nIf you have any questions or comments about this advisory, please email us at [dragonfly-maintainers@googlegroups.com](mailto:dragonfly-maintainers@googlegroups.com).","format":"markdown","source":"ghsa"},{"lang":"en","text":"DragonFly vulnerable to panics due to nil pointer dereference when using variables created alongside an error in d7y.io/dragonfly","format":"markdown","source":"go"},{"lang":"es","text":"Dragonfly es un sistema de distribución de archivos y aceleración de imágenes de código abierto basado en P2P. Antes de la 2.1.0, el primer valor de retorno de una función es desreferenciado incluso cuando la función devuelve un error. Esto puede resultar en una desreferenciación nula y provocar un pánico en el código. Esta vulnerabilidad se corrigió en la 2.1.0.","source":"nvd"}],"published":"2025-09-17T19:46:41.322Z","modified":"2026-06-17T09:45:57.573Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U","score":2.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U","score":2.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":"< 2.1.0","status":"affected"}],"vendor":"dragonflyoss","product":"dragonfly","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.0"}],"ecosystem":"Go","package":"github.com/dragonflyoss/dragonfly","purl":"pkg:golang/github.com/dragonflyoss/dragonfly","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.0"}],"ecosystem":"Go","package":"d7y.io/dragonfly/v2","purl":"pkg:golang/d7y.io/dragonfly/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.0"}],"ecosystem":"Go","package":"d7y.io/dragonfly/v2","purl":"pkg:golang/d7y.io/dragonfly/v2","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/dragonflyoss/dragonfly","purl":"pkg:golang/github.com/dragonflyoss/dragonfly","source":"go"},{"ranges":[{"status":"affected","fixed":"2.1.0"}],"vendor":"linuxfoundation","product":"dragonfly","cpe":"cpe:2.3:a:linuxfoundation:dragonfly:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/dragonflyoss/dragonfly/security/advisories/GHSA-4mhv-8rh3-4ghw","tags":["advisory","patch","third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/dragonflyoss/dragonfly/blob/main/docs/security/dragonfly-comprehensive-report-2023.pdf","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59351","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/dragonflyoss/dragonfly","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2025-3970","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-09-18T17:42:28.918Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-59351","url":"https://www.cve.org/CVERecord?id=CVE-2025-59351","licence":"CVE Terms of Use","modified":"2025-09-18T17:42:35.283Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4mhv-8rh3-4ghw","url":"https://github.com/advisories/GHSA-4mhv-8rh3-4ghw","licence":"CC-BY-4.0","modified":"2025-09-26T16:18:25.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3970","url":"https://pkg.go.dev/vuln/GO-2025-3970","licence":"CC-BY-4.0","modified":"2026-03-03T04:56:56.085Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-59351","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59351","licence":"Public domain","modified":"2026-06-17T09:45:57.573Z"}],"updatedAt":"2026-11-25T22:59:04.802Z","epss":{"score":0.00314,"percentile":0.26287,"date":"2026-12-01T12:00:22.000Z"}}