
Cloud Vulnerability DB
A community-led vulnerabilities database
SAML2\Response\Processor stores whether the Response it is processing was signed in an instance property, $responseIsSigned. The property is set to true as soon as a Response carrying a signature arrives, before that signature is checked, and it is never set back to false. Every later Response handed to the same Processor instance then skips the check "Both the response and the assertion it contains are not signed", and the assertion processor accepts the unsigned assertion. On a reused Processor, two attacker requests are enough: one signed with any key (rejected, but it sets the flag), then one with no signature at all, naming any user with any attributes. The second is returned as valid. No IdP key and no genuine login by anyone are needed. Demonstrated on the release-4.x branch (head 0db9fd9f) and on v6.2.3, including over HTTP against a long-lived PHP worker.
Package: simplesamlphp/saml2 (also distributed as simplesamlphp/saml2-legacy) Component: Response\Processor (src/SAML2/Response/Processor.php on 4.x, src/Response/Processor.php on 5.x and later), together with Assertion\Processor Class: CWE-347 Improper Verification of Cryptographic Signature Affected: the release-4.x branch (head 0db9fd9f) at lines 49, 131 and 158, and its saml2-legacy copy (identical file). v6.2.3 and master at lines 44, 127 and 155; master's class body is identical to v6.2.3. The flag was introduced in commit 0c4044fb (2014-12-03). Of the 188 tags that contain a Response\Processor, 186 (v0.6.1 through v7.0.0-rc5) have the same three lines for it: the declaration, one assignment to true placed before the signature check, and the gate. None resets it in any form. v0.6.0 and v1.5.0 predate the flag. The PoC was run on release-4.x and v6.2.3. Not affected: SimpleSAMLphp. It does not use Response\Processor and enforces signatures itself in modules/saml/src/Message.php. The exposure is for applications that call the library's Processor directly. Mechanism (4.x line numbers):
An attacker who can send a SAML Response to the assertion consumer service of an application that uses Response\Processor logs in as any user, with chosen attributes, without the IdP's key and without any genuine login by anyone, whenever the Processor instance that handles the requests is reused. Two requests are enough on one instance: one signed with a key of the attacker's choosing, then one with no signature. That holds when one Processor instance outlives a single message: when the application keeps it as a shared service in a persistent PHP worker (for example FrankenPHP worker mode, RoadRunner, Swoole or Laravel Octane, where the service container survives between requests), or when one process handles several Responses. Where a server runs several workers, the two requests must reach the same one; we expect an attacker can repeat the pair until they do, but have not measured this. In classic PHP-FPM a fresh Processor is created per request and the flag cannot carry over between requests. We have not measured how many integrators call Response\Processor directly, or how many of those run it in a persistent worker, and do not claim either.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."