Am I affected?

type your boruta version to check

Description

Authentication Bypass by Capture-replay vulnerability in malach-it Boruta allows an attacker who has obtained a previously valid JWT client assertion to authenticate as the issuing OAuth client after the assertion has expired.

Boruta accepts JWT-based client authentication (client_secret_jwt and private_key_jwt token endpoint authentication methods) but never enforces that the assertion's exp claim is in the future. The pre-check helper 'Elixir.Boruta.Oauth.Request.Base':check_expiration/1 in lib/boruta/oauth/request/base.ex only verifies that an exp claim is present (it pattern-matches on the existence of the key and returns success), and the Joken token configuration used for signature verification, 'Elixir.Boruta.Oauth.Authorization.Client.Token':token_config/0 in lib/boruta/oauth/authorization/client.ex, returns an empty map, so Joken's default exp claim validator is not engaged either. Any attacker who obtains a validly-signed client assertion (for example through logs, reverse proxies, browser tooling, or other observability surfaces) can replay it indefinitely to authenticate as the client and obtain access tokens with that client's privileges.

This issue affects boruta: from 2.3.0 before 2.3.7.

Weaknesses & attack patterns

Weakness

CWE-294 · Authentication Bypass by Capture-replay in catalog → MITRE ↗

Attack patterns

CAPEC-60 · Reusing Session IDs (aka Session Replay) MITRE ↗

Affected — pkg:hex/boruta Hex.pm ↗ Repository ↗

2.3.0 < 2.3.7 · fixed in 2.3.7
default status unaffected
cpe cpe:2.3:a:malach-it:boruta_auth:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Boruta.Oauth.Request.Base' · 'Elixir.Boruta.Oauth.Authorization.Client.Token'
source files lib/boruta/oauth/request/base.ex · lib/boruta/oauth/authorization/client.ex
routines 'Elixir.Boruta.Oauth.Request.Base':fetch_client_authentication/1 · 'Elixir.Boruta.Oauth.Request.Base':check_expiration/1 · 'Elixir.Boruta.Oauth.Authorization.Client.Token':token_config/0

Affected — pkg:github/malach-it/boruta_auth Repository ↗

introduced by 5bfbe1c · fixed by 5204f88 · git
default status unaffected
cpe cpe:2.3:a:malach-it:boruta_auth:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Boruta.Oauth.Request.Base' · 'Elixir.Boruta.Oauth.Authorization.Client.Token'
source files lib/boruta/oauth/request/base.ex · lib/boruta/oauth/authorization/client.ex
routines 'Elixir.Boruta.Oauth.Request.Base':fetch_client_authentication/1 · 'Elixir.Boruta.Oauth.Request.Base':check_expiration/1 · 'Elixir.Boruta.Oauth.Authorization.Client.Token':token_config/0

Workarounds

Restrict the use of JWT-based client authentication (client_secret_jwt and private_key_jwt) to highly trusted clients, and prefer non-JWT client authentication methods (client_secret_basic or client_secret_post) where possible. Where JWT client authentication must remain enabled, issue short-lived client assertions and protect them from exposure in application logs, fronting proxies, browser tooling, and observability systems to reduce the window for replay.

Configurations

The attack requires that the Boruta deployment has provisioned at least one OAuth client configured to authenticate via JWT client assertions (client_secret_jwt or private_key_jwt token endpoint authentication methods). Deployments that authenticate clients only via client_secret_basic or client_secret_post are not exposed.

References

Credits

Pascal Knoth Finder Remediation developer
Jonatan Männchen / EEF Analyst

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
« All CVEs