CWE-22
Allowed-with-ReviewImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Abstraction: Base · Status: Stable
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
13051 vulnerabilities reference this CWE, most recent first.
GHSA-9GH8-9R95-3FC3
Vulnerability from github – Published: 2025-09-02 17:12 – Updated: 2025-09-02 17:12Summary
The vulnerability allows any user to overwrite any files available under the account privileges of the running process.
Details
As part of static analysis, iOS MobSF supports loading and parsing statically linked libraries .a. When parsing such archives, the code extracts the embedded objects to the file system in the working directory of the analysis. The problem is that the current implementation does not prohibit absolute file names inside .a. If an archive item has a name like /abs/path/to/file, the resulting path is constructed as Path(dst) /name; for absolute paths, this leads to a complete substitution of the destination directory: writing occurs directly to the specified absolute directory. the path (outside the working directory).
Thus, an authenticated user who uploaded a specially prepared .a, can write arbitrary files to any directory writable by the user of the MobSF process (for example, /tmp, neighboring directories inside ~/.MobSF, etc.).
The key reason is that checking the "sliding" paths only takes into account the presence of .. (relative traversal), but does not take into account the absoluteness of the name and does not compare the normalized target path with the root directory of the extraction.
What exactly is vulnerable:
mobsf/StaticAnalyzer/views/common/shared_func.py
Function for extracting objects from .a — ar_extract
def ar_extract(checksum, src, dst):
"""Extract AR archive."""
...
ar = arpy.Archive(src)
ar.read_all_headers()
for a, val in ar.archived_files.items():
# Handle archive slip attacks
filtered = a.decode('utf-8', 'ignore')
if is_path_traversal(filtered):
msg = f'Zip slip detected. skipped extracting {filtered}'
logger.warning(msg)
append_scan_status(checksum, msg)
continue
out = Path(dst) / filtered
out.write_bytes(val.read())
- The “slip” check is limited to is_path_traversal(filtered), which looks only for traversal patterns like
..,%2e%2e,%252e. - Therefore, if the .a archive contains a member named '/tmp/pwned.txt', MobSF will write it to
/tmp/pwned.txt, outside the intended working directory.
ar_extract is called from: mobsf/StaticAnalyzer/views/common/a.py
def extract_n_get_files(checksum, src, dst):
dst = Path(dst) / 'static_objects'
dst.mkdir(parents=True, exist_ok=True)
ar_extract(checksum, src, dst.as_posix())
The expectation is that extraction happens only under the static_objects subdirectory, but absolute file names inside the .a break this assumption by directing writes outside that directory.
Attack Scenario
- The attacker creates a valid AR archive.a, in which the name of one of the members is the absolute path (as an example) /home/mobsf/.MobSF/db.sqlite3. This is done by the standard AR (GNU long filename table) mechanism.
- It downloads this one via the web interface or the Static library loading API
.ain MobSF. - During the analysis, MobSF extracts the contents: due to the absolute name, the resulting path becomes /home/mobsf/.MobSF/db.sqlite3, and the file is created/overwritten outside the working directory.
- In our case, the database file was overwritten, which caused MobSF to malfunction.
PoC
-
Using the script, create a file with the payload. In the example, this is "/home/mobsf/.MobSF/db.sqlite3"
-
Connect to the container and verify that the db.sqlite3 file is a database. The scan has not been performed yet.
-
Upload the file for scanning and then update the page to get a server error.
-
Check the file structure after scanning and see that the file has been overwritten.
-
There is a database error in the MobSF log.
Impact
- Arbitrary writing/overwriting of files within the rights of the MobSF process (for example, /tmp, directories with analysis results, logs).
- Distortion of analysis results (substitution of artifacts) and undermining the integrity of reports.
- Implementation of a system malfunction (overwriting the db.sqlite3 file).
- Compromise of the UI (if you have write rights to statics/templates): Stored XSS by overwriting the plug-in.js/template.
- Potential escalation of risks with lax configuration of containers/rights (for example, writing to system paths inside the container if the process is running with excessive privileges).
Mitigation
Reject absolute paths and normalize before writing.
Please, assign all credits to Vasily Leshchenko (Solar AppSec)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 4.4.0"
},
"package": {
"ecosystem": "PyPI",
"name": "mobsf"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.4.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-58162"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2025-09-02T17:12:52Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Summary\nThe vulnerability allows any user to overwrite any files available under the account privileges of the running process.\n\n### Details\nAs part of static analysis, iOS MobSF supports loading and parsing statically linked libraries `.a`. When parsing such archives, the code extracts the embedded objects to the file system in the working directory of the analysis. The problem is that the current implementation does not prohibit absolute file names inside `.a`. If an archive item has a name like /abs/path/to/file, the resulting path is constructed as Path(dst) /name; for absolute paths, this leads to a complete substitution of the destination directory: writing occurs directly to the specified absolute directory. the path (outside the working directory).\n\nThus, an authenticated user who uploaded a specially prepared `.a`, can write arbitrary files to any directory writable by the user of the MobSF process (for example, `/tmp`, neighboring directories inside `~/.MobSF`, etc.).\n\nThe key reason is that checking the \"sliding\" paths only takes into account the presence of `..` (relative traversal), but does not take into account the absoluteness of the name and does not compare the normalized target path with the root directory of the extraction.\n\n### What exactly is vulnerable:\n**mobsf/StaticAnalyzer/views/common/shared_func.py**\nFunction for extracting objects from `.a` \u2014 ar_extract\n```\ndef ar_extract(checksum, src, dst):\n \"\"\"Extract AR archive.\"\"\"\n ...\n ar = arpy.Archive(src)\n ar.read_all_headers()\n for a, val in ar.archived_files.items():\n # Handle archive slip attacks\n filtered = a.decode(\u0027utf-8\u0027, \u0027ignore\u0027)\n if is_path_traversal(filtered):\n msg = f\u0027Zip slip detected. skipped extracting {filtered}\u0027\n logger.warning(msg)\n append_scan_status(checksum, msg)\n continue\n out = Path(dst) / filtered\n out.write_bytes(val.read())\n```\n- The \u201cslip\u201d check is limited to is_path_traversal(filtered), which looks only for traversal patterns like `..`, `%2e%2e`, `%252e`.\n- Therefore, if the .a archive contains a member named \u0027/tmp/pwned.txt\u0027, MobSF will write it to `/tmp/pwned.txt`, outside the intended working directory.\n\nar_extract is called from:\n**mobsf/StaticAnalyzer/views/common/a.py**\n```\ndef extract_n_get_files(checksum, src, dst):\n dst = Path(dst) / \u0027static_objects\u0027\n dst.mkdir(parents=True, exist_ok=True)\n ar_extract(checksum, src, dst.as_posix())\n```\nThe expectation is that extraction happens only under the static_objects subdirectory, but absolute file names inside the `.a` break this assumption by directing writes outside that directory.\n\n### Attack Scenario\n1. The attacker creates a valid AR archive.a, in which the name of one of the members is the absolute path (as an example) /home/mobsf/.MobSF/db.sqlite3. This is done by the standard AR (GNU long filename table) mechanism.\n2. It downloads this one via the web interface or the Static library loading API `.a` in MobSF.\n3. During the analysis, MobSF extracts the contents: due to the absolute name, the resulting path becomes /home/mobsf/.MobSF/db.sqlite3, and the file is created/overwritten outside the working directory.\n4. In our case, the database file was overwritten, which caused MobSF to malfunction.\n### PoC\n1. Using the script, create a file with the payload. In the example, this is \"/home/mobsf/.MobSF/db.sqlite3\"\n\u003cimg width=\"786\" height=\"342\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0b7aee5c-6938-45cc-b668-9ad19f48c2c5\" /\u003e\n\n2. Connect to the container and verify that the db.sqlite3 file is a database. The scan has not been performed yet.\n\u003cimg width=\"2535\" height=\"1507\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0cc92da7-91c0-453f-b1ed-080c9cfaa7f1\" /\u003e\n\n3. Upload the file for scanning and then update the page to get a server error.\n\u003cimg width=\"2559\" height=\"1476\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a5b84ace-b853-46ad-9e2e-afad59ed058a\" /\u003e\n\n4. Check the file structure after scanning and see that the file has been overwritten.\n\u003cimg width=\"797\" height=\"213\" alt=\"image\" src=\"https://github.com/user-attachments/assets/758ba3da-ae25-4c8d-bd8b-932573ca2306\" /\u003e\n\n5. There is a database error in the MobSF log.\n\u003cimg width=\"1724\" height=\"1476\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cd4211b1-2896-45e0-9934-9425b6035f2a\" /\u003e\n\n### Impact\n1. Arbitrary writing/overwriting of files within the rights of the MobSF process (for example, /tmp, directories with analysis results, logs).\n2. Distortion of analysis results (substitution of artifacts) and undermining the integrity of reports.\n3. Implementation of a system malfunction (overwriting the db.sqlite3 file).\n4. Compromise of the UI (if you have write rights to statics/templates): Stored XSS by overwriting the plug-in.js/template.\n5. Potential escalation of risks with lax configuration of containers/rights (for example, writing to system paths inside the container if the process is running with excessive privileges).\n\n\n### Mitigation\nReject absolute paths and normalize before writing. \n\n\n\n### **Please, assign all credits to Vasily Leshchenko (Solar AppSec)**",
"id": "GHSA-9gh8-9r95-3fc3",
"modified": "2025-09-02T17:12:52Z",
"published": "2025-09-02T17:12:52Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-9gh8-9r95-3fc3"
},
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/7f3bc086c028c1b50889cab8a15f7b59b7abdaf9"
},
{
"type": "PACKAGE",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF"
},
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/releases/tag/v4.4.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "MobSF Vulnerable to Arbitrary File Write (AR-Slip) via Absolute Path in .a Extraction"
}
GHSA-9GJ5-WHMR-7G98
Vulnerability from github – Published: 2024-04-03 18:30 – Updated: 2024-04-03 18:30The HCL BigFix Inventory server is vulnerable to path traversal which enables an attacker to read internal application files from the Inventory server. The BigFix Inventory server does not properly restrict the served static file.
{
"affected": [],
"aliases": [
"CVE-2024-23540"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-03T17:15:50Z",
"severity": "MODERATE"
},
"details": "The HCL BigFix Inventory server is vulnerable to path traversal which enables an attacker to read internal application files from the Inventory server. The BigFix Inventory server does not properly restrict the served static file.\n",
"id": "GHSA-9gj5-whmr-7g98",
"modified": "2024-04-03T18:30:41Z",
"published": "2024-04-03T18:30:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-23540"
},
{
"type": "WEB",
"url": "https://support.hcltechsw.com/csm?id=kb_article\u0026sysparm_article=KB0112015"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-9GJW-9F4R-QC87
Vulnerability from github – Published: 2024-07-09 12:30 – Updated: 2024-08-29 21:31Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Codeless Cowidgets – Elementor Addons allows Path Traversal.This issue affects Cowidgets – Elementor Addons: from n/a through 1.1.1.
{
"affected": [],
"aliases": [
"CVE-2024-37419"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-07-09T11:15:13Z",
"severity": "HIGH"
},
"details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in Codeless Cowidgets \u2013 Elementor Addons allows Path Traversal.This issue affects Cowidgets \u2013 Elementor Addons: from n/a through 1.1.1.",
"id": "GHSA-9gjw-9f4r-qc87",
"modified": "2024-08-29T21:31:03Z",
"published": "2024-07-09T12:30:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-37419"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/cowidgets-elementor-addons/wordpress-cowidgets-elementor-addons-plugin-1-1-1-local-file-inclusion-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-9GM2-F3J7-6VJ6
Vulnerability from github – Published: 2023-12-14 18:30 – Updated: 2023-12-14 18:30Dell PowerProtect DD , versions prior to 7.13.0.10, LTS 7.7.5.25, LTS 7.10.1.15, 6.2.1.110 contain a path traversal vulnerability. A local high privileged attacker could potentially exploit this vulnerability, to gain unauthorized read and write access to the OS files stored on the server filesystem, with the privileges of the running application.
{
"affected": [],
"aliases": [
"CVE-2023-44278"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-12-14T16:15:45Z",
"severity": "MODERATE"
},
"details": "\nDell PowerProtect DD , versions prior to 7.13.0.10, LTS 7.7.5.25, LTS 7.10.1.15, 6.2.1.110 contain a path traversal vulnerability. A local high privileged attacker could potentially exploit this vulnerability, to gain unauthorized read and write access to the OS files stored on the server filesystem, with the privileges of the running application. \n\n",
"id": "GHSA-9gm2-f3j7-6vj6",
"modified": "2023-12-14T18:30:20Z",
"published": "2023-12-14T18:30:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-44278"
},
{
"type": "WEB",
"url": "https://www.dell.com/support/kbdoc/en-us/000220264/dsa-2023-412-dell-technologies-powerprotect-security-update-for-multiple-security-vulnerabilities"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-9GMC-4822-R428
Vulnerability from github – Published: 2022-05-14 03:37 – Updated: 2022-05-14 03:37An issue was discovered in Reprise License Manager 11.0. This vulnerability is a Path Traversal where the attacker, by changing a field in the Web Request, can have access to files on the File System of the Server. By specifying a pathname in the POST parameter "lf" to the goform/edit_lf_get_data URI, the attacker can retrieve the content of a file.
{
"affected": [],
"aliases": [
"CVE-2018-5716"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-02-21T15:29:00Z",
"severity": "HIGH"
},
"details": "An issue was discovered in Reprise License Manager 11.0. This vulnerability is a Path Traversal where the attacker, by changing a field in the Web Request, can have access to files on the File System of the Server. By specifying a pathname in the POST parameter \"lf\" to the goform/edit_lf_get_data URI, the attacker can retrieve the content of a file.",
"id": "GHSA-9gmc-4822-r428",
"modified": "2022-05-14T03:37:02Z",
"published": "2022-05-14T03:37:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-5716"
},
{
"type": "WEB",
"url": "http://www.0x90.zone/web/path-traversal/2018/02/16/Path-Traversal-Reprise-LM.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-9GPQ-GGJ7-CRMM
Vulnerability from github – Published: 2026-03-25 18:31 – Updated: 2026-03-26 21:31Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in vanquish WooCommerce Support Ticket System woocommerce-support-ticket-system allows Path Traversal.This issue affects WooCommerce Support Ticket System: from n/a through < 18.5.
{
"affected": [],
"aliases": [
"CVE-2026-32522"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-25T17:17:05Z",
"severity": "HIGH"
},
"details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in vanquish WooCommerce Support Ticket System woocommerce-support-ticket-system allows Path Traversal.This issue affects WooCommerce Support Ticket System: from n/a through \u003c 18.5.",
"id": "GHSA-9gpq-ggj7-crmm",
"modified": "2026-03-26T21:31:25Z",
"published": "2026-03-25T18:31:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32522"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/woocommerce-support-ticket-system/vulnerability/wordpress-woocommerce-support-ticket-system-plugin-18-5-arbitrary-file-deletion-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-9GQ3-5H72-2FW5
Vulnerability from github – Published: 2023-08-16 15:30 – Updated: 2024-04-04 06:59Directory Traversal vulnerability in Server functionalty in Even Balance Punkbuster version 1.902 before 1.905 allows remote attackers to execute arbitrary code.
{
"affected": [],
"aliases": [
"CVE-2020-26037"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-08-16T13:15:10Z",
"severity": "CRITICAL"
},
"details": "Directory Traversal vulnerability in Server functionalty in Even Balance Punkbuster version 1.902 before 1.905 allows remote attackers to execute arbitrary code.",
"id": "GHSA-9gq3-5h72-2fw5",
"modified": "2024-04-04T06:59:28Z",
"published": "2023-08-16T15:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-26037"
},
{
"type": "WEB",
"url": "https://medium.com/%40prizmant/hacking-punkbuster-e22e6cf2f36e"
},
{
"type": "WEB",
"url": "https://medium.com/@prizmant/hacking-punkbuster-e22e6cf2f36e"
},
{
"type": "WEB",
"url": "http://even.com"
},
{
"type": "WEB",
"url": "http://punkbuster.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-9GQX-53GP-C8G3
Vulnerability from github – Published: 2026-04-22 18:31 – Updated: 2026-07-06 17:41Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-4c7q-4928-8445. This link is maintained to preserve external references.
Original Description
A vulnerability in the chmod utility of uutils coreutils allows users to bypass the --preserve-root safety mechanism. The implementation only validates if the target path is literally / and does not canonicalize the path. An attacker or accidental user can use path variants such as /../ or symbolic links to execute destructive recursive operations (e.g., chmod -R 000) on the entire root filesystem, leading to system-wide permission loss and potential complete system breakdown.
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "coreutils"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.6.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-29T22:36:35Z",
"nvd_published_at": "2026-04-22T17:16:35Z",
"severity": "HIGH"
},
"details": "### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-4c7q-4928-8445. This link is maintained to preserve external references.\n\n### Original Description\nA vulnerability in the chmod utility of uutils coreutils allows users to bypass the --preserve-root safety mechanism. The implementation only validates if the target path is literally / and does not canonicalize the path. An attacker or accidental user can use path variants such as /../ or symbolic links to execute destructive recursive operations (e.g., chmod -R 000) on the entire root filesystem, leading to system-wide permission loss and potential complete system breakdown.",
"id": "GHSA-9gqx-53gp-c8g3",
"modified": "2026-07-06T17:41:39Z",
"published": "2026-04-22T18:31:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-35338"
},
{
"type": "WEB",
"url": "https://github.com/uutils/coreutils/pull/10033"
},
{
"type": "WEB",
"url": "https://github.com/uutils/coreutils/commit/413055b378fa6fe2299c5e5f538c8e6e841ab810"
},
{
"type": "PACKAGE",
"url": "https://github.com/uutils/coreutils"
},
{
"type": "WEB",
"url": "https://github.com/uutils/coreutils/releases/tag/0.6.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Duplicate Advisory: uutils coreutils allows users to bypass the --preserve-root safety mechanism",
"withdrawn": "2026-07-06T17:41:39Z"
}
GHSA-9GV2-J8JV-76CJ
Vulnerability from github – Published: 2022-05-14 03:14 – Updated: 2022-05-14 03:14Arbitrary File Read exists in PHP Scripts Mall Schools Alert Management Script via the f parameter in img.php, aka absolute path traversal.
{
"affected": [],
"aliases": [
"CVE-2018-12054"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-06-08T11:29:00Z",
"severity": "HIGH"
},
"details": "Arbitrary File Read exists in PHP Scripts Mall Schools Alert Management Script via the f parameter in img.php, aka absolute path traversal.",
"id": "GHSA-9gv2-j8jv-76cj",
"modified": "2022-05-14T03:14:09Z",
"published": "2022-05-14T03:14:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-12054"
},
{
"type": "WEB",
"url": "https://github.com/unh3x/just4cve/issues/4"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/44874"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-9GV4-5H2M-635X
Vulnerability from github – Published: 2023-04-16 03:30 – Updated: 2024-04-04 03:29The Managentities plugin before 4.0.2 for GLPI allows reading local files via directory traversal in the inc/cri.class.php file parameter.
{
"affected": [],
"aliases": [
"CVE-2022-34127"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-04-16T03:15:00Z",
"severity": "HIGH"
},
"details": "The Managentities plugin before 4.0.2 for GLPI allows reading local files via directory traversal in the inc/cri.class.php file parameter.",
"id": "GHSA-9gv4-5h2m-635x",
"modified": "2024-04-04T03:29:45Z",
"published": "2023-04-16T03:30:24Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/InfotelGLPI/manageentities/security/advisories/GHSA-4hpg-m8fv-xv3h"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-34127"
},
{
"type": "WEB",
"url": "https://github.com/InfotelGLPI/manageentities/releases/tag/4.0.2"
},
{
"type": "WEB",
"url": "https://pentest.blog/advisory-glpi-service-management-software-sql-injection-remote-code-execution-and-local-file-inclusion"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-5.1
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
- Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-20.1
Strategy: Input Validation
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
- Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
- realpath() in C
- getCanonicalPath() in Java
- GetFullPath() in ASP.NET
- realpath() or abs_path() in Perl
- realpath() in PHP
Mitigation MIT-4
Strategy: Libraries or Frameworks
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Mitigation MIT-17
Strategy: Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Mitigation MIT-21.1
Strategy: Enforcement by Conversion
- When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Strategy: Sandbox or Jail
- Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
- OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Strategy: Attack Surface Reduction
- Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
- This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-126: Path Traversal
An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.
CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic
This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
CAPEC-78: Using Escaped Slashes in Alternate Encoding
This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.
CAPEC-79: Using Slashes in Alternate Encoding
This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.