Common Weakness Enumeration

CWE-434

Allowed

Unrestricted 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-FQ48-P44P-FXJ5

Vulnerability from github – Published: 2022-05-24 19:02 – Updated: 2022-05-24 19:02
VLAI
Details

The Integration Builder Framework of SAP Process Integration versions - 7.10, 7.11, 7.20, 7.30, 7.31, 7.40, 7.50, does not check the file type extension of the file uploaded from local source. An attacker could craft a malicious file and upload it to the application, which could lead to denial of service and impact the availability of the application.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-27618"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-05-11T15:15:00Z",
    "severity": "MODERATE"
  },
  "details": "The Integration Builder Framework of SAP Process Integration versions - 7.10, 7.11, 7.20, 7.30, 7.31, 7.40, 7.50, does not check the file type extension of the file uploaded from local source. An attacker could craft a malicious file and upload it to the application, which could lead to denial of service and impact the availability of the application.",
  "id": "GHSA-fq48-p44p-fxj5",
  "modified": "2022-05-24T19:02:05Z",
  "published": "2022-05-24T19:02:05Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-27618"
    },
    {
      "type": "WEB",
      "url": "https://launchpad.support.sap.com/#/notes/3012021"
    },
    {
      "type": "WEB",
      "url": "https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=576094655"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-FQ5H-5C9Q-CW4H

Vulnerability from github – Published: 2022-05-17 00:47 – Updated: 2025-04-20 03:45
VLAI
Details

Vulnerability in wordpress plugin wp2android-turn-wp-site-into-android-app v1.1.4, The plugin includes unlicensed vulnerable CMS software from http://www.invedion.com.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2017-1002003"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2017-09-14T13:29:00Z",
    "severity": "CRITICAL"
  },
  "details": "Vulnerability in wordpress plugin wp2android-turn-wp-site-into-android-app v1.1.4, The plugin includes unlicensed vulnerable CMS software from http://www.invedion.com.",
  "id": "GHSA-fq5h-5c9q-cw4h",
  "modified": "2025-04-20T03:45:17Z",
  "published": "2022-05-17T00:47:39Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-1002003"
    },
    {
      "type": "WEB",
      "url": "https://wordpress.org/plugins-wp/wp2android-turn-wp-site-into-android-app"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/41540"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/96908"
    },
    {
      "type": "WEB",
      "url": "http://www.vapidlabs.com/advisory.php?v=182"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-FQF7-66F9-WQFF

Vulnerability from github – Published: 2024-03-11 15:31 – Updated: 2024-03-11 15:31
VLAI
Details

Unrestricted file upload vulnerability in ManageEngine Desktop Central affecting version 9, build 90055. This vulnerability could allow a remote attacker to upload a malicious file to the system without any credentials provided.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-2370"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-03-11T13:15:52Z",
    "severity": "CRITICAL"
  },
  "details": "Unrestricted file upload vulnerability in ManageEngine Desktop Central affecting version 9, build 90055. This vulnerability could allow a remote attacker to upload a malicious file to the system without any credentials provided.",
  "id": "GHSA-fqf7-66f9-wqff",
  "modified": "2024-03-11T15:31:24Z",
  "published": "2024-03-11T15:31:24Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-2370"
    },
    {
      "type": "WEB",
      "url": "https://www.incibe.es/en/incibe-cert/notices/aviso/unrestricted-file-upload-vulnerability-manageengine-desktop-central"
    }
  ],
  "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-FQG9-XPJX-879W

Vulnerability from github – Published: 2024-11-04 15:31 – Updated: 2026-04-01 18:32
VLAI
Details

Unrestricted Upload of File with Dangerous Type vulnerability in David F. Carr RSVPMaker for Toastmasters allows Upload a Web Shell to a Web Server.This issue affects RSVPMaker for Toastmasters: from n/a through 6.2.4.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-50531"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-11-04T14:15:16Z",
    "severity": "CRITICAL"
  },
  "details": "Unrestricted Upload of File with Dangerous Type vulnerability in David F. Carr RSVPMaker for Toastmasters allows Upload a Web Shell to a Web Server.This issue affects RSVPMaker for Toastmasters: from n/a through 6.2.4.",
  "id": "GHSA-fqg9-xpjx-879w",
  "modified": "2026-04-01T18:32:17Z",
  "published": "2024-11-04T15:31:58Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-50531"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/Wordpress/Plugin/rsvpmaker-for-toastmasters/vulnerability/wordpress-rsvpmaker-for-toastmasters-plugin-6-2-4-arbitrary-file-upload-vulnerability?_s_id=cve"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/vulnerability/rsvpmaker-for-toastmasters/wordpress-rsvpmaker-for-toastmasters-plugin-6-2-4-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-FQPC-QQWJ-F2WV

Vulnerability from github – Published: 2024-12-26 12:30 – Updated: 2024-12-26 12:30
VLAI
Details

Some Honor products are affected by file writing vulnerability, successful exploitation could cause code execution

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-47151"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-12-26T11:15:07Z",
    "severity": "MODERATE"
  },
  "details": "Some Honor products are affected by file writing vulnerability, successful exploitation could cause code execution",
  "id": "GHSA-fqpc-qqwj-f2wv",
  "modified": "2024-12-26T12:30:44Z",
  "published": "2024-12-26T12:30:44Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-47151"
    },
    {
      "type": "WEB",
      "url": "https://www.honor.com/global/security/cve-2024-47151"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-FQR8-Q3MH-59GH

Vulnerability from github – Published: 2025-03-02 18:30 – Updated: 2025-03-03 21:30
VLAI
Details

A vulnerability, which was classified as critical, has been found in zj1983 zz up to 2024-8. This issue affects some unknown processing of the file src/main/java/com/futvan/z/system/zfile/ZfileAction.upload. The manipulation of the argument file leads to unrestricted upload. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-1818"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-284",
      "CWE-434"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-03-02T16:15:35Z",
    "severity": "MODERATE"
  },
  "details": "A vulnerability, which was classified as critical, has been found in zj1983 zz up to 2024-8. This issue affects some unknown processing of the file src/main/java/com/futvan/z/system/zfile/ZfileAction.upload. The manipulation of the argument file leads to unrestricted upload. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.",
  "id": "GHSA-fqr8-q3mh-59gh",
  "modified": "2025-03-03T21:30:58Z",
  "published": "2025-03-02T18:30:53Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-1818"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?ctiid.298091"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.298091"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?submit.504304"
    },
    {
      "type": "WEB",
      "url": "https://www.yuque.com/u123456789-6sobi/cdgcbq/bg2g3eit41o4cpd4"
    },
    {
      "type": "WEB",
      "url": "https://www.yuque.com/u123456789-6sobi/cdgcbq/bg2g3eit41o4cpd4#"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/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-FR2W-MP56-G4XP

Vulnerability from github – Published: 2022-06-17 01:16 – Updated: 2022-06-29 21:47
VLAI
Summary
Unrestricted Attachment Upload
Details

Impact

InvenTree allows unrestricted upload of files as attachments to various database fields. Potentially dangerous files (such as HTML files containing malicious javascript) can be uploaded, and (when opened by the user) run the malicious code directly in the users browser.

image

Note that the upload of malicious files must be performed by an authenticated user account

Solution

The solution for this vulnerability is to ensure that attachment files are downloaded to the local machine before opening, rather than opening the file in the current browser context.

Patches

  • The issue is addressed in the upcoming 0.8.0 release
  • This fix will also be back-ported to the 0.7.x branch, applied to the 0.7.2 release

Workarounds

Users can alleviate risk of opening malicious files by right-clicking on the attachment link and selecting "Save link as"

image

This minimizes risk (e.g. of XSS attacks) by opening the HTML file from the users computer

References

https://huntr.dev/bounties/a0e5c68e-0f75-499b-bd7b-d935fb8c0cd1/

For more information

If you have any questions or comments about this advisory:

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "inventree"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.7.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-2111"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-06-17T01:16:55Z",
    "nvd_published_at": "2022-06-17T13:15:00Z",
    "severity": "HIGH"
  },
  "details": "### Impact\n\nInvenTree allows unrestricted upload of files as attachments to various database fields. Potentially dangerous files (such as HTML files containing malicious javascript) can be uploaded, and (when opened by the user) run the malicious code directly in the users browser.\n\n![image](https://user-images.githubusercontent.com/10080325/173549827-af2d7a5c-1359-4d68-a920-dfdd0ccc882e.png)\n\n*Note that the upload of malicious files must be performed by an authenticated user account*\n\n### Solution\n\nThe solution for this vulnerability is to ensure that attachment files are downloaded to the local machine before opening, rather than opening the file in the current browser context.\n\n### Patches\n\n- The issue is addressed in the upcoming 0.8.0 release\n- This fix will also be back-ported to the 0.7.x branch, applied to the 0.7.2 release\n\n### Workarounds\n\nUsers can alleviate risk of opening malicious files by right-clicking on the attachment link and selecting \"Save link as\"\n\n![image](https://user-images.githubusercontent.com/10080325/173550035-2de4bf01-f0d3-4be8-ac45-6fbcf66a95e7.png)\n\nThis minimizes risk (e.g. of XSS attacks) by opening the HTML file from the users computer\n\n### References\n\nhttps://huntr.dev/bounties/a0e5c68e-0f75-499b-bd7b-d935fb8c0cd1/\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [github](http://github.com/inventree/inventree)\n* Email us at [security@inventree.org](mailto:security@inventree.org)\n",
  "id": "GHSA-fr2w-mp56-g4xp",
  "modified": "2022-06-29T21:47:25Z",
  "published": "2022-06-17T01:16:55Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/inventree/InvenTree/security/advisories/GHSA-fr2w-mp56-g4xp"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-2111"
    },
    {
      "type": "WEB",
      "url": "https://github.com/inventree/inventree/commit/26bf51c20a1c9b3130ac5dd2e17649bece5ff84f"
    },
    {
      "type": "WEB",
      "url": "https://github.com/inventree/inventree-python"
    },
    {
      "type": "WEB",
      "url": "https://huntr.dev/bounties/a0e5c68e-0f75-499b-bd7b-d935fb8c0cd1"
    }
  ],
  "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"
    }
  ],
  "summary": "Unrestricted Attachment Upload"
}

GHSA-FR5W-98MC-JJVG

Vulnerability from github – Published: 2022-01-22 00:00 – Updated: 2023-07-07 21:39
VLAI
Summary
Arbitrary file upload in Mingsoft MCMS
Details

MCMS v5.2.4 was discovered to contain an arbitrary file upload vulnerability via the component /ms/template/writeFileContent.do.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "net.mingsoft:ms-mcms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "5.2.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-23315"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-07-07T21:39:49Z",
    "nvd_published_at": "2022-01-21T00:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "MCMS v5.2.4 was discovered to contain an arbitrary file upload vulnerability via the component `/ms/template/writeFileContent.do`.",
  "id": "GHSA-fr5w-98mc-jjvg",
  "modified": "2023-07-07T21:39:49Z",
  "published": "2022-01-22T00:00:48Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-23315"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20220125060457/https://gitee.com/mingSoft/MCMS/issues/I4Q4PX"
    }
  ],
  "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": "Arbitrary file upload in Mingsoft MCMS"
}

GHSA-FR6R-P8HV-X3C4

Vulnerability from github – Published: 2025-06-04 23:50 – Updated: 2025-06-04 23:50
VLAI
Summary
Umbraco Vulnerable to By-Pass of Configured Allowed Extensions for File Uploads
Details

Impact

Via a manipulated API request it's possible to upload a file that doesn't adhere with the configured allowable file extensions.

Patches

Patched in 15.4.2 and 16.0.0.

Workarounds

None available.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 15.4.1"
      },
      "package": {
        "ecosystem": "NuGet",
        "name": "Umbraco.Cms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "14.0.0"
            },
            {
              "fixed": "15.4.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-48953"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-06-04T23:50:55Z",
    "nvd_published_at": "2025-06-03T19:15:39Z",
    "severity": "MODERATE"
  },
  "details": "### Impact\nVia a manipulated API request it\u0027s possible to upload a file that doesn\u0027t adhere with the configured allowable file extensions.\n\n### Patches\nPatched in 15.4.2 and 16.0.0.\n\n### Workarounds\nNone available.",
  "id": "GHSA-fr6r-p8hv-x3c4",
  "modified": "2025-06-04T23:50:55Z",
  "published": "2025-06-04T23:50:55Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/umbraco/Umbraco-CMS/security/advisories/GHSA-fr6r-p8hv-x3c4"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-48953"
    },
    {
      "type": "WEB",
      "url": "https://github.com/umbraco/Umbraco-CMS/commit/d920e93d1ee29dc3301697e444f53e8cd5db3cf9"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/umbraco/Umbraco-CMS"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Umbraco Vulnerable to By-Pass of Configured Allowed Extensions for File Uploads"
}

GHSA-FR75-X856-Q6J8

Vulnerability from github – Published: 2022-07-17 00:00 – Updated: 2024-10-07 16:45
VLAI
Summary
Octobot mishandles Tentacles upload
Details

WebInterface in OctoBot before 0.4.4 allows remote code execution because Tentacles upload is mishandled.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "OctoBot"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.4.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-36711"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-434"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-07-20T01:31:34Z",
    "nvd_published_at": "2022-07-16T17:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "WebInterface in OctoBot before 0.4.4 allows remote code execution because Tentacles upload is mishandled.",
  "id": "GHSA-fr75-x856-q6j8",
  "modified": "2024-10-07T16:45:28Z",
  "published": "2022-07-17T00:00:44Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-36711"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Drakkar-Software/OctoBot/issues/1966"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Drakkar-Software/OctoBot"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Drakkar-Software/OctoBot/blob/master/CHANGELOG.md"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Drakkar-Software/OctoBot/blob/master/CHANGELOG.md#044---2022-06-01"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Nwqda/Sashimi-Evil-OctoBot-Tentacle"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-fr75-x856-q6j8"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pypa/advisory-database/tree/main/vulns/octobot/PYSEC-2022-235.yaml"
    },
    {
      "type": "WEB",
      "url": "https://packetstormsecurity.com/files/167721/Sashimi-Evil-OctoBot-Tentacle.html"
    },
    {
      "type": "WEB",
      "url": "https://www.octobot.online"
    },
    {
      "type": "WEB",
      "url": "http://packetstormsecurity.com/files/167780/OctoBot-WebInterface-0.4.3-Remote-Code-Execution.html"
    }
  ],
  "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"
    },
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Octobot mishandles Tentacles upload"
}

Mitigation
Architecture and Design

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
Architecture and Design

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
Architecture and Design

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
Implementation

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
Architecture and Design

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
Implementation

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
Implementation

When running on a web server that supports case-insensitive filenames, perform case-insensitive evaluations of the extensions that are provided.

Mitigation MIT-15
Architecture and Design

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
Implementation

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
Implementation

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
Architecture and Design Operation

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
Architecture and Design Operation

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.