Saml Padding Oracle
ArcGIS's SAML login flow used AES-CBC encryption without integrity protection, allowing a padding oracle attack to decrypt encrypted assertions. An attacker could then impersonate any user by applying an XML signature wrapping attack to the decrypted assertion.
blog.compass-security.com
Published on blog.compass-security.com
ArcGIS [1] is a family of software providing geographic information system services. While testing a customer’s ArcGIS architecture we came across a SAML login flow.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the use of AES-CBC encryption without a message authentication code, combined with detailed error messages that reveal padding validity.
Impact
An attacker could decrypt encrypted SAML assertions and impersonate any user, but only if assertions can be reused and the service accepts unencrypted assertions.
What the attacker needed
SAML encryption enabled; Ability to send modified SAML responses; Assertions can be reused; Service accepts unencrypted assertions
The fix
The vulnerabilities were fixed in the Portal for ArcGIS Security 2021 Update 1 Patch.
How it was found
- Modify a byte in the last block of the ciphertext and observe a padding error.
- Modify a byte in the second-to-last block and observe a different error, confirming the oracle.
- Split the ciphertext into blocks and send two blocks with varying last byte of the IV to find valid padding values.
- Use the oracle to decrypt the entire assertion.
- Apply an XSW4 attack to the decrypted assertion to impersonate another user.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
SAML is a way for websites to let you log in using another service, like Azure. The login data is encrypted, but the encryption method used here had a flaw: it didn't check if the data had been altered. By sending many slightly changed versions of the encrypted data and watching the error messages, an attacker could slowly figure out the original content and then pretend to be someone else.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.