Skip to content

Independent cybersecurity briefing

Latest

RSS
Breaches, bounties, zero-days, and AI.

Bug Bounty Write Ups

The SAML Assertion Meant for Someone Else

A 2017 Slack disclosure shows why audience, expiry and destination checks are not optional extras

Adam Hale, ZeroDay Times editorBy Adam Hale3 min read

Still life for “The SAML Assertion Meant for Someone Else”: a magnifier and a sealed envelope, copper dusk, Desk mark, signal CASE. [ BUG BOUNTY ] badge.

AI-generated illustration

AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.

A signed SAML assertion is not a universal passport. Antonio Sanso reported that Slack accepted an expired assertion issued for GitHub, naming a subject other than himself, and signed him into a Slack workspace as that subject. Slack confirmed the issue the next day, awarded $3,000 that August, and closed the report on 26 October 2017 after finishing work with affected customers.

Disclaimer: * Educational and defensive use only. Reported in May 2017 and closed in October 2017 after Slack completed remediations. This article intentionally omits reproduction details.*

Vulnerability Overview

  • Type: SAML authentication bypass (insufficient assertion validation)
  • CWE (analytical mapping, not from the source): CWE-345, CWE-287
  • CVE: Not stated in the disclosure
  • Severity/CVSS: Not reported. Bounty: $3,000 (source-reported)

What Happened (high level)

SAML assertions carry an audience restriction so a token minted for one service provider cannot be replayed at another. Sanso described the failure as a confused-deputy problem: Slack did not reject an assertion whose audience was a different provider. The assertion he presented was also expired, and it identified a subject that was not his own handle.

He reported the issue via HackerOne on 2 May 2017. Slack confirmed it on 3 May 2017, paid $3,000 on 26 August 2017, and closed the ticket on 26 October 2017. He noted the SAML surface was likely aimed at enterprise customers.

This article does not describe how an assertion is captured or replayed. A valid signature answers who issued the document, not whether it was minted for this service or is still inside its validity window.

Impact

Anyone who could present a signed assertion from another service, even an expired one, could obtain a Slack session as the subject named in that assertion. For an enterprise workspace that treats SAML as the gate, that is a full authentication bypass.

Remediation & Defense-in-Depth (my own analysis)

1. Reject any assertion that does not name this service. The configured entity identifier of this service provider must appear in the audience restriction. An assertion minted for another product is not close enough.

2. Enforce the validity window, destination, and request binding. Check not-before and not-on-or-after with a small clock-skew allowance, match destination to this assertion-consumer URL, and require a pending request this service created.

3. Consume assertion identifiers before you issue a session. Persist the identifier first so a retry cannot replay successfully. Commit that write, then create the local session.

# Pseudocode: verify claims, consume the ID, commit, THEN issue a session
def accept_assertion(assertion, now, this_sp, used_ids):
    if not verify_signature(assertion, this_sp.trusted_idp_certs):
        raise Rejected("bad signature")
    if now < assertion.not_before or now > assertion.not_on_or_after:
        raise Rejected("outside validity window")
    if this_sp.entity_id not in assertion.audiences:
        raise Rejected("audience mismatch")
    if assertion.destination != this_sp.acs_url:
        raise Rejected("bad destination")
    if assertion.in_response_to not in this_sp.pending_requests:
        raise Rejected("unknown request")
    with db.transaction():
        if assertion.id in used_ids:
            raise Rejected("replay")
        used_ids.add(assertion.id)  # consumption committed first
    return issue_session(subject=assertion.subject)

4. Pin trusted identity-provider signing keys. Accept only issuers you intended to federate with, and rotate unused keys out of the trust store.

5. Regression-test negative cases. Tests should present a well-signed assertion with the wrong audience, an elapsed window, or a mismatched destination, and expect rejection.

Key Takeaways

  • A signature proves who issued the assertion, not that it was minted for you.
  • Expiry, audience, destination and request binding each close a different failure mode.
  • Consume assertion identifiers before you create a session, or a retry will replay successfully.

Credit & Sources

Research by Antonio Sanso: Slack SAML authentication bypass (26 October 2017). Facts come from that post; analysis, code and remediation are original suggestions.

First published by Adam Hale on Medium.

Sources

Share

Corrections and tips:[email protected]