SAML is XML with a signature, and XML has many equivalent representations. Security depends on verifying the signature over the exact element that is later used for authorization, then enforcing audience, recipient, time and replay rules.
Service providers often parse XML into a document, verify one assertion, then read identity or attributes from another node, another namespace or an unsigned extension. Signature wrapping, comment truncation, stripped signatures and missing audience or recipient checks let an attacker reuse a valid signature while changing what the application trusts. A response can also be replayed to a different SP or ACS when those constraints are not enforced.
- Decode the signed sample
- Identify which parts of the response are trusted
- Forge or replay an administrator assertion
- Capture the flag
Browser to service provider ACS
Where to look before you type a payload
The browser posts a base64 SAMLResponse to the service provider's assertion consumer service.
The XML parser builds a document tree with assertions, signatures, namespaces and attributes.
The SP checks the signature over a specific element and resolves the reference and canonicalization.
The application chooses the assertion, NameID and attributes that will define the session.
Open one hint at a time. The first two build the model; the last two point at the boundary.
Hint 1
Open the sample, decode the base64 and identify the Assertion, the Signature and the role attribute.
Hint 2
Ask which exact bytes the signature covers; the lab mode tells you where the trust boundary is broken.
Hint 3
Decode the sample, change the role to admin, re-encode, and submit. This SP never verifies a signature.
Hint 4 · near the answer
Submit the base64 SAMLResponse to /saml/acs; the flag appears when the SP grants administrator.
Observe → Hypothesize → Test → Prove → Explain
This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.
Evidence log
Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.
Preview the evidence report
# Lab evidence report — The Response Nobody Signed - Family: SAML - Lab ID: web-saml-unsigned-response - Date: 2026-12-05 ## Workflow ### Observe - [ ] Open "The Response Nobody Signed" and record the entry point, the HTTP method and the role you are given. - [ ] List every parameter, header, cookie and object identifier the normal flow exposes. - [ ] Save a baseline response: status, body shape, timing and the fields that change by user. ### Hypothesize - [ ] Name the server decision that protects the entry point, and the evidence it should use. - [ ] Use the clue as a constraint, not an answer: Decode the sample, change the role to admin, re-encode, and submit. This SP never verifies a signature. - [ ] Predict the exact status, body or state change that would prove the decision is missing. ### Test - [ ] Start from the baseline and change one value: the SAMLResponse assertion and signature. - [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result. - [ ] Capture the full request and response for the winning attempt, including the flag. ### Prove - [ ] Capture the flag and name the exact foreign object, role or state change it proves. - [ ] Repeat from a clean session and confirm the result is not cached or stale. - [ ] State impact precisely: what data or action did you actually obtain? ### Explain - [ ] State the root cause without naming the payload: which decision failed? - [ ] Name the control that prevents recurrence and the layer where it belongs. - [ ] Write one regression test that fails before the fix and passes after it. ## Evidence ### Target and baseline _Not recorded._ ### Hypothesis _Not recorded._ ### Winning request _Not recorded._ ### Proof _Not recorded._ ### Root cause _Not recorded._ ### Control and regression test _Not recorded._ ## Analyst conclusion The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.
False positives to rule out
- The SP rejects the response before reading any attribute; a signature error is not a bypass.
- The changed attribute is inside the signed assertion and the signature check fails.
- The response is accepted only for the same audience and recipient and the attacker gains no new privilege.
Regression tests to name
- Unsigned response is rejected: Authentication fails with an explicit signature error
- Signature wrapping is rejected: The request is rejected or only the verified assertion is used
- Audience and recipient enforced: The service provider rejects it for audience or recipient mismatch
- Use a maintained SAML library and verify the signature over the exact assertion that supplies identity and attributes.
- Reject unsigned assertions, enforce audience, recipient, issuer, NotBefore and NotOnOrAfter, and bind responses to the request ID.
- Reject duplicate IDs, unexpected namespace declarations and multiple assertions unless the profile explicitly allows them.
- Use short assertion lifetimes, one-time replay caches, signed request/response exchange and strict XML parsing.
SAML تعتمد على XML وتوقيعه، وXML له تمثيلات متكافئة كثيرة. الخطر عندما يتحقق الخادم من توقيع Assertion ثم يقرأ الدور أو الهوية من عقدة أخرى غير موقعة. الحل: استخدم مكتبة SAML مُصانة، وتحقق من التوقيع على نفس العقدة التي تُستخدم للتفويض، وارفض الاستجابات غير الموقعة، واشترط audience وrecipient والوقت وعدم التكرار، وارفض المعرفات المكررة والمساحات الاسمية غير المتوقعة.