CVE-2025-59351
JSON

2.7low

Dragonfly possibly panics due to nil pointer dereference when using variables created alongside an error

Severity
2.7low CVSS:4.0 by GitHub_M
Exploit likelihood
0.31% (higher than 26% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4mhv-8rh3-4ghwGO-2025-3970

Description

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.

Affected

Product or packageVersionsReported by
dragonflyoss dragonfly< 2.1.0CVE List
github.com/dragonflyoss/dragonfly (Go)before 2.1.0, all versionsGitHub Advisory Database, Go Vulnerability Database
d7y.io/dragonfly/v2 (Go)before 2.1.0GitHub Advisory Database, Go Vulnerability Database
linuxfoundation dragonflybefore 2.1.0NVD

All scores

GitHub_M2.7low CVSS:4.0CVSS: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
GitHubmedium CVSS:4.0CVSS: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
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-476

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
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.

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.

Go Vulnerability Database

DragonFly vulnerable to panics due to nil pointer dereference when using variables created alongside an error in d7y.io/dragonfly

NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-59351 changed 2025-09-18CVE Terms of Use
GitHub Advisory DatabaseGHSA-4mhv-8rh3-4ghw changed 2025-09-26CC-BY-4.0
Go Vulnerability DatabaseGO-2025-3970 changed 2026-03-03CC-BY-4.0
NVDCVE-2025-59351 changed 2026-06-17Public domain