CVE-2021-22922: Wrong content via metalink not discarded
What the report claims
When compiled with libmetalink and used with --metalink, curl checks cryptographic hashes but leaves files with incorrect hashes on disk, potentially assuming they are valid.
Compare with curl's recorded outcome
Known vulnerability
A real vulnerability: CVE-2021-22922 Wrong content via Metalink not discarded
Shown for comparison after analysis. The pipeline did not see this label.
ProveIt's finding
The available evidence does not settle the report. A maintainer should investigate.
Why this finding?
- No curl source code was provided for the metalink hash validation implementation at revision 1c1d9f1affbd
- Deterministic checks only confirm existence of 'validating' and 'FAILED' strings, not the file disposal behavior
- The report describes a plausible security issue (failed hash validation should discard file) but the code path cannot be verified
- External sources confirm metalink spec uses hashes for integrity verification but do not mandate implementation behavior on failure
What still needs checking
- curl source code for metalink hash validation (likely in lib/metalink.c or similar)
- Code showing what happens after hash validation fails (file deletion vs retention)
How this analysis ran 5 claims · 0 citations verified
Checked against curl master on 2021-05-30 (1c1d9f1affbd). Dev evaluation split. Citation verification checks that a referenced line was in the evidence; it does not prove the model interpreted it correctly.
Review a draft reply to the reporter
Edit and verify before sending.
Thank you for the detailed report. The metalink hash validation behavior you describe is a plausible security concern. However, we need to examine the actual curl source code handling metalink validation (likely in lib/metalink.c) to confirm whether files with failed hash checks are retained or discarded. Could you point to the specific function or file where the validation result is handled? The deterministic checks show 'validating' and 'FAILED' strings exist in the codebase, but we need to see the implementation to verify the fix is needed.
Inspect all claims and source code 5 claims · 0 code excerpts
Report claims
curl checks the cryptographic hash of downloaded files but does not discard files with incorrect hashes
Read the reasoning
No curl source code was provided to verify the metalink hash validation implementation. The deterministic checks only confirm that strings 'validating' and 'FAILED' exist in the codebase, but do not show the code path that handles hash validation failure or file disposal.
The issue occurs when using --metalink with libmetalink enabled
Read the reasoning
Cannot verify the --metalink and libmetalink code paths without the curl source code.
A metalink XML file containing an incorrect sha-256 hash causes the validation to fail but the file is still saved
Read the reasoning
Cannot verify the trigger behavior (file saved despite hash mismatch) without the curl source code showing the validation and file handling logic.
Modified or tampered files are kept and may be incorrectly assumed valid
Read the reasoning
Impact claim depends on C1 and C3 being true; cannot verify without code.
The reproduction involves building curl with --with-libmetalink, creating a metalink XML with an incorrect hash, and running curl --metalink
Read the reasoning
Reproduction steps reference code paths that cannot be verified without the curl source code.
What the report says about other projects
confirmed The metalink specification requires hash validation to verify file integrity
“Hashes are used to verify the integrity of a complete file or portion of a file to determine if the file has been transferred without any errors.” source
Read the original report
Source code
No source code was retrieved for this analysis. The evidence may be incomplete.