The SAML Assertion Meant for Someone Else
Slack accepted a signed SAML assertion that was issued for a different service provider, had expired, and named a subject other than the attacker. An attacker who could present such an assertion could obtain a Slack session as the named subject, bypassing authentication.
medium.com
Published on medium.com
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
SAML is the federation protocol most enterprise SaaS products use to let a customer's identity provider (IdP) vouch for its users. The service provider (SP) receives a signed assertion, checks the signature against the IdP's certificate, and, if everything lines up, creates a local session for the subject named in the assertion. The assertion is meant to be scoped: it carries an audience restriction naming the SP it was minted for, a validity window, a destination, and usually a reference to the request that triggered it.
Slack offered SAML single sign-on, and the researcher notes the SAML surface was likely aimed at enterprise customers, the workspaces where SAML is the gate rather than an optional convenience.

AI-generated illustration
Setup
The disclosure does not describe the researcher's tooling, test accounts or workspace configuration. What it does say is that the work was done against Slack's SAML SSO feature, that the assertion used in the test had been issued for GitHub, and that it named a subject other than the researcher's own handle. The article deliberately omits the reproduction details, so the mechanics of obtaining and presenting the assertion are not part of the public record.
Finding it
Sanso described the failure as a confused-deputy problem. Slack did not reject an assertion whose audience was a different service provider. The assertion he presented was also expired, and it identified a subject that was not his own handle. Three separate properties of the assertion were wrong for Slack, and Slack accepted it anyway and signed him in as that subject.
The reasoning that makes this look wrong is straightforward. A valid signature answers who issued the document. It says nothing about whether the document was minted for this service, whether it is still inside its validity window, or whether it belongs to the person presenting it. Each of those is a separate check the SP is responsible for, and the audience restriction exists precisely so a token minted for one service provider cannot be replayed at another.
Exploitation
The public disclosure does not include the raw requests, the assertion, or the responses. What it establishes is the sequence of events and the outcome.
Step 1: present an assertion minted for another provider
The assertion was issued for GitHub, not Slack. Its audience restriction therefore named a different service provider. Slack did not reject it on that basis.
Step 2: present an expired assertion
The assertion was expired at the time it was presented, and Slack accepted it anyway.
Step 3: present an assertion naming someone else
The subject in the assertion was not the researcher's handle, and Slack signed him in as that subject.
The result is a full authentication bypass: possession of a signed assertion from another service, even an expired one, was enough to obtain a Slack session as the subject named in that assertion.
Timeline
| Date | Event |
|---|---|
| 2 May 2017 | Reported via HackerOne |
| 3 May 2017 | Slack confirmed the issue |
| 26 August 2017 | $3,000 bounty paid |
| 26 October 2017 | Report closed after work with affected customers |
Root cause
Slack did not reject an assertion whose audience was a different service provider; the assertion was also expired and named a subject other than the researcher's handle.
Why the existing defences did not stop it: a signature only proves who issued the assertion. It does not prove the assertion was minted for this service, that it is still valid, or that the presenter is the subject. Those are separate controls, and each closes a different failure mode. Sanso described the failure as a confused-deputy problem: Slack acted on an assertion that was never intended for Slack.
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. The report does not state which workspaces were affected beyond noting that Slack worked with affected customers before closing the report.
Fix
Slack confirmed the issue the day after it was reported and closed the report on 26 October 2017 after finishing work with affected customers. The disclosure does not describe the code change itself. The remediation guidance below is the author's own analysis, not a description of Slack's patch.
- Reject any assertion that does not name this service. The configured entity identifier of the service provider must appear in the audience restriction. An assertion minted for another product is not close enough.
- Enforce the validity window, destination, and request binding. Check not-before and not-on-or-after with a small clock-skew allowance, match the destination to this assertion-consumer URL, and require a pending request that this service created.
- Consume assertion identifiers before issuing a session. Persist the identifier first so a retry cannot replay successfully. Commit that write, then create the local 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) return issue_session(subject=assertion.subject)
- Pin trusted identity-provider signing keys. Accept only issuers you intended to federate with, and rotate unused keys out of the trust store.
- 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.
Variants to test
- Audience not checked. Take a well-signed assertion from one SP in a federation and present it to another SP that trusts the same IdP. A positive result is a session at the second SP without any assertion minted for it.
- Expiry not checked. Present an assertion after its not-on-or-after time. A positive result is a session created from an assertion whose window has elapsed.
- Destination not checked. Change the destination to a different assertion-consumer URL on the same SP. A positive result is acceptance at a URL the assertion was not addressed to.
- Request binding not checked. Present an unsolicited assertion with no matching pending request, or with an in-response-to value the SP never issued. A positive result is a session without a login flow the SP started.
- Replay. Present the same assertion twice. A positive result is a second session from an identifier that should already have been consumed.
- Subject mismatch. Present an assertion whose subject is a different account than the one initiating the flow. A positive result is a session as the subject named in the assertion rather than the presenter.
Each of these is a negative test: the expected behaviour is rejection, and any accepted assertion is the finding.
What happened, in plain words
In 2017, a security researcher named Antonio Sanso found a way to sign in to Slack as somebody else, without knowing that person's password. He did it using a login document that had been created for a completely different service, GitHub, and that had already expired. Slack accepted it anyway and let him in as the person named in the document.
To understand why that is serious, you need to know what SAML is. SAML is a way for one website to trust another website's confirmation that "this person is who they say they are". Many companies use it so their staff can log in to work tools with the company account instead of a separate password for every tool. The company's login system is called the identity provider, or IdP. The tool being logged into, here Slack, is called the service provider, or SP.
When you log in this way, the IdP hands your browser a small signed document called an assertion. Think of it like a stamped letter of introduction: the stamp proves which office wrote it, and the letter says who you are. The SP checks the stamp, and if it looks genuine, it opens a session for you.

AI-generated illustration
The problem was that Slack did not reject a letter written for GitHub, already expired, and naming somebody else. Sanso showed that a letter written for GitHub, already out of date, and naming somebody else, was enough to get into a Slack workspace as that other person.
He reported it through HackerOne on 2 May 2017. Slack confirmed it the next day, paid a $3,000 bounty on 26 August 2017, and closed the report on 26 October 2017 after working with the customers who were affected.
The pieces you need to know
Before the details make sense, here are the basic ideas, each explained from scratch.
SAML. A standard for passing login confirmations between two systems. The company's login system (the IdP) signs a statement about a user, and the app the user wants (the SP) reads it and trusts it. It is like a passport check at a border: the passport is issued by one country and accepted by another, because both agree on the format and the stamps.
Assertion. The signed document itself. It contains several fields, and the important ones here are:
- Subject: who the document is about, usually a username or account identifier.
- Audience restriction: which service the document was made for. This exists so a document made for one app cannot be used at another.
- Validity window: a not-before time and a not-on-or-after time. Outside that window the document should be refused.
- Destination: the exact address at the SP where the document is meant to be delivered.
- In-response-to: a reference to the login request the SP started, so the SP can tell that it asked for this document.
- Identifier: a unique ID for the document, used to spot the same document being sent twice.
Signature. A cryptographic stamp made with the IdP's private key. Anyone with the IdP's public certificate can check that the stamp is genuine and that the document has not been altered. It proves who wrote the document. It does not prove who the document is for, or whether it is still valid.
Session. The state of being logged in. After a successful login the SP gives your browser a cookie, a small piece of data the browser sends back with every request, so the site remembers you between page loads. Getting a session as somebody else is the whole goal of an authentication bypass.
Authentication bypass. Any flaw that lets someone get in without going through the intended login check. Here, the check existed but was incomplete, so a document that should have been refused was accepted.
Confused deputy. A situation where a system with permission to do something is tricked into doing it on behalf of the wrong party. Slack was the deputy: it had the authority to create sessions, and it was confused into creating one for a document that another service had requested and that was never meant for Slack.
Enterprise workspace. A company's Slack installation, where the company controls who can join and how they log in. The researcher noted the SAML feature was likely aimed at these customers, the ones where SAML is the only way in rather than an optional extra.
Setting up the test
The public disclosure does not describe the researcher's tools, test accounts or workspace settings. What it does say is that the work was done against Slack's SAML single sign-on feature, that the assertion used in the test had been issued for GitHub, and that it named a subject other than the researcher's own handle. The article deliberately leaves out the reproduction details, so how the assertion was obtained and presented is not part of the public record.
Finding the flaw
Sanso described the failure as a confused-deputy problem. Slack did not reject an assertion whose audience was a different service provider. The assertion he presented was also expired, and it identified a subject that was not his own handle. Three separate properties of the assertion were wrong for Slack, and Slack accepted it anyway and signed him in as that subject.
The reasoning that makes this look wrong is straightforward. A valid signature answers who issued the document. It says nothing about whether the document was minted for this service, whether it is still inside its validity window, or whether it belongs to the person presenting it. Each of those is a separate check the SP is responsible for, and the audience restriction exists precisely so a token minted for one service provider cannot be replayed at another.
How the attack worked, step by step
The public disclosure does not include the raw requests, the assertion, or the responses. What it establishes is the sequence of events and the outcome.
Step 1: present an assertion minted for another provider
The assertion was issued for GitHub, not Slack. Its audience restriction therefore named a different service provider. Slack did not reject it on that basis.
Why this matters: the audience field is the instruction "this document is for app X". If app Y accepts it anyway, then any document from the same IdP can be used at any app that trusts that IdP. The check is cheap to perform and its absence removes a whole layer of protection.
Step 2: present an expired assertion
The assertion was expired at the time it was presented, and Slack accepted it anyway.
Why this matters: the validity window limits how long a stolen or leaked document stays useful. If expiry is not enforced, a document that should have died hours or days ago still opens a session.
Step 3: present an assertion naming someone else
The subject in the assertion was not the researcher's handle, and Slack signed him in as that subject.
Why this matters: the subject is the answer to "who is logging in". If the SP does not tie the document to the person actually at the keyboard, then whoever holds the document becomes whoever it names.
The result is a full authentication bypass: possession of a signed assertion from another service, even an expired one, was enough to obtain a Slack session as the subject named in that assertion.
Timeline
| Date | Event |
|---|---|
| 2 May 2017 | Reported via HackerOne |
| 3 May 2017 | Slack confirmed the issue |
| 26 August 2017 | $3,000 bounty paid |
| 26 October 2017 | Report closed after work with affected customers |
Why it happened
Slack did not reject an assertion whose audience was a different service provider; the assertion was also expired and named a subject other than the researcher's handle.
Why the existing defences did not stop it: a signature only proves who issued the assertion. It does not prove the assertion was minted for this service, that it is still valid, or that the presenter is the subject. Those are separate controls, and each closes a different failure mode. Sanso described the failure as a confused-deputy problem: Slack acted on an assertion that was never intended for Slack.
A useful comparison is a hotel receptionist who checks that a key card is genuine but never checks which room number is printed on it, or whether the booking has already ended. The card is real, so the receptionist hands over a room. The missing checks are the ones that make the card mean anything.
What an attacker could do
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. The report does not state which workspaces were affected beyond noting that Slack worked with affected customers before closing the report.
How to fix it
Slack confirmed the issue the day after it was reported and closed the report on 26 October 2017 after finishing work with affected customers. The disclosure does not describe the code change itself. The remediation guidance below is the author's own analysis, not a description of Slack's patch.
- Reject any assertion that does not name this service. The configured entity identifier of the service provider must appear in the audience restriction. An assertion minted for another product is not close enough.
- Enforce the validity window, destination, and request binding. Check not-before and not-on-or-after with a small clock-skew allowance, match the destination to this assertion-consumer URL, and require a pending request that this service created.
- Consume assertion identifiers before issuing a session. Persist the identifier first so a retry cannot replay successfully. Commit that write, then create the local 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) return issue_session(subject=assertion.subject)
Line by line, in plain words:
def accept_assertion(assertion, now, this_sp, used_ids):defines a function that takes the incoming assertion, the current time, the service provider's own settings, and the set of assertion identifiers already seen.if not verify_signature(assertion, this_sp.trusted_idp_certs):checks the cryptographic stamp against the certificates of IdPs this service trusts. If the stamp is not genuine, the next line runs.raise Rejected("bad signature")refuses the login.if now < assertion.not_before or now > assertion.not_on_or_after:checks whether the current time is before the document becomes valid or after it stops being valid.raise Rejected("outside validity window")refuses an expired or not-yet-valid document.if this_sp.entity_id not in assertion.audiences:checks that this service's own name appears in the audience list.raise Rejected("audience mismatch")refuses a document made for a different service.if assertion.destination != this_sp.acs_url:checks that the document was addressed to this service's assertion-consumer address.raise Rejected("bad destination")refuses a document sent to the wrong place.if assertion.in_response_to not in this_sp.pending_requests:checks that the document answers a login request this service actually started.raise Rejected("unknown request")refuses an unsolicited document.with db.transaction():opens a database transaction, a block of work that either fully succeeds or fully fails, so two simultaneous attempts cannot both slip through.if assertion.id in used_ids:checks whether this exact document has already been used.raise Rejected("replay")refuses a second use of the same document.used_ids.add(assertion.id)records the identifier so a retry later will be refused.return issue_session(subject=assertion.subject)creates the logged-in session for the subject named in the document, only after every check has passed.
- Pin trusted identity-provider signing keys. Accept only issuers you intended to federate with, and rotate unused keys out of the trust store.
- 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.
Variants to test
These are the same checks seen from the attacker's side. Each is a negative test: the expected behaviour is rejection, and any accepted assertion is the finding.
- Audience not checked. Take a well-signed assertion from one SP in a federation and present it to another SP that trusts the same IdP. A positive result is a session at the second SP without any assertion minted for it.
- Expiry not checked. Present an assertion after its not-on-or-after time. A positive result is a session created from an assertion whose window has elapsed.
- Destination not checked. Change the destination to a different assertion-consumer URL on the same SP. A positive result is acceptance at a URL the assertion was not addressed to.
- Request binding not checked. Present an unsolicited assertion with no matching pending request, or with an in-response-to value the SP never issued. A positive result is a session without a login flow the SP started.
- Replay. Present the same assertion twice. A positive result is a second session from an identifier that should already have been consumed.
- Subject mismatch. Present an assertion whose subject is a different account than the one initiating the flow. A positive result is a session as the subject named in the assertion rather than the presenter.
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.
Glossary
- Assertion: the signed document a login system sends to an app to say who the user is.
- Audience restriction: the field in an assertion naming which app the document was made for.
- Authentication bypass: getting into an account or system without completing the intended login check.
- Bounty: a payment a company makes to a researcher who reports a security flaw.
- Certificate: a public file used to check that a signature is genuine.
- Confused deputy: a system with authority that is tricked into using it for the wrong party.
- Cookie: a small piece of data a browser stores and sends back to a site, used to remember a session.
- CWE: a catalogue of common weakness types used to classify security flaws.
- CVE: a public identifier for a specific known vulnerability.
- Destination: the exact address at the app where an assertion is meant to be delivered.
- Entity identifier: the name a service provider uses to identify itself in SAML.
- Expiry / validity window: the start and end times between which an assertion should be accepted.
- HackerOne: a platform where researchers report vulnerabilities to companies.
- Identity provider (IdP): the system that confirms who a user is, usually the company's login service.
- In-response-to: a field linking an assertion to the login request the app started.
- Negative test: a test that sends input which should be refused and checks that it is.
- Replay: sending the same valid document again to get a second session.
- SAML: a standard for passing signed login confirmations between an identity provider and an app.
- Service provider (SP): the app the user is logging into, here Slack.
- Session: the logged-in state a site keeps for you after a successful login.
- Signature: a cryptographic stamp proving who issued a document and that it was not altered.
- Single sign-on (SSO): logging in to many apps with one identity.
- Subject: the field in an assertion naming the user it is about.
- Transaction: a database operation that either completes fully or not at all.