{
  "schema_version": "1.5.0",
  "id": "CURL-CVE-2022-27778",
  "aliases": [
    "CVE-2022-27778"
  ],
  "summary": "curl removes wrong file on error",
  "modified": "2026-04-25T17:48:46.00Z",
  "database_specific": {
    "package": "curl",
    "affects": "tool",
    "URL": "https://curl.se/docs/CVE-2022-27778.json",
    "www": "https://curl.se/docs/CVE-2022-27778.html",
    "issue": "https://hackerone.com/reports/1553598",
    "CWE": {
      "id": "CWE-706",
      "desc": "Use of Incorrectly-Resolved Name or Reference"
    },
    "award": {
      "amount": "2400",
      "currency": "USD"
    },
    "last_affected": "7.83.0",
    "severity": "Medium"
  },
  "published": "2022-05-11T08:00:00.00Z",
  "affected": [
    {
      "ranges": [
        {
           "type": "SEMVER",
           "events": [
             {"introduced": "7.83.0"},
             {"fixed": "7.83.1"}
           ]
        },
        {
           "type": "GIT",
           "repo": "https://github.com/curl/curl.git",
           "events": [
             {"introduced": "08a96c6e4e6cf6a1917a117db1b5394713e3f01f"},
             {"fixed": "8c7ee9083d0d719d0a77ab20d9cc2ae84eeea7f3"}
           ]
        }
      ],
      "versions": [
        "7.83.0"
      ]
    }
  ],
  "credits": [
    {
      "name": "Harry Sintonen",
      "type": "FINDER"
    },
    {
      "name": "Daniel Stenberg",
      "type": "REMEDIATION_DEVELOPER"
    }
  ],
  "details": "curl might remove the wrong file when `--no-clobber` is used together with\n`--remove-on-error`.\n\nThe `--remove-on-error` option tells curl to remove the output file when it\nreturns an error, and not leave a partial file behind. The `--no-clobber`\noption prevents curl from overwriting a file if it already exists, and instead\nappends a number to the name to create a new unused filename.\n\nIf curl adds a number to not \"clobber\" the output and an error occurs during\ntransfer, the remove on error logic would remove the *original* filename\nwithout the added number."
}