๐ Introduction
SAML Injection์ Security Assertion Markup Language (SAML) ์์ ๋ฐ์ํ ์ ์๋ Injection ๊ณต๊ฒฉ์ ์๋ฏธํฉ๋๋ค. SAML Process์์ XML ๊ตฌ๋ฌธ ๋ด ๊ณต๊ฒฉ์ฝ๋๋ฅผ ํตํด SSO ๋ฑ ์ธ์ฆ ๊ณผ์ ์ ์ฐํํ๊ฑฐ๋ Signature ๊ฒ์ฆ์ ํต๊ณผํ ์ ์์ต๋๋ค.
๐ก Offensive techniques
Detect
SAML์ ์ด์ฉํ SSO ๋ฑ SAML ์ฌ์ฉ ๊ตฌ๊ฐ์ ๋ชจ๋ ์ ๊ฒ์ ๋์์ด๋ฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก Signature ๊ฒ์ฆ์ ๋ํ ์ฒดํฌ๋ฅผ ์งํํ๋ฉฐ, XSW(XML Signature Wrapping) Attack ๋ฑ์ผ๋ก SAML Response/Assertion ๋ฉ์์ง์ ๊ฐ์ ์ถ๊ฐํ๊ฑฐ๋ ๋ณ์กฐํ์ฌ ์๋ฒ์ ๋ฐ์์ ๋ณด๊ณ ์ฒดํฌํ ์ ์์ต๋๋ค.
|
|
SAML in ZAP/Burp
ZAP, Burpsuite์์ ๊ฐ๊ฐ SAML Support, SAML Raider๋ Addon์ ํตํด SAML ํฌ๋งท์ ๋ฐ์ดํฐ๋ฅผ ์ฝ๊ฒ ํธ์งํ๊ณ ํ ์คํธํ ์ ์์ต๋๋ค.
Invalid Signature
Signature๊ฐ ์ค์ CA์ ์ํด ์๋ช ๋์๋์ง ํ์ธํฉ๋๋ค. ํน์๋ ์ธ์ฆ์๊ฐ ์์ฒด ์๋ช ๋ ๊ฒฝ์ฐ ์ธ์ฆ์๋ฅผ ๋ณต์ ํ๊ฑฐ๋ ์์ฒด ์๋ช ์ธ์ฆ์๋ฅผ ์์ฑํ์ฌ ๋์ฒดํ ์ ์์ต๋๋ค.
Signature Stripping
SAML SSO์ ์ผ๋ถ ๊ตฌ์ฑ์์ Signature section์ ์์๋ก response์์ ์ ๊ฑฐํ์ ๋ Signature verification์ด ์๋ต๋๊ธฐ๋ ํฉ๋๋ค.
XSW Attacks
SAML์ Response๋ Assertion์ ์กฐ์ํ์ฌ ์๋ํ์ง ์์ ๋์์ ์ ๋ํ ์ ์์ต๋๋ค.
|
|
Type | Message | Description |
---|---|---|
XSW1 | Response | ๊ธฐ์กด ์๋ช ๋ค์ ์๋ช ๋์ง ์์ Response copy๋ฅผ ์ถ๊ฐํฉ๋๋ค. |
XSW2 | Response | ๊ธฐ์กด ์๋ช ์์ ์๋ช ๋์ง ์์ Response copy๋ฅผ ์ถ๊ฐํฉ๋๋ค. |
XSW3 | Assertion | ๊ธฐ์กด Assertion ์์ ์๋ช ๋์ง ์์ Assertion copy์ ์ถ๊ฐํฉ๋๋ค. |
XSW4 | Assertion | ๊ธฐ์กด ์ด์ค์ ๋ด์ ์๋ช ๋์ง ์์ Assertion copy์ ์ถ๊ฐํฉ๋๋ค. |
XSW5 | Assertion | Assertion์ ์๋ช ๋ Copy์์ ๊ฐ์ ๋ณ๊ฒฝํ๊ณ SAML ๋ฉ์์ง ๋์ ์๋ช ์ด ์ ๊ฑฐ๋ ์๋ณธ Assertion์ Copy๋ฅผ ์ถ๊ฐํฉ๋๋ค. |
XSW6 | Assertion | Assertion์ ์๋ช ๋ Copy์์ ๊ฐ์ ๋ณ๊ฒฝํ๊ณ ์๋ ์๋ช ๋ค์ ์๋ช ์ด ์ ๊ฑฐ๋ ์๋ณธ Assertion์ Copy๋ฅผ ์ถ๊ฐํฉ๋๋ค. |
XSW7 | Assertion | ์๋ช ๋์ง ์์ Assertion์ “Extensions” ๋ธ๋ก์ ์ถ๊ฐํฉ๋๋ค. |
XSW8 | Assertion | ์๋ช ์ด ์ ๊ฑฐ๋ ์๋ณธ Assertion์ Copy์ ๋ค์ด ์๋ “Object” ๋ธ๋ก์ ์ถ๊ฐํฉ๋๋ค. |
Exploitation
Broken SSO
SAML์ ์ฃผ๋ก SSO(Single Sign-On)์์ ๋ง์ด ์ฌ์ฉ๋ฉ๋๋ค. SAML ๊ธฐ๋ฐ์ SSO์์ SAML Injection์ผ๋ก Authentication Bypass๊ฐ ๋๋ ๊ฒฝ์ฐ ๊ณ์ ํ์ทจ๋ ๊ถํ ๋์ฉ์ด ๋ฐ์ํ ์ ์์ต๋๋ค.
XXE
SAML์ XML ํฌ๋งท์ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ์๋น์ค ๊ตฌ์ฑ์ ๋ฐ๋ผ XXE์ ์ทจ์ฝํ ์ ์์ต๋๋ค. XXE์ ๋ํ ์์ธํ ๋ด์ฉ์ Cullinan > XXE๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์.
๐ก Defensive techniques
SAML SSO ๋ฑ SAML ์ฌ์ฉ ์ ๋ณด์์ ์ ์ํ์ฌ ์ฌ์ฉํด์ผํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ OWASP ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์๊ธฐ ๋ฐ๋๋๋ค.