CVE-2025-59354: Github.com/dragonflyoss/dragonfly DragonFly Has Weak Integrity Checks Vulnerability
MODERATECVE-2025-59354 is a MODERATE dragonfly has weak integrity checks vulnerability (CWE-328: Use of Weak Hash) affecting Github.com/dragonflyoss/dragonfly libraries in the Go ecosystem. The issue involves dragonfly has weak integrity checks for downloaded files. Remediation is available by upgrading affected packages to version 2.1.0.
CVE-2025-59354 at a Glance
How to Fix CVE-2025-59354
To remediate this vulnerability, upgrade all affected Github.com/dragonflyoss/dragonfly dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/dragonflyoss/dragonfly to 2.1.0
Upgrade d7y.io/dragonfly/v2 to 2.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/dragonflyoss/dragonfly
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-59354, inspect your project dependencies for Github.com/dragonflyoss/dragonfly:
inspect dependencies for github.com/dragonflyoss/dragonfly
Analyze the terminal output to locate any version of Github.com/dragonflyoss/dragonfly in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-328: Use of Weak Hash, where the product uses an algorithm that produces a digest (output value) that does not meet security expectations for a hash function that allows an adversary to reasonably determine the original input (preimage attack), find another input that can produce the same hash (2nd preimage attack), or find multiple inputs that evaluate to the same hash (birthday attack). In Github.com/dragonflyoss/dragonfly, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-59354 Affected Github.com/dragonflyoss/dragonfly Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/dragonflyoss/dragonfly
|
Go |
< 2.1.0
|
2.1.0
|
|
d7y.io/dragonfly/v2
|
Go |
< 2.1.0
|
2.1.0
|
References
Frequently Asked Questions
What is CVE-2025-59354?
Which Github.com/dragonflyoss/dragonfly versions are affected?
What version fixes CVE-2025-59354?
Is github.com/dragonflyoss/dragonfly affected?
Is d7y.io/dragonfly/v2 affected?
What CWE is associated with CVE-2025-59354?
How can I check Go dependencies for CVE-2025-59354?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hx2h-vjw2-8r54",
"modified" : "2025-09-26T16:19:42Z",
"published" : "2025-09-17T20:11:58Z",
"aliases" : [ "CVE-2025-59354" ],
"summary" : "DragonFly has weak integrity checks for downloaded files",
"details" : "### Impact\nThe DragonFly2 uses a variety of hash functions, including the MD5 hash. This algorithm does not provide collision resistance; it is secure only against preimage attacks. While these security guarantees may be enough for the DragonFly2 system, it is not completely clear if there are any scenarios where lack of the collision resistance would compromise the system. There are no clear benefits to keeping the MD5 hash function in the system.\n\n```golang\nvar pieceDigests []string\nfor i := int32(0); i < t.TotalPieces; i++ {\n pieceDigests = append(pieceDigests, t.Pieces[i].Md5)\n}\ndigest := digest.SHA256FromStrings(pieceDigests...)\nif digest != t.PieceMd5Sign {\n t.Errorf(\"invalid digest, desired: %s, actual: %s\", t.PieceMd5Sign, digest)\n t.invalid.Store(true)\n return ErrInvalidDigest\n}\n```\n\nAlice, a peer in the DragonFly2 system, creates two images: an innocent one, and one with malicious code. Both images consist of two pieces, and Alice generates the pieces so that their respective MD5 hashes collide (are the same). Therefore, the PieceMd5Sign metadata of both images are equal. Alice shares the innocent image with other peers, who attest to their validity (i.e., that it works as expected and is not malicious). Bob wants to download the image and requests it from the peer-to-peer network. After downloading the image, Bob checks its integrity with a SHA256 hash that is known to him. Alice, who is participating in the network, had already provided Bob the other image, the malicious one. Bob unintentionally uses the malicious image.\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).",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/dragonflyoss/dragonfly"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "d7y.io/dragonfly/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dragonflyoss/dragonfly/security/advisories/GHSA-hx2h-vjw2-8r54"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59354"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dragonflyoss/dragonfly"
}, {
"type" : "WEB",
"url" : "https://github.com/dragonflyoss/dragonfly/blob/main/docs/security/dragonfly-comprehensive-report-2023.pdf"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2025-3973"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-328" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-09-17T20:11:58Z",
"nvd_published_at" : "2025-09-17T20:15:38Z"
}
}