CWE-434
Weakness 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.
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Relationships and members
Modes of introduction
OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase.
Detection methods
Dynamic Analysis with Automated Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Web Application Scanner
Web Services Scanner
Database Scanners
Effectiveness: SOAR Partial
Dynamic Analysis with Manual Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Fuzz Tester
Framework-based Fuzzer
Effectiveness: SOAR Partial
Manual Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Focused Manual Spotcheck - Focused manual analysis of source
Manual Source Code Review (not inspections)
Effectiveness: High
Automated Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Source code Weakness Analyzer
Context-configured Source Code Weakness Analyzer
Effectiveness: High
Architecture or Design Review
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Formal Methods / Correct-By-Construction
Cost effective for partial coverage:
Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Effectiveness: High
Notes
Relationship
This can have a chaining relationship with incomplete denylist / permissive allowlist errors when the product tries, but fails, to properly limit which types of files are allowed (CWE-183, CWE-184).
This can also overlap multiple interpretation errors for intermediaries, e.g. anti-virus products that do not remove or quarantine attachments with certain file extensions that can be processed by client systems.
Content history
Provided diagram to improve CWE usability
updated Time_of_Introduction
updated Alternate_Terms, Relationships, Other_Notes, Taxonomy_Mappings
updated Relationships
updated Applicable_Platforms, Functional_Areas, Likelihood_of_Exploit, Potential_Mitigations, Time_of_Introduction
converted from Compound_Element to Weakness
updated Alternate_Terms, Applicable_Platforms, Common_Consequences, Demonstrative_Examples, Name, Other_Notes, Potential_Mitigations, References, Related_Attack_Patterns, Relationship_Notes, Relationships, Type, Weakness_Ordinalities
updated Related_Attack_Patterns
updated References, Relationship_Notes
updated Potential_Mitigations
updated Potential_Mitigations
updated Relationships
updated Potential_Mitigations, References, Relationships
updated References, Relationships
updated Potential_Mitigations
updated Detection_Factors
updated Relationships
updated Affected_Resources, Applicable_Platforms, Likelihood_of_Exploit, Modes_of_Introduction, References, Relationships, Weakness_Ordinalities
updated References, Relationships, Taxonomy_Mappings
updated Related_Attack_Patterns
updated Relationships
updated Applicable_Platforms, Potential_Mitigations
updated Potential_Mitigations, Relationship_Notes
updated Relationships
updated Relationships
updated Demonstrative_Examples
updated Relationships
updated Relationships
updated Research_Gaps
updated Relationships
updated References
updated Alternate_Terms, Description
updated References, Relationships
updated Mapping_Notes, Relationships
updated Observed_Examples
updated Common_Consequences, Description, Diagram, Weakness_Ordinalities
updated Relationships
updated Detection_Factors, References
updated Relationships
updated Applicable_Platforms, Relationships
updated Observed_Examples, References
6649 vulnerabilities reference this CWE, most recent first.
GHSA-X4C6-Q57W-FFWG
Vulnerability from github – Published: 2022-05-13 01:03 – Updated: 2022-05-13 01:03Codiad 2.8.4 allows remote authenticated administrators to execute arbitrary code by uploading an executable file.
{
"affected": [],
"aliases": [
"CVE-2018-19423"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-11-21T21:29:00Z",
"severity": "HIGH"
},
"details": "Codiad 2.8.4 allows remote authenticated administrators to execute arbitrary code by uploading an executable file.",
"id": "GHSA-x4c6-q57w-ffwg",
"modified": "2022-05-13T01:03:34Z",
"published": "2022-05-13T01:03:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-19423"
},
{
"type": "WEB",
"url": "https://github.com/Codiad/Codiad/issues/1098"
},
{
"type": "WEB",
"url": "https://github.com/Hacker5preme/Exploits/tree/main/CVE-2018-19423-Exploit"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/162772/Codiad-2.8.4-Shell-Upload.html"
}
],
"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-X4CV-HMH5-9R69
Vulnerability from github – Published: 2022-04-11 00:00 – Updated: 2022-04-15 00:00An arbitrary file upload vulnerability at /admin/ajax.php in zbzcms v1.0 allows attackers to execute arbitrary code via a crafted PHP file.
{
"affected": [],
"aliases": [
"CVE-2022-27129"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-04-10T21:15:00Z",
"severity": "CRITICAL"
},
"details": "An arbitrary file upload vulnerability at /admin/ajax.php in zbzcms v1.0 allows attackers to execute arbitrary code via a crafted PHP file.",
"id": "GHSA-x4cv-hmh5-9r69",
"modified": "2022-04-15T00:00:52Z",
"published": "2022-04-11T00:00:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-27129"
},
{
"type": "WEB",
"url": "https://github.com/wu610777031/My_CMSHunter/blob/main/zbzcms%20v1.0%20vulnerabilities.pdf"
}
],
"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-X4F6-MQG6-28XX
Vulnerability from github – Published: 2026-06-09 09:32 – Updated: 2026-07-31 15:45Unrestricted Upload of File with Dangerous Type vulnerability in Apache Answer.
This issue affects Apache Answer: through 2.0.0.
The server did not sufficiently validate user-supplied image URLs, allowing arbitrary external content to be embedded as profile images, which could expose users to unintended external requests and tracking by third-party servers. Users are recommended to upgrade to version 2.0.1, which fixes the issue.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/apache/incubator-answer"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.7.2-0.20260511040518-11091244f64e"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-34031"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-31T15:45:20Z",
"nvd_published_at": "2026-06-09T09:16:29Z",
"severity": "MODERATE"
},
"details": "Unrestricted Upload of File with Dangerous Type vulnerability in Apache Answer.\n\nThis issue affects Apache Answer: through 2.0.0.\n\nThe server did not sufficiently validate user-supplied image URLs, allowing arbitrary external content to be embedded as profile images, which could expose users to unintended external requests and tracking by third-party servers.\nUsers are recommended to upgrade to version 2.0.1, which fixes the issue.",
"id": "GHSA-x4f6-mqg6-28xx",
"modified": "2026-07-31T15:45:20Z",
"published": "2026-06-09T09:32:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-34031"
},
{
"type": "WEB",
"url": "https://github.com/apache/answer/commit/11091244f64e5a7e472edcd477c1ff4124eca7c3"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/answer"
},
{
"type": "WEB",
"url": "https://github.com/apache/answer/releases/tag/v2.0.1"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/rwtxy39t54to9kv3dqtbjsbdpyk4jkd2"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2026/06/09/4"
}
],
"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"
}
],
"summary": "Apache Answer has an Unrestricted Upload of File with Dangerous Type vulnerability"
}
GHSA-X4H2-H25G-WWC2
Vulnerability from github – Published: 2026-10-30 18:32 – Updated: 2026-10-30 18:32The Avada | Website Builder For WordPress & WooCommerce theme for WordPress is vulnerable to Arbitrary File Upload in versions up to, and including, 7.16.2 via the convert_palette_images_to_truecolor() function. This is due to insufficient file type validation before processing uploaded files. This makes it possible for unauthenticated attackers to upload files that may be executable, which makes remote code execution possible.
{
"affected": [],
"aliases": [
"CVE-2026-115346"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-30T18:17:22Z",
"severity": "HIGH"
},
"details": "The Avada | Website Builder For WordPress \u0026 WooCommerce theme for WordPress is vulnerable to Arbitrary File Upload in versions up to, and including, 7.16.2 via the convert_palette_images_to_truecolor() function. This is due to insufficient file type validation before processing uploaded files. This makes it possible for unauthenticated attackers to upload files that may be executable, which makes remote code execution possible.",
"id": "GHSA-x4h2-h25g-wwc2",
"modified": "2026-10-30T18:32:43Z",
"published": "2026-10-30T18:32:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115346"
},
{
"type": "WEB",
"url": "https://avada.com/blog/version-7-16-4-security-update"
},
{
"type": "WEB",
"url": "https://themeforest.net/item/avada-responsive-multipurpose-theme/2833226"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/af757e6b-cbb3-4efd-8c83-99a03dee2311?source=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-X4HC-6GQQ-2CHH
Vulnerability from github – Published: 2026-01-14 00:31 – Updated: 2026-01-14 00:31e107 CMS version 3.2.1 contains a file upload vulnerability that allows authenticated administrative users to bypass upload restrictions and execute PHP files. Attackers can upload malicious PHP files to parent directories by manipulating the upload URL parameter, enabling remote code execution through the Media Manager import feature.
{
"affected": [],
"aliases": [
"CVE-2022-50907"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-01-13T23:15:53Z",
"severity": "HIGH"
},
"details": "e107 CMS version 3.2.1 contains a file upload vulnerability that allows authenticated administrative users to bypass upload restrictions and execute PHP files. Attackers can upload malicious PHP files to parent directories by manipulating the upload URL parameter, enabling remote code execution through the Media Manager import feature.",
"id": "GHSA-x4hc-6gqq-2chh",
"modified": "2026-01-14T00:31:28Z",
"published": "2026-01-14T00:31:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-50907"
},
{
"type": "WEB",
"url": "https://e107.org"
},
{
"type": "WEB",
"url": "https://e107.org/download"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/50910"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/e-cms-admin-upload-restriction-bypass-rce"
}
],
"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:H/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-X4JX-HJWF-GC99
Vulnerability from github – Published: 2022-04-08 00:00 – Updated: 2024-01-10 19:33A File Upload vulnerability exists in Studio-42 elFinder 2.0.4 to 2.1.59 via connector.minimal.php, which allows a remote malicious user to upload arbitrary files and execute PHP code.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "studio-42/elfinder"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.4"
},
{
"fixed": "2.1.60"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-43421"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": true,
"github_reviewed_at": "2024-01-10T19:33:07Z",
"nvd_published_at": "2022-04-07T17:15:00Z",
"severity": "CRITICAL"
},
"details": "A File Upload vulnerability exists in Studio-42 elFinder 2.0.4 to 2.1.59 via `connector.minimal.php`, which allows a remote malicious user to upload arbitrary files and execute PHP code.",
"id": "GHSA-x4jx-hjwf-gc99",
"modified": "2024-01-10T19:33:07Z",
"published": "2022-04-08T00:00:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-43421"
},
{
"type": "WEB",
"url": "https://github.com/Studio-42/elFinder/issues/3429"
},
{
"type": "WEB",
"url": "https://github.com/Studio-42/elFinder/commit/c08bcbfa722d758d01975799b7036951eb5d33cb"
},
{
"type": "PACKAGE",
"url": "https://github.com/Studio-42/elFinder"
},
{
"type": "WEB",
"url": "https://twitter.com/infosec_90/status/1455180286354919425"
}
],
"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"
}
],
"summary": "elFinder Unrestricted File Upload vulnerability"
}
GHSA-X4R4-F558-HVH7
Vulnerability from github – Published: 2026-01-12 21:30 – Updated: 2026-01-12 21:30Sourcecodester Covid-19 Contact Tracing System 1.0 is vulnerable to RCE (Remote Code Execution). The application receives a reverse shell (php) into imagem of the user enabling RCE.
{
"affected": [],
"aliases": [
"CVE-2025-66802"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-01-12T20:15:53Z",
"severity": "CRITICAL"
},
"details": "Sourcecodester Covid-19 Contact Tracing System 1.0 is vulnerable to RCE (Remote Code Execution). The application receives a reverse shell (php) into imagem of the user enabling RCE.",
"id": "GHSA-x4r4-f558-hvh7",
"modified": "2026-01-12T21:30:34Z",
"published": "2026-01-12T21:30:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66802"
},
{
"type": "WEB",
"url": "https://feedly.com/cve/CVE-2022-2746"
},
{
"type": "WEB",
"url": "https://github.com/mtgsjr/CVE-2025-66802"
}
],
"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-X4RW-PRFW-9MQ5
Vulnerability from github – Published: 2024-05-14 18:30 – Updated: 2025-04-04 15:30Unrestricted Upload of File with Dangerous Type vulnerability in Jordy Meow AI Engine: ChatGPT Chatbot.This issue affects AI Engine: ChatGPT Chatbot: from n/a through 2.2.63.
{
"affected": [],
"aliases": [
"CVE-2024-34440"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-14T15:39:06Z",
"severity": "CRITICAL"
},
"details": "Unrestricted Upload of File with Dangerous Type vulnerability in Jordy Meow AI Engine: ChatGPT Chatbot.This issue affects AI Engine: ChatGPT Chatbot: from n/a through 2.2.63.",
"id": "GHSA-x4rw-prfw-9mq5",
"modified": "2025-04-04T15:30:51Z",
"published": "2024-05-14T18:30:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-34440"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/ai-engine/wordpress-ai-engine-plugin-2-2-63-arbitrary-file-upload-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-X525-3WPJ-GC6F
Vulnerability from github – Published: 2023-06-28 15:30 – Updated: 2024-04-04 05:14In Responsive Filemanager < 9.12.0, an attacker can bypass upload restrictions resulting in RCE.
{
"affected": [],
"aliases": [
"CVE-2022-44276"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-06-28T15:15:09Z",
"severity": "CRITICAL"
},
"details": "In Responsive Filemanager \u003c 9.12.0, an attacker can bypass upload restrictions resulting in RCE.",
"id": "GHSA-x525-3wpj-gc6f",
"modified": "2024-04-04T05:14:15Z",
"published": "2023-06-28T15:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-44276"
},
{
"type": "WEB",
"url": "https://github.com/HerrLeStrate/CVE-2022-44276-PoC"
}
],
"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-X54G-3CX9-GG5J
Vulnerability from github – Published: 2025-12-18 09:30 – Updated: 2026-01-20 15:32Unrestricted Upload of File with Dangerous Type vulnerability in Cozmoslabs WP Webhooks wp-webhooks allows Path Traversal.This issue affects WP Webhooks: from n/a through <= 3.3.8.
{
"affected": [],
"aliases": [
"CVE-2025-66074"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-18T08:16:15Z",
"severity": "CRITICAL"
},
"details": "Unrestricted Upload of File with Dangerous Type vulnerability in Cozmoslabs WP Webhooks wp-webhooks allows Path Traversal.This issue affects WP Webhooks: from n/a through \u003c= 3.3.8.",
"id": "GHSA-x54g-3cx9-gg5j",
"modified": "2026-01-20T15:32:31Z",
"published": "2025-12-18T09:30:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66074"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/wp-webhooks/vulnerability/wordpress-wp-webhooks-plugin-3-3-8-arbitrary-file-upload-vulnerability?_s_id=cve"
},
{
"type": "WEB",
"url": "https://vdp.patchstack.com/database/Wordpress/Plugin/wp-webhooks/vulnerability/wordpress-wp-webhooks-plugin-3-3-8-arbitrary-file-upload-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/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.