CVE-2023-0591 (GCVE-0-2023-0591)
Vulnerability from cvelistv5
Published
2023-01-31 09:18
Modified
2025-03-26 20:38
CWE
  • CWE-22 - Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Summary
ubireader_extract_files is vulnerable to path traversal when run against specifically crafted UBIFS files, allowing the attacker to overwrite files outside of the extraction directory (provided the process has write access to that file or directory). This is due to the fact that a node name (dent_node.name) is considered trusted and joined to the extraction directory path during processing, then the node content is written to that joined path. By crafting a malicious UBIFS file with node names holding path traversal payloads (e.g. ../../tmp/outside.txt), it's possible to force ubi_reader to write outside of the extraction directory. This issue affects ubi-reader before 0.8.5.
Impacted products
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T05:17:50.021Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://github.com/jrspruitt/ubi_reader/pull/57"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2023-0591",
                "options": [
                  {
                    "Exploitation": "poc"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-03-26T20:38:06.296581Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-03-26T20:38:12.757Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "collectionURL": "https://pypi.org/project/ubi-reader/",
          "defaultStatus": "unaffected",
          "modules": [
            "ubireader_extract_files"
          ],
          "packageName": "ubi-reader",
          "product": "ubi_reader",
          "repo": "https://github.com/jrspruitt/ubi_reader",
          "vendor": " jrspruitt",
          "versions": [
            {
              "lessThan": "0.8.5",
              "status": "affected",
              "version": "0",
              "versionType": "0.8.4"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "user": "00000000-0000-4000-9000-000000000000",
          "value": "Quentin Kaiser from ONEKEY Research Labs"
        },
        {
          "lang": "en",
          "type": "remediation reviewer",
          "user": "00000000-0000-4000-9000-000000000000",
          "value": "Jason Pruitt"
        }
      ],
      "datePublic": "2023-01-31T08:00:00.000Z",
      "descriptions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\n\n\u003cp\u003eubireader_extract_files is vulnerable to path traversal when run against specifically crafted UBIFS files, allowing the attacker to overwrite files outside of the extraction directory (provided the process has write access to that file or directory).\u003c/p\u003e\u003cp\u003eThis is due to the fact that a node name (\u003ccode\u003edent_node.name\u003c/code\u003e) is considered trusted and joined to the extraction directory path during processing, then the node content is written to that joined path. By crafting a malicious UBIFS file with node names holding path traversal payloads (e.g. \u003ccode\u003e../../tmp/outside.txt\u003c/code\u003e), it\u0027s possible to force ubi_reader to write outside of the extraction directory.\u003c/p\u003e\n\n\u003cp\u003eThis issue affects ubi-reader before 0.8.5.\u003c/p\u003e"
            }
          ],
          "value": "\nubireader_extract_files is vulnerable to path traversal when run against specifically crafted UBIFS files, allowing the attacker to overwrite files outside of the extraction directory (provided the process has write access to that file or directory).\n\nThis is due to the fact that a node name (dent_node.name) is considered trusted and joined to the extraction directory path during processing, then the node content is written to that joined path. By crafting a malicious UBIFS file with node names holding path traversal payloads (e.g. ../../tmp/outside.txt), it\u0027s possible to force ubi_reader to write outside of the extraction directory.\n\n\n\nThis issue affects ubi-reader before 0.8.5.\n\n"
        }
      ],
      "exploits": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "Proof-of-concept."
            }
          ],
          "value": "Proof-of-concept."
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-126",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-126 Path Traversal"
            }
          ]
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "attackComplexity": "LOW",
            "attackVector": "LOCAL",
            "availabilityImpact": "NONE",
            "baseScore": 5.5,
            "baseSeverity": "MEDIUM",
            "confidentialityImpact": "NONE",
            "integrityImpact": "HIGH",
            "privilegesRequired": "NONE",
            "scope": "UNCHANGED",
            "userInteraction": "REQUIRED",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
            "version": "3.1"
          },
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-22",
              "description": "CWE-22 Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2023-01-31T09:32:07.165Z",
        "orgId": "2d533b80-6e4a-4e20-93e2-171235122846",
        "shortName": "ONEKEY"
      },
      "references": [
        {
          "url": "https://github.com/jrspruitt/ubi_reader/pull/57"
        },
        {
          "url": "https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/"
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "Upgrade to version 0.8.5"
            }
          ],
          "value": "Upgrade to version 0.8.5"
        }
      ],
      "source": {
        "discovery": "UNKNOWN"
      },
      "title": "Path Traversal in ubi_reader",
      "x_generator": {
        "engine": "Vulnogram 0.1.0-dev"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "2d533b80-6e4a-4e20-93e2-171235122846",
    "assignerShortName": "ONEKEY",
    "cveId": "CVE-2023-0591",
    "datePublished": "2023-01-31T09:18:07.998Z",
    "dateReserved": "2023-01-31T09:05:42.738Z",
    "dateUpdated": "2025-03-26T20:38:12.757Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2023-0591\",\"sourceIdentifier\":\"research@onekey.com\",\"published\":\"2023-01-31T10:15:10.253\",\"lastModified\":\"2024-11-21T07:37:27.217\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"\\nubireader_extract_files is vulnerable to path traversal when run against specifically crafted UBIFS files, allowing the attacker to overwrite files outside of the extraction directory (provided the process has write access to that file or directory).\\n\\nThis is due to the fact that a node name (dent_node.name) is considered trusted and joined to the extraction directory path during processing, then the node content is written to that joined path. By crafting a malicious UBIFS file with node names holding path traversal payloads (e.g. ../../tmp/outside.txt), it\u0027s possible to force ubi_reader to write outside of the extraction directory.\\n\\n\\n\\nThis issue affects ubi-reader before 0.8.5.\\n\\n\"},{\"lang\":\"es\",\"value\":\"ubireader_extract_files es vulnerable a path traversal cuando se ejecuta contra archivos UBIFS espec\u00edficamente manipulados, lo que permite al atacante sobrescribir archivos fuera del directorio de extracci\u00f3n (siempre que el proceso tenga acceso de escritura a ese archivo o directorio). Esto se debe al hecho de que un nombre de nodo (dent_node.name) se considera confiable y se une a la ruta del directorio de extracci\u00f3n durante el procesamiento; luego, el contenido del nodo se escribe en esa ruta unida. Al crear un archivo UBIFS malicioso con nombres de nodos que contienen payloads de path traversal (por ejemplo, ../../tmp/outside.txt), es posible forzar a ubi_reader a escribir fuera del directorio de extracci\u00f3n. Este problema afecta a ubi-reader antes de 0.8.5.x\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"research@onekey.com\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"REQUIRED\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"NONE\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"REQUIRED\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"NONE\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"research@onekey.com\",\"type\":\"Secondary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-22\"}]},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-22\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:a:ubi_reader_project:ubi_reader:*:*:*:*:*:*:*:*\",\"versionEndExcluding\":\"0.8.5\",\"matchCriteriaId\":\"44B81021-E665-42B2-A24A-74E646BCE470\"}]}]}],\"references\":[{\"url\":\"https://github.com/jrspruitt/ubi_reader/pull/57\",\"source\":\"research@onekey.com\",\"tags\":[\"Patch\",\"Third Party Advisory\"]},{\"url\":\"https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/\",\"source\":\"research@onekey.com\",\"tags\":[\"Exploit\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/jrspruitt/ubi_reader/pull/57\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\",\"Third Party Advisory\"]},{\"url\":\"https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Exploit\",\"Third Party Advisory\"]}]}}",
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://github.com/jrspruitt/ubi_reader/pull/57\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T05:17:50.021Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2023-0591\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"poc\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-03-26T20:38:06.296581Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-03-26T20:38:09.266Z\"}}], \"cna\": {\"title\": \"Path Traversal in ubi_reader\", \"source\": {\"discovery\": \"UNKNOWN\"}, \"credits\": [{\"lang\": \"en\", \"type\": \"finder\", \"user\": \"00000000-0000-4000-9000-000000000000\", \"value\": \"Quentin Kaiser from ONEKEY Research Labs\"}, {\"lang\": \"en\", \"type\": \"remediation reviewer\", \"user\": \"00000000-0000-4000-9000-000000000000\", \"value\": \"Jason Pruitt\"}], \"impacts\": [{\"capecId\": \"CAPEC-126\", \"descriptions\": [{\"lang\": \"en\", \"value\": \"CAPEC-126 Path Traversal\"}]}], \"metrics\": [{\"format\": \"CVSS\", \"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.5, \"attackVector\": \"LOCAL\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N\", \"integrityImpact\": \"HIGH\", \"userInteraction\": \"REQUIRED\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"NONE\", \"privilegesRequired\": \"NONE\", \"confidentialityImpact\": \"NONE\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"GENERAL\"}]}], \"affected\": [{\"repo\": \"https://github.com/jrspruitt/ubi_reader\", \"vendor\": \" jrspruitt\", \"modules\": [\"ubireader_extract_files\"], \"product\": \"ubi_reader\", \"versions\": [{\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"0.8.5\", \"versionType\": \"0.8.4\"}], \"packageName\": \"ubi-reader\", \"collectionURL\": \"https://pypi.org/project/ubi-reader/\", \"defaultStatus\": \"unaffected\"}], \"exploits\": [{\"lang\": \"en\", \"value\": \"Proof-of-concept.\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"Proof-of-concept.\", \"base64\": false}]}], \"solutions\": [{\"lang\": \"en\", \"value\": \"Upgrade to version 0.8.5\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"Upgrade to version 0.8.5\", \"base64\": false}]}], \"datePublic\": \"2023-01-31T08:00:00.000Z\", \"references\": [{\"url\": \"https://github.com/jrspruitt/ubi_reader/pull/57\"}, {\"url\": \"https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/\"}], \"x_generator\": {\"engine\": \"Vulnogram 0.1.0-dev\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"\\nubireader_extract_files is vulnerable to path traversal when run against specifically crafted UBIFS files, allowing the attacker to overwrite files outside of the extraction directory (provided the process has write access to that file or directory).\\n\\nThis is due to the fact that a node name (dent_node.name) is considered trusted and joined to the extraction directory path during processing, then the node content is written to that joined path. By crafting a malicious UBIFS file with node names holding path traversal payloads (e.g. ../../tmp/outside.txt), it\u0027s possible to force ubi_reader to write outside of the extraction directory.\\n\\n\\n\\nThis issue affects ubi-reader before 0.8.5.\\n\\n\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"\\n\\n\u003cp\u003eubireader_extract_files is vulnerable to path traversal when run against specifically crafted UBIFS files, allowing the attacker to overwrite files outside of the extraction directory (provided the process has write access to that file or directory).\u003c/p\u003e\u003cp\u003eThis is due to the fact that a node name (\u003ccode\u003edent_node.name\u003c/code\u003e) is considered trusted and joined to the extraction directory path during processing, then the node content is written to that joined path. By crafting a malicious UBIFS file with node names holding path traversal payloads (e.g. \u003ccode\u003e../../tmp/outside.txt\u003c/code\u003e), it\u0027s possible to force ubi_reader to write outside of the extraction directory.\u003c/p\u003e\\n\\n\u003cp\u003eThis issue affects ubi-reader before 0.8.5.\u003c/p\u003e\", \"base64\": false}]}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-22\", \"description\": \"CWE-22 Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027)\"}]}], \"providerMetadata\": {\"orgId\": \"2d533b80-6e4a-4e20-93e2-171235122846\", \"shortName\": \"ONEKEY\", \"dateUpdated\": \"2023-01-31T09:32:07.165Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2023-0591\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-03-26T20:38:12.757Z\", \"dateReserved\": \"2023-01-31T09:05:42.738Z\", \"assignerOrgId\": \"2d533b80-6e4a-4e20-93e2-171235122846\", \"datePublished\": \"2023-01-31T09:18:07.998Z\", \"assignerShortName\": \"ONEKEY\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…