Skip to content

SAML artifact resolution race allows duplicate payload retrieval #55284

Description

@abstractj

Describe the bug

The SAML artifact binding does not consume an artifact atomically when it is resolved. If two ArtifactResolve requests carrying the same artifact arrive concurrently, both can retrieve the SAML response payload. The artifact mapping is read from the single-use store without an exclusive lock. The resolver also reads the stored response into memory before it removes it from the client session. This leaves a short window in which both requests read the payload before either one deletes it. If the atomic removal of the artifact mapping fails, the failure is only logged at debug level and the response is still serialized and returned.

Exploiting this requires the exact random artifact value, a request that races the legitimate service provider within the artifact's short expiration window, and a service provider that does not require signed ArtifactResolve requests or whose signature requirement is otherwise satisfied. No independent way of obtaining another user's artifact was identified, and a reproducer against a running instance has not been achieved. The defect was reproduced at the resolver level with a deterministic test that pauses two concurrent resolutions after the payload is read and before it is removed. Both returned the same response.

Version

main (commit ae77487)

Expected behavior

A SAML artifact is single use. When two concurrent ArtifactResolve requests carry the same artifact, only one of them receives the response payload, and the other is rejected.

Actual behavior

Two concurrent ArtifactResolve requests with the same artifact can both receive the same SAML response payload, because reading and removing the artifact data are not performed as one atomic operation. A failed removal does not stop the response from being returned.


This issue was originally tracked in the private repository. Migrated by @abstractj.

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for weakness.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions