Dependency scanners treat every advisory with a "first patched version" row as the same kind of fix: bump the version number in requirements.txt, watch the alert turn green, and close the ticket. Put two AI-infrastructure CVEs next to each other and read the upstream diffs directly, and that assumption falls apart fast.
Both cases now live in cve_lab (github.com/ghostintheprompt/cve_lab), verified with paired functionality and non-destructive boundary checks.
MLflow CVE-2023-6909: validation before decoding, closed by fixed-point unquoting
In mlflow < 2.9.2 (GHSA-5r3q-93q3-f978, CVSS 7.5, CWE-29), validate_path_is_safe(path) in mlflow/utils/uri.py checked for ".." in path.split("/") and PurePosixPath(path).is_absolute() on the raw input string before any URL decoding ran. Because "%2E%2E%2F%2E%2E%2Fsandbox_canary.txt" contains no literal slash or dot-dot sequence, 2.9.1 waved it straight through, leaving downstream HTTP artifact handlers to unquote the path and walk out of mlruns/.
Installing mlflow-skinny==2.9.1 and mlflow-skinny==2.9.2 in isolated Python 3.12 environments (with setuptools<81 pinned for 2.9.x's pkg_resources import) shows why 2.9.2 is a genuine code-level fix. Rather than calling urllib.parse.unquote once and leaving double-encoding (%252E%252E%252F) open, v2.9.2 loops until the string reaches a fixed point:
def _decode(url):
# Keep decoding until the url stops changing (with a max of 10 iterations)
for _ in range(10):
decoded = urllib.parse.unquote(url)
if decoded == url:
return url
url = decoded
raise ValueError("Failed to decode url")
Against real mlflow-skinny==2.9.1, legitimate relative paths (model/weights.bin) pass and both %2E%2E%2F and %252E%252E%252F fail our boundary assertion (validate_path_is_safe returns cleanly on both escapes). Against mlflow-skinny==2.9.2, legitimate paths still pass and both encoded probes raise MlflowException: Invalid path in 0.001s.
TorchServe CVE-2023-43654: a CVSS 9.8 "patched version" that kept the wildcard default
Now compare that to TorchServe's Server-Side Request Forgery (SSRF) advisory, CVE-2023-43654 (GHSA-8fxr-qfr9-p34w, CVSS 9.8, CWE-918), part of the public ShellTorch chain. Both the GitHub Advisory Database and the National Vulnerability Database (NVD) list torchserve >= 0.8.2 as patched and link pytorch/serve#2534 as the remediation.
Pulling ConfigManager.java directly at v0.8.2, v0.9.0, and master shows that PR #2534 touched a single file and did not narrow the default URL pattern at all:
// frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
private static final String DEFAULT_TS_ALLOWED_URLS = "file://.*|http(s)?://.*";
...
if (prop.getProperty(TS_ALLOWED_URLS, DEFAULT_TS_ALLOWED_URLS) == DEFAULT_TS_ALLOWED_URLS) {
logger.warn(
"Your torchserve instance can access any URL to load models. "
+ "When deploying to production, make sure to limit the set of allowed_urls in config.properties");
}
Upgrading torchserve from 0.8.1 to 0.8.2 clears a package-version Software Composition Analysis (SCA) scan immediately. Yet any deployment whose config.properties omits allowed_urls inherits file://.*|http(s)?://.* at runtime, emits one startup warning to logs, and leaves outbound HTTP and HTTPS model fetches (POST /models?url=...) just as open to instance metadata (169.254.169.254) or untrusted remote archives as 0.8.1. (TorchServe 0.9.0 later added management-API token authorization by default unless disable_token_authorization=true, a separate control from URL scoping.)
Auditing effective posture instead of version strings
cve_lab/torchserve-cve-2023-43654 models ConfigManager.getAllowedUrls() and scores config.properties separately from the installed version string (Ran 3 tests in 0.001s (OK)):
0.8.2+default_unrestricted.properties->MARKED_PATCHED_GHSA,ssrf_arbitrary_http_open=True,management_bound_loopback=False.0.9.0+hardened.properties(allowed_urls=https://artifacts\.internal\.example/models/[a-zA-Z0-9_\-]+\.mar,127.0.0.1bindings,disable_token_authorization=false) -> admits approved internal.mararchives while rejecting169.254.169.254, external hosts,file://URIs, and../path traversal.
The MLflow case ran directly against the real upstream PyPI wheels in local Python 3.12 virtualenvs (Dockerfiles included for containerized reruns); the TorchServe case evaluates ConfigManager's URL regex and configuration rules in Python without spinning up a JVM or shipping a malicious .mar archive.
GhostInThePrompt.com // Read the fix commit before you trust the green scanner badge.