curl might remove the wrong file when --no-clobber is used together with
--remove-on-error.
The --remove-on-error option tells curl to remove the output file when it
returns an error, and not leave a partial file behind. The --no-clobber
option prevents curl from overwriting a file if it already exists, and instead
appends a number to the name to create a new unused filename.
If curl adds a number to not "clobber" the output and an error occurs during transfer, the remove on error logic would remove the original filename without the added number.
{
"CWE": {
"desc": "Use of Incorrectly-Resolved Name or Reference",
"id": "CWE-706"
},
"URL": "https://curl.se/docs/CVE-2022-27778.json",
"affects": "tool",
"award": {
"amount": "2400",
"currency": "USD"
},
"issue": "https://hackerone.com/reports/1553598",
"last_affected": "7.83.0",
"package": "curl",
"severity": "Medium",
"www": "https://curl.se/docs/CVE-2022-27778.html"
}