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.
6008 vulnerabilities reference this CWE, most recent first.
GHSA-F2JF-X5M2-C7QH
Vulnerability from github – Published: 2025-12-23 00:30 – Updated: 2025-12-23 00:30WebTareas 2.4 contains a file upload vulnerability that allows authenticated users to upload malicious PHP files through the chat photo upload functionality. Attackers can upload a PHP file with arbitrary code to the /files/Messages/ directory and execute it directly through the generated file path.
{
"affected": [],
"aliases": [
"CVE-2023-53971"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-22T22:16:02Z",
"severity": "HIGH"
},
"details": "WebTareas 2.4 contains a file upload vulnerability that allows authenticated users to upload malicious PHP files through the chat photo upload functionality. Attackers can upload a PHP file with arbitrary code to the /files/Messages/ directory and execute it directly through the generated file path.",
"id": "GHSA-f2jf-x5m2-c7qh",
"modified": "2025-12-23T00:30:31Z",
"published": "2025-12-23T00:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-53971"
},
{
"type": "WEB",
"url": "https://sourceforge.net/projects/webtareas"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/51089"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/webtareas-authenticated-remote-code-execution-via-file-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-F2VV-V8XV-QGM8
Vulnerability from github – Published: 2022-05-24 16:56 – Updated: 2024-04-04 01:58An Improper Access Control: CWE-284 vulnerability exists in U.motion Server (MEG6501-0001 - U.motion KNX server, MEG6501-0002 - U.motion KNX Server Plus, MEG6260-0410 - U.motion KNX Server Plus, Touch 10, MEG6260-0415 - U.motion KNX Server Plus, Touch 15), which could allow a user with low privileges to upload a rogue file.
{
"affected": [],
"aliases": [
"CVE-2019-6839"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-09-17T20:15:00Z",
"severity": "HIGH"
},
"details": "An Improper Access Control: CWE-284 vulnerability exists in U.motion Server (MEG6501-0001 - U.motion KNX server, MEG6501-0002 - U.motion KNX Server Plus, MEG6260-0410 - U.motion KNX Server Plus, Touch 10, MEG6260-0415 - U.motion KNX Server Plus, Touch 15), which could allow a user with low privileges to upload a rogue file.",
"id": "GHSA-f2vv-v8xv-qgm8",
"modified": "2024-04-04T01:58:02Z",
"published": "2022-05-24T16:56:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-6839"
},
{
"type": "WEB",
"url": "https://www.schneider-electric.com/ww/en/download/document/SEVD-2019-253-01"
},
{
"type": "WEB",
"url": "https://www.se.com/ww/en/download/document/SEVD-2019-253-01"
}
],
"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-F33H-GM37-5R83
Vulnerability from github – Published: 2025-04-19 09:31 – Updated: 2025-04-19 09:31The Wordpress Plugin Smart Product Review plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in all versions up to, and including, 1.0.4. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.
{
"affected": [],
"aliases": [
"CVE-2021-4455"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-19T08:15:13Z",
"severity": "CRITICAL"
},
"details": "The Wordpress Plugin Smart Product Review plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in all versions up to, and including, 1.0.4. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site\u0027s server which may make remote code execution possible.",
"id": "GHSA-f33h-gm37-5r83",
"modified": "2025-04-19T09:31:06Z",
"published": "2025-04-19T09:31:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-4455"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/50533"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/1de9183c-95b9-4500-85e2-08dcee956360?source=cve"
}
],
"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-F35M-48C3-V5MQ
Vulnerability from github – Published: 2022-06-03 00:00 – Updated: 2022-06-10 00:00SQL injection and file upload attacks are possible due to insufficient validation of input values in some parameters and variables of files compromising Maxboard, which may lead to arbitrary code execution or privilege escalation. Attackers can use these vulnerabilities to perform attacks such as stealing server management rights using a web shell.
{
"affected": [],
"aliases": [
"CVE-2021-26634"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-288",
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-06-02T14:15:00Z",
"severity": "CRITICAL"
},
"details": "SQL injection and file upload attacks are possible due to insufficient validation of input values in some parameters and variables of files compromising Maxboard, which may lead to arbitrary code execution or privilege escalation. Attackers can use these vulnerabilities to perform attacks such as stealing server management rights using a web shell.",
"id": "GHSA-f35m-48c3-v5mq",
"modified": "2022-06-10T00:00:55Z",
"published": "2022-06-03T00:00:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-26634"
},
{
"type": "WEB",
"url": "https://www.krcert.or.kr/krcert/secNoticeView.do?bulletin_writing_sequence=66746"
}
],
"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-F35P-HCWF-9F9F
Vulnerability from github – Published: 2022-05-01 23:52 – Updated: 2024-02-09 16:34TYPO3 4.0.x before 4.0.9, 4.1.x before 4.1.7, and 4.2.x before 4.2.1, uses an insufficiently restrictive default fileDenyPattern for Apache, which allows remote attackers to bypass security restrictions and upload configuration files such as .htaccess, or conduct file upload attacks using multiple extensions.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "typo3/cms-core"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "4.0.9"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "typo3/cms-core"
},
"ranges": [
{
"events": [
{
"introduced": "4.1.0"
},
{
"fixed": "4.1.7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "typo3/cms-core"
},
"ranges": [
{
"events": [
{
"introduced": "4.2.0"
},
{
"fixed": "4.2.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2008-2717"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": true,
"github_reviewed_at": "2024-02-09T16:34:40Z",
"nvd_published_at": "2008-06-16T22:41:00Z",
"severity": "MODERATE"
},
"details": "TYPO3 4.0.x before 4.0.9, 4.1.x before 4.1.7, and 4.2.x before 4.2.1, uses an insufficiently restrictive default fileDenyPattern for Apache, which allows remote attackers to bypass security restrictions and upload configuration files such as .htaccess, or conduct file upload attacks using multiple extensions.",
"id": "GHSA-f35p-hcwf-9f9f",
"modified": "2024-02-09T16:34:40Z",
"published": "2022-05-01T23:52:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2717"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/42988"
},
{
"type": "PACKAGE",
"url": "https://github.com/TYPO3-CMS/core"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20080815050856/http://securityreason.com/securityalert/3945"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20081201212626/http://secunia.com/advisories/30619"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20081206030529/http://secunia.com/advisories/30660"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20200228131005/http://www.securityfocus.com/bid/29657"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20201208012148/http://www.securityfocus.com/archive/1/493270/100/0/threaded"
},
{
"type": "WEB",
"url": "http://buzz.typo3.org/teams/security/article/advice-on-core-security-issue-regarding-filedenypattern"
},
{
"type": "WEB",
"url": "http://typo3.org/teams/security/security-bulletins/typo3-20080611-1"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2008/dsa-1596"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "TYPO3 Unrestricted File Upload vulnerability"
}
GHSA-F3CP-C532-V8RX
Vulnerability from github – Published: 2022-11-23 21:30 – Updated: 2025-04-28 21:30CartView.php in ChurchInfo 1.3.0 allows attackers to achieve remote code execution through insecure uploads. This requires authenticated access tot he ChurchInfo application. Once authenticated, a user can add names to their cart, and compose an email. Uploading an attachment for the email stores the attachment on the site in the /tmp_attach/ folder where it can be accessed with a GET request. There are no limitations on files that can be attached, allowing for malicious PHP code to be uploaded and interpreted by the server.
{
"affected": [],
"aliases": [
"CVE-2021-43258"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-11-23T19:15:00Z",
"severity": "HIGH"
},
"details": "CartView.php in ChurchInfo 1.3.0 allows attackers to achieve remote code execution through insecure uploads. This requires authenticated access tot he ChurchInfo application. Once authenticated, a user can add names to their cart, and compose an email. Uploading an attachment for the email stores the attachment on the site in the /tmp_attach/ folder where it can be accessed with a GET request. There are no limitations on files that can be attached, allowing for malicious PHP code to be uploaded and interpreted by the server.",
"id": "GHSA-f3cp-c532-v8rx",
"modified": "2025-04-28T21:30:38Z",
"published": "2022-11-23T21:30:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-43258"
},
{
"type": "WEB",
"url": "https://github.com/rapid7/metasploit-framework/pull/17257"
},
{
"type": "WEB",
"url": "https://sourceforge.net/projects/churchinfo/files"
},
{
"type": "WEB",
"url": "http://www.churchdb.org"
}
],
"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-F3CX-396F-7JQP
Vulnerability from github – Published: 2024-10-08 22:19 – Updated: 2024-10-09 23:52In livewire/livewire prior to v2.12.7 and v3.5.2, the file extension of an uploaded file is guessed based on the MIME type. As a result, the actual file extension from the file name is not validated. An attacker can therefore bypass the validation by uploading a file with a valid MIME type (e.g., image/png) and a “.php” file extension.
If the following criteria are met, the attacker can carry out an RCE attack:
- Filename is composed of the original file name using
$file->getClientOriginalName() - Files stored directly on your server in a public storage disk
- Webserver is configured to execute “.php” files
PoC
In the following scenario, an attacker could upload a file called shell.php with an image/png MIME type and execute it on the remote server.
class SomeComponent extends Component
{
use WithFileUploads;
#[Validate('image|extensions:png')]
public $file;
public function save()
{
$this->validate();
$this->file->storeAs(
path: 'images',
name: $this->file->getClientOriginalName(),
options: ['disk' => 'public'],
);
}
}
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "livewire/livewire"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0-beta.1"
},
{
"fixed": "3.5.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "livewire/livewire"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.12.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-47823"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-434"
],
"github_reviewed": true,
"github_reviewed_at": "2024-10-08T22:19:16Z",
"nvd_published_at": "2024-10-08T18:15:31Z",
"severity": "HIGH"
},
"details": "In livewire/livewire prior to `v2.12.7` and `v3.5.2`, the file extension of an uploaded file is guessed based on the MIME type. As a result, the actual file extension from the file name is not validated. An attacker can therefore bypass the validation by uploading a file with a valid MIME type (e.g., `image/png`) and a \u201c.php\u201d file extension.\nIf the following criteria are met, the attacker can carry out an RCE attack:\n\n- Filename is composed of the original file name using `$file-\u003egetClientOriginalName()`\n- Files stored directly on your server in a public storage disk\n- Webserver is configured to execute \u201c.php\u201d files\n\n### PoC\nIn the following scenario, an attacker could upload a file called `shell.php` with an `image/png` MIME type and execute it on the remote server.\n```php\nclass SomeComponent extends Component\n{\n use WithFileUploads;\n\n #[Validate(\u0027image|extensions:png\u0027)]\n public $file;\n\n public function save()\n {\n $this-\u003evalidate();\n\n $this-\u003efile-\u003estoreAs(\n path: \u0027images\u0027,\n name: $this-\u003efile-\u003egetClientOriginalName(),\n options: [\u0027disk\u0027 =\u003e \u0027public\u0027],\n );\n }\n}\n```\n\n",
"id": "GHSA-f3cx-396f-7jqp",
"modified": "2024-10-09T23:52:22Z",
"published": "2024-10-08T22:19:16Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/livewire/livewire/security/advisories/GHSA-f3cx-396f-7jqp"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-47823"
},
{
"type": "WEB",
"url": "https://github.com/livewire/livewire/pull/8624"
},
{
"type": "WEB",
"url": "https://github.com/livewire/livewire/commit/70503b79f5db75a1eac9bf55826038a6ee5a16d5"
},
{
"type": "WEB",
"url": "https://github.com/livewire/livewire/commit/cd168c6212ea13d13b82b3132485741f82d9fad9"
},
{
"type": "PACKAGE",
"url": "https://github.com/livewire/livewire"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Livewire Remote Code Execution on File Uploads"
}
GHSA-F3FX-HXW6-4G3X
Vulnerability from github – Published: 2025-06-17 15:31 – Updated: 2026-04-01 18:35Unrestricted Upload of File with Dangerous Type vulnerability in merkulove Reformer for Elementor allows Upload a Web Shell to a Web Server. This issue affects Reformer for Elementor: from n/a through 1.0.5.
{
"affected": [],
"aliases": [
"CVE-2025-49444"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-06-17T15:15:49Z",
"severity": "CRITICAL"
},
"details": "Unrestricted Upload of File with Dangerous Type vulnerability in merkulove Reformer for Elementor allows Upload a Web Shell to a Web Server. This issue affects Reformer for Elementor: from n/a through 1.0.5.",
"id": "GHSA-f3fx-hxw6-4g3x",
"modified": "2026-04-01T18:35:28Z",
"published": "2025-06-17T15:31:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-49444"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/reformer-elementor/vulnerability/wordpress-reformer-for-elementor-1-0-5-arbitrary-file-upload-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:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-F3H2-P3H5-R6W7
Vulnerability from github – Published: 2023-06-18 00:30 – Updated: 2024-04-04 04:55An issue was discovered in SugarCRM Enterprise before 11.0.6 and 12.x before 12.0.3. An Unrestricted File Upload vulnerability has been identified in the Notes module. By using crafted requests, custom PHP code can be injected and executed through the Notes module because of missing input validation. Regular user privileges can be used to exploit this vulnerability. Editions other than Enterprise are also affected.
{
"affected": [],
"aliases": [
"CVE-2023-35808"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-06-17T22:15:09Z",
"severity": "HIGH"
},
"details": "An issue was discovered in SugarCRM Enterprise before 11.0.6 and 12.x before 12.0.3. An Unrestricted File Upload vulnerability has been identified in the Notes module. By using crafted requests, custom PHP code can be injected and executed through the Notes module because of missing input validation. Regular user privileges can be used to exploit this vulnerability. Editions other than Enterprise are also affected.",
"id": "GHSA-f3h2-p3h5-r6w7",
"modified": "2024-04-04T04:55:38Z",
"published": "2023-06-18T00:30:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-35808"
},
{
"type": "WEB",
"url": "https://support.sugarcrm.com/Resources/Security/sugarcrm-sa-2023-006"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/174300/SugarCRM-12.2.0-Shell-Upload.html"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2023/Aug/26"
}
],
"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-F3HM-GPCM-PWVF
Vulnerability from github – Published: 2024-06-04 03:30 – Updated: 2024-06-04 03:30** UNSUPPORTED WHEN ASSIGNED ** The remote code execution vulnerability in the CGI program “file_upload-cgi” in Zyxel NAS326 firmware versions before V5.21(AAZF.17)C0 and NAS542 firmware versions before V5.21(ABAG.14)C0 could allow an unauthenticated attacker to execute arbitrary code by uploading a crafted configuration file to a vulnerable device.
{
"affected": [],
"aliases": [
"CVE-2024-29974"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-06-04T02:15:48Z",
"severity": "CRITICAL"
},
"details": "** UNSUPPORTED WHEN ASSIGNED **\nThe remote code execution vulnerability in the CGI program \u201cfile_upload-cgi\u201d in Zyxel NAS326 firmware versions before\u00a0V5.21(AAZF.17)C0 and NAS542 firmware versions before V5.21(ABAG.14)C0 could allow an unauthenticated attacker to execute arbitrary code by uploading a crafted configuration file to a vulnerable device.",
"id": "GHSA-f3hm-gpcm-pwvf",
"modified": "2024-06-04T03:30:45Z",
"published": "2024-06-04T03:30:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-29974"
},
{
"type": "WEB",
"url": "https://outpost24.com/blog/zyxel-nas-critical-vulnerabilities"
},
{
"type": "WEB",
"url": "https://www.zyxel.com/global/en/support/security-advisories/zyxel-security-advisory-for-multiple-vulnerabilities-in-nas-products-06-04-2024"
}
],
"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
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.