23 KiB
OAuth to Account takeover
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!
Other ways to support HackTricks:
- If you want to see your company advertised in HackTricks or download HackTricks in PDF Check the SUBSCRIPTION PLANS!
- Get the official PEASS & HackTricks swag
- Discover The PEASS Family, our collection of exclusive NFTs
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @carlospolopm.
- Share your hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
{% embed url="https://websec.nl/" %}
Basic Information
OAuthã«ã¯ããŸããŸãªããŒãžã§ã³ããããåºæ¬çãªæ å ±ã¯OAuth 2.0 documentationã§ç¢ºèªã§ããŸãããã®è°è«ã¯äž»ã«åºã䜿çšãããŠããOAuth 2.0 authorization code grant typeã«çŠç¹ãåœãŠãŠãããã¢ããªã±ãŒã·ã§ã³ãä»ã®ã¢ããªã±ãŒã·ã§ã³ïŒèªå¯ãµãŒããŒïŒã§ãŠãŒã¶ãŒã®ã¢ã«ãŠã³ãã«ã¢ã¯ã»ã¹ãŸãã¯æäœãè¡ãããšãå¯èœã«ããèªå¯ãã¬ãŒã ã¯ãŒã¯ãæäŸããŸãã
ä»®æ³ã®ãŠã§ããµã€ã_https://example.com_ãèããŠã¿ãŸãããããã®ãµã€ãã¯ããªãã®ãã¹ãŠã®ãœãŒã·ã£ã«ã¡ãã£ã¢æçš¿ã衚瀺ããããšãç®çãšããŠããŸãïŒãã©ã€ããŒããªæçš¿ãå«ãïŒããããå®çŸããããã«ãOAuth 2.0ã䜿çšãããŸãã_https://example.com_ã¯ããªãã®ãœãŒã·ã£ã«ã¡ãã£ã¢æçš¿ã«ã¢ã¯ã»ã¹ããèš±å¯ãæ±ããŸãããã®çµæã_https://socialmedia.com_ã§åæç»é¢ã衚瀺ãããèŠæ±ãããŠããæš©éãšãªã¯ãšã¹ããè¡ã£ãŠããéçºè ã瀺ãããŸããããªããèªå¯ãããšã_https://example.com_ã¯ããªãã«ä»£ãã£ãŠããªãã®æçš¿ã«ã¢ã¯ã»ã¹ããããšãã§ããããã«ãªããŸãã
OAuth 2.0ãã¬ãŒã ã¯ãŒã¯å ã®ä»¥äžã®ã³ã³ããŒãã³ããç解ããããšãéèŠã§ãïŒ
- resource owner: ããªããã€ãŸããªãœãŒã¹ã«ã¢ã¯ã»ã¹ããããšãèªå¯ãããŠãŒã¶ãŒ/ãšã³ãã£ãã£ãäŸãã°ãããªãã®ãœãŒã·ã£ã«ã¡ãã£ã¢ã¢ã«ãŠã³ãã®æçš¿ã
- resource server: ã¢ããªã±ãŒã·ã§ã³ã
access token
ãååŸããåŸã«èªèšŒããããªã¯ãšã¹ãã管çãããµãŒããŒãäŸïŒhttps://socialmedia.comã - client application:
resource owner
ããã®èªå¯ãæ±ããã¢ããªã±ãŒã·ã§ã³ãäŸïŒhttps://example.comã - authorization server:
resource owner
ã®èªèšŒãæåããèªå¯ãåŸãããåŸã«client application
ã«access tokens
ãçºè¡ãããµãŒããŒãäŸïŒhttps://socialmedia.comã - client_id: ã¢ããªã±ãŒã·ã§ã³ã®å ¬éãããŠããäžæã®èå¥åã
- client_secret: ã¢ããªã±ãŒã·ã§ã³ãšèªå¯ãµãŒããŒã ããç¥ã£ãŠããç§å¯éµã§ã
access_tokens
ãçæããããã«äœ¿çšãããŸãã - response_type: èŠæ±ãããããŒã¯ã³ã®çš®é¡ãæå®ããå€ãäŸïŒ
code
ã - scope:
client application
ãresource owner
ããèŠæ±ããã¢ã¯ã»ã¹ã¬ãã«ã - redirect_uri: èªå¯åŸã«ãŠãŒã¶ãŒããªãã€ã¬ã¯ããããURLãéåžžãäºåã«ç»é²ããããªãã€ã¬ã¯ãURLãšäžèŽããå¿ èŠããããŸãã
- state: ãŠãŒã¶ãŒã®èªå¯ãµãŒããŒãžã®ãªãã€ã¬ã¯ããšæ»ãã®éã«ããŒã¿ãä¿æããããã®ãã©ã¡ãŒã¿ããã®äžææ§ã¯CSRFä¿è·ã¡ã«ããºã ãšããŠæ©èœããããã«éèŠã§ãã
- grant_type: ã°ã©ã³ãã¿ã€ããšè¿ãããããŒã¯ã³ã®çš®é¡ã瀺ããã©ã¡ãŒã¿ã
- code:
authorization server
ããã®èªå¯ã³ãŒãã§ãclient_id
ããã³client_secret
ãšå ±ã«access_token
ãååŸããããã«client application
ã䜿çšããŸãã - access_token:
resource owner
ã«ä»£ãã£ãŠAPIãªã¯ãšã¹ããè¡ãããã«client application
ã䜿çšããããŒã¯ã³ã - refresh_token: ã¢ããªã±ãŒã·ã§ã³ããŠãŒã¶ãŒã«å床ããã³ããã衚瀺ããã«æ°ãã
access_token
ãååŸããããšãå¯èœã«ããŸãã
Flow
å®éã®OAuthãããŒã¯æ¬¡ã®ããã«é²è¡ããŸãïŒ
- ããªãã¯https://example.comã«ã¢ã¯ã»ã¹ããããœãŒã·ã£ã«ã¡ãã£ã¢ãšçµ±åããã¿ã³ãéžæããŸãã
- ãµã€ãã¯æ¬¡ã«https://socialmedia.comã«ãªã¯ãšã¹ããéããhttps://example.comã®ã¢ããªã±ãŒã·ã§ã³ãããªãã®æçš¿ã«ã¢ã¯ã»ã¹ããèš±å¯ãæ±ããŸãããªã¯ãšã¹ãã¯æ¬¡ã®ããã«æ§æãããŸãïŒ
https://socialmedia.com/auth
?response_type=code
&client_id=example_clientId
&redirect_uri=https%3A%2F%2Fexample.com%2Fcallback
&scope=readPosts
&state=randomString123
- 次ã«ãåæããŒãžã衚瀺ãããŸãã
- æ¿èªåŸãSocial Mediaã¯
code
ãšstate
ãã©ã¡ãŒã¿ãå«ãã¬ã¹ãã³ã¹ãredirect_uri
ã«éä¿¡ããŸãã
https://example.com?code=uniqueCode123&state=randomString123
- https://example.com ã¯ããã®
code
ãclient_id
ããã³client_secret
ãšå ±ã«äœ¿çšããŠããµãŒããŒãµã€ããªã¯ãšã¹ããè¡ããããªãã«ä»£ãã£ãŠaccess_token
ãååŸããããªããåæããæš©éãžã®ã¢ã¯ã»ã¹ãå¯èœã«ããŸã:
POST /oauth/access_token
Host: socialmedia.com
...{"client_id": "example_clientId", "client_secret": "example_clientSecret", "code": "uniqueCode123", "grant_type": "authorization_code"}
- æåŸã«ãhttps://example.com ã¯
access_token
ã䜿çšã㊠Social Media ã« API ã³ãŒã«ãè¡ããããã»ã¹ãå®äºããŸãã
è匱æ§
Open redirect_uri
redirect_uri
㯠OAuth ããã³ OpenID å®è£
ã«ãããŠã»ãã¥ãªãã£ã®èŠã§ãããèªå¯åŸã«èªèšŒã³ãŒããªã©ã®æ©å¯ããŒã¿ãéä¿¡ãããå Žæãæ瀺ããŸãã誀ã£ãŠèšå®ããããšãæ»æè
ããããã®ãªã¯ãšã¹ããæªæã®ãããµãŒããŒã«ãªãã€ã¬ã¯ãããã¢ã«ãŠã³ãä¹ã£åããå¯èœã«ããå¯èœæ§ããããŸãã
ãšã¯ã¹ããã€ãææ³ã¯ãèªå¯ãµãŒããŒã®æ€èšŒããžãã¯ã«åºã¥ããŠç°ãªããŸããå³å¯ãªãã¹äžèŽãããæå®ããããã¡ã€ã³ãŸãã¯ãµããã£ã¬ã¯ããªå ã®ä»»æã®URLãåãå ¥ãããã®ãŸã§æ§ã ã§ããäžè¬çãªãšã¯ã¹ããã€ãæ¹æ³ã«ã¯ããªãŒãã³ãªãã€ã¬ã¯ãããã¹ãã©ããŒãµã«ã匱ãæ£èŠè¡šçŸã®æªçšãããŒã¯ã³çé£ã®ããã®HTMLã€ã³ãžã§ã¯ã·ã§ã³ãå«ãŸããŸãã
redirect_uri
以å€ã«ããclient_uri
ãpolicy_uri
ãtos_uri
ãinitiate_login_uri
ãªã©ã®ä»ã® OAuth ããã³ OpenID ãã©ã¡ãŒã¿ããªãã€ã¬ã¯ãæ»æã«å¯ŸããŠè匱ã§ãããããã®ãã©ã¡ãŒã¿ã¯ãªãã·ã§ã³ã§ããããµãŒããŒã«ãã£ãŠãµããŒããç°ãªããŸãã
OpenID ãµãŒããŒãã¿ãŒã²ããã«ããå Žåããã£ã¹ã«ããªãŒãšã³ããã€ã³ãïŒ**.well-known/openid-configuration**
ïŒã«ã¯ãregistration_endpoint
ãrequest_uri_parameter_supported
ãrequire_request_uri_registration
ãªã©ã®è²Žéãªæ§æ詳现ããªã¹ããããŠããããšããããããŸãããããã®è©³çŽ°ã¯ãç»é²ãšã³ããã€ã³ãããµãŒããŒã®ä»ã®æ§æç¹æ§ãç¹å®ããã®ã«åœ¹ç«ã¡ãŸãã
XSS in redirect implementation
ãã®ãã°ããŠã³ãã£ã¬ããŒã https://blog.dixitaditya.com/2021/11/19/account-takeover-chain.html ã«èšèŒãããŠããããã«ããŠãŒã¶ãŒãèªèšŒããåŸã«ãµãŒããŒã®ã¬ã¹ãã³ã¹ã«ãªãã€ã¬ã¯ã URL ãåæ ããã å¯èœæ§ããããXSS ã«å¯ŸããŠè匱 ã§ããå¯èœæ§ããããŸãããã¹ãããããã®å¯èœãªãã€ããŒã:
https://app.victim.com/login?redirectUrl=https://app.victim.com/dashboard</script><h1>test</h1>
CSRF - Improper handling of state parameter
OAuthå®è£
ã«ãããŠãstate
ãã©ã¡ãŒã¿ã®èª€çšãçç¥ã¯ãCross-Site Request Forgery (CSRF)æ»æã®ãªã¹ã¯ã倧å¹
ã«å¢å ãããå¯èœæ§ããããŸãããã®è匱æ§ã¯ãstate
ãã©ã¡ãŒã¿ã䜿çšãããªããéçãªå€ãšããŠäœ¿çšãããããŸãã¯é©åã«æ€èšŒãããªãå Žåã«çºçããæ»æè
ãCSRFä¿è·ãåé¿ã§ããããã«ãªããŸãã
æ»æè ã¯ãããå©çšããŠèªèšŒããã»ã¹ãååããèªåã®ã¢ã«ãŠã³ãã被害è ã®ã¢ã«ãŠã³ãã«ãªã³ã¯ãããããšãã§ããæœåšçãªã¢ã«ãŠã³ãä¹ã£åãã«ã€ãªãããŸããããã¯ãOAuthãèªèšŒç®çã§äœ¿çšãããã¢ããªã±ãŒã·ã§ã³ã«ãããŠç¹ã«éèŠã§ãã
ãã®è匱æ§ã®å®äŸã¯ãããŸããŸãªCTFãã£ã¬ã³ãžããããã³ã°ãã©ãããã©ãŒã ã§ææžåãããŠããããã®å®éã®åœ±é¿ã匷調ãããŠããŸãããã®åé¡ã¯ãSlackãStripeãPayPalãªã©ã®ãµãŒãããŒãã£ãµãŒãã¹ãšã®çµ±åã«ãåã³ãæ»æè ãéç¥ãæ¯æããèªåã®ã¢ã«ãŠã³ãã«ãªãã€ã¬ã¯ãããããšãã§ããŸãã
CSRFããä¿è·ããOAuthãããŒãå®å
šã«ããããã«ã¯ãstate
ãã©ã¡ãŒã¿ã®é©åãªåŠçãšæ€èšŒãäžå¯æ¬ ã§ãã
Pre Account Takeover
- ã¢ã«ãŠã³ãäœææã®ã¡ãŒã«ç¢ºèªãªã: æ»æè ã¯è¢«å®³è ã®ã¡ãŒã«ã䜿çšããŠäºåã«ã¢ã«ãŠã³ããäœæããããšãã§ããŸãã被害è ãåŸã§ãµãŒãããŒãã£ãµãŒãã¹ã䜿çšããŠãã°ã€ã³ãããšãã¢ããªã±ãŒã·ã§ã³ã¯èª€ã£ãŠãã®ãµãŒãããŒãã£ã¢ã«ãŠã³ããæ»æè ã®äºåäœæã¢ã«ãŠã³ãã«ãªã³ã¯ããå¯èœæ§ããããäžæ£ã¢ã¯ã»ã¹ã«ã€ãªãããŸãã
- ç·©ãOAuthã¡ãŒã«ç¢ºèªã®æªçš: æ»æè ã¯ãã¡ãŒã«ã確èªããªãOAuthãµãŒãã¹ãæªçšããŠãèªåã®ãµãŒãã¹ã«ç»é²ãããã®åŸã¢ã«ãŠã³ãã®ã¡ãŒã«ã被害è ã®ãã®ã«å€æŽããããšãã§ããŸãããã®æ¹æ³ã¯ãç°ãªãæ»æãã¯ãã«ãéããŠãæåã®ã·ããªãªãšåæ§ã«äžæ£ãªã¢ã«ãŠã³ãã¢ã¯ã»ã¹ã®ãªã¹ã¯ããããããŸãã
Disclosure of Secrets
ç§å¯ã®OAuthãã©ã¡ãŒã¿ãç¹å®ãä¿è·ããããšã¯éèŠã§ãã**client_id
ã¯å®å
šã«å
¬éã§ããŸãããclient_secret
ãå
¬éããããšã¯é倧ãªãªã¹ã¯ã䌎ããŸããclient_secret
ãæŒæŽ©ãããšãæ»æè
ã¯ã¢ããªã±ãŒã·ã§ã³ã®ã¢ã€ãã³ãã£ãã£ãšä¿¡é ŒãæªçšããŠããŠãŒã¶ãŒã®access_tokens
**ããã©ã€ããŒãæ
å ±ãçãããšãã§ããŸãã
äžè¬çãªè匱æ§ã¯ãã¢ããªã±ãŒã·ã§ã³ãèªèšŒcode
ãaccess_token
ã«äº€æããåŠçãã¯ã©ã€ã¢ã³ãåŽã§è¡ã誀ãããçããŸãããã®èª€ãã«ãããclient_secret
ãé²åºããæ»æè
ãã¢ããªã±ãŒã·ã§ã³ã®ãµããããŠaccess_tokens
ãçæã§ããããã«ãªããŸããããã«ããœãŒã·ã£ã«ãšã³ãžãã¢ãªã³ã°ãéããŠãæ»æè
ã¯OAuthèªèšŒã«è¿œå ã®ã¹ã³ãŒããè¿œå ããããšã§ç¹æš©ããšã¹ã«ã¬ãŒãããã¢ããªã±ãŒã·ã§ã³ã®ä¿¡é Œãããã¹ããŒã¿ã¹ãããã«æªçšããå¯èœæ§ããããŸãã
Client Secret Bruteforce
ãµãŒãã¹ãããã€ããŒã®client_secretãã¢ã€ãã³ãã£ãã£ãããã€ããŒãšå
±ã«ãã«ãŒããã©ãŒã¹ããããšãã§ããŸãã
BFãªã¯ãšã¹ãã¯æ¬¡ã®ããã«èŠãããããããŸãã:
POST /token HTTP/1.1
content-type: application/x-www-form-urlencoded
host: 10.10.10.10:3000
content-length: 135
Connection: close
code=77515&redirect_uri=http%3A%2F%2F10.10.10.10%3A3000%2Fcallback&grant_type=authorization_code&client_id=public_client_id&client_secret=[bruteforce]
Referer Header leaking Code + State
ã¯ã©ã€ã¢ã³ããcodeãšstateãæã£ãŠããå ŽåããããRefererããããŒå ã«åæ ãããŠãããšãã«å¥ã®ããŒãžã«ç§»åãããšè匱ã§ãã
Access Token Stored in Browser History
ãã©ãŠã¶å±¥æŽã«ã¢ã¯ã»ã¹ããŠãã¢ã¯ã»ã¹ããŒã¯ã³ãä¿åãããŠãããã©ããã確èªããŸãã
Everlasting Authorization Code
èªå¯ã³ãŒãã¯ãæ»æè ããããçãã§äœ¿çšã§ããæéæ ãå¶éããããã«ãäžå®æéã ãæå¹ã§ããã¹ãã§ãã
Authorization/Refresh Token not bound to client
èªå¯ã³ãŒããååŸããŠå¥ã®ã¯ã©ã€ã¢ã³ãã§äœ¿çšã§ããå Žåãä»ã®ã¢ã«ãŠã³ããä¹ã£åãããšãã§ããŸãã
Happy Paths, XSS, Iframes & Post Messages to leak code & state values
AWS Cognito
ãã®ãã°ããŠã³ãã£ã¬ããŒãã§ã¯: https://security.lauritz-holtmann.de/advisories/flickr-account-takeover/ AWS CognitoããŠãŒã¶ãŒã«è¿ãããŒã¯ã³ããŠãŒã¶ãŒããŒã¿ãäžæžãããã®ã«ååãªæš©éãæã£ãŠããå¯èœæ§ãããããšãããããŸãããããã£ãŠããŠãŒã¶ãŒã®ã¡ãŒã«ã¢ãã¬ã¹ãå¥ã®ã¡ãŒã«ã¢ãã¬ã¹ã«å€æŽã§ããå Žåãä»ã®ã¢ã«ãŠã³ããä¹ã£åãããšãã§ãããããããŸããã
# Read info of the user
aws cognito-idp get-user --region us-east-1 --access-token eyJraWQiOiJPVj[...]
# Change email address
aws cognito-idp update-user-attributes --region us-east-1 --access-token eyJraWQ[...] --user-attributes Name=email,Value=imaginary@flickr.com
{
"CodeDeliveryDetailsList": [
{
"Destination": "i***@f***.com",
"DeliveryMedium": "EMAIL",
"AttributeName": "email"
}
]
}
詳现ãªAWS Cognitoã®æªçšæ¹æ³ã«ã€ããŠã¯ã以äžãåç §ããŠãã ããïŒ
{% embed url="https://cloud.hacktricks.xyz/pentesting-cloud/aws-pentesting/aws-unauthenticated-enum-access/aws-cognito-unauthenticated-enum" %}
ä»ã®ã¢ããªã®ããŒã¯ã³ã®æªçš
ãã®æžã蟌ã¿ã§è¿°ã¹ãããŠããããã«ãããŒã¯ã³ïŒã³ãŒãã§ã¯ãªãïŒãåãåãããšãæåŸ ããOAuthãããŒã¯ãããŒã¯ã³ãã¢ããªã«å±ããŠãããã©ããã確èªããªãå Žåãè匱ã§ããå¯èœæ§ããããŸãã
ããã¯ãæ»æè ãOAuthããµããŒãããã¢ããªã±ãŒã·ã§ã³ãäœæããFacebookã§ãã°ã€ã³ïŒäŸãã°ïŒããããšãã§ããããã§ãããã®åŸã被害è ãæ»æè ã®ã¢ããªã±ãŒã·ã§ã³ã§Facebookã«ãã°ã€ã³ãããšãæ»æè ã¯è¢«å®³è ã®ãŠãŒã¶ãŒã«äžããããOAuthããŒã¯ã³ãååŸãããã®ããŒã¯ã³ã䜿çšããŠè¢«å®³è ã®OAuthã¢ããªã±ãŒã·ã§ã³ã«ãã°ã€ã³ããããšãã§ããŸãã
{% hint style="danger" %} ãããã£ãŠãæ»æè ããŠãŒã¶ãŒã«èªåã®OAuthã¢ããªã±ãŒã·ã§ã³ã«ã¢ã¯ã»ã¹ãããããšãã§ããã°ãããŒã¯ã³ãæåŸ ãããã®ããŒã¯ã³ãèªåã®ã¢ããªIDã«ä»äžããããã©ããã確èªããªãã¢ããªã±ãŒã·ã§ã³ã§è¢«å®³è ã®ã¢ã«ãŠã³ããä¹ã£åãããšãã§ããŸãã {% endhint %}
äºã€ã®ãªã³ã¯ãšã¯ãããŒ
ãã®æžã蟌ã¿ã«ãããšã被害è ã«returnUrlãæ»æè ã®ãã¹ããæãããŒãžãéãããããšãå¯èœã§ããããã®æ å ±ã¯ã¯ãããŒïŒRUïŒã«ä¿åãããåŸã®ã¹ãããã§ããã³ããããŠãŒã¶ãŒã«ãã®æ»æè ã®ãã¹ãã«ã¢ã¯ã»ã¹ãèš±å¯ãããã©ãããå°ããŸãã
ãã®ããã³ãããåé¿ããããã«ãOauthãããŒãéå§ããã¿ããéãããã®RUã¯ãããŒãreturnUrlã䜿çšããŠèšå®ããããã³ããã衚瀺ãããåã«ã¿ããéãããã®å€ãªãã§æ°ããã¿ããéãããšãå¯èœã§ããããããšãããã³ããã¯æ»æè ã®ãã¹ãã«ã€ããŠéç¥ããŸããããã¯ãããŒã¯ããã«èšå®ããããããããŒã¯ã³ã¯ãªãã€ã¬ã¯ã·ã§ã³ã§æ»æè ã®ãã¹ãã«éä¿¡ãããŸãã
ããã³ããã€ã³ã¿ã©ã¯ã·ã§ã³ã®åé¿
ãã®ãããªã§èª¬æãããŠããããã«ãäžéšã®OAuthå®è£
ã§ã¯ãprompt
GETãã©ã¡ãŒã¿ãNoneïŒ&prompt=none
ïŒãšããŠæå®ããããšã§ããŠãŒã¶ãŒããã©ãããã©ãŒã ã«æ¢ã«ãã°ã€ã³ããŠããå Žåã«ããã³ããã§ã¢ã¯ã»ã¹ã®ç¢ºèªãæ±ããããªãããã«ããããšãã§ããŸãã
response_mode
ãã®ãããªã§èª¬æãããŠããããã«ãæçµURLã§ã³ãŒããæäŸããå Žæã瀺ãããã«**response_mode
**ãã©ã¡ãŒã¿ãæå®ããããšãå¯èœã§ãïŒ
response_mode=query
-> ã³ãŒãã¯GETãã©ã¡ãŒã¿å ã«æäŸãããŸãïŒ?code=2397rf3gu93f
response_mode=fragment
-> ã³ãŒãã¯URLãã©ã°ã¡ã³ããã©ã¡ãŒã¿å ã«æäŸãããŸãïŒ#code=2397rf3gu93f
response_mode=form_post
-> ã³ãŒãã¯code
ãšããååã®å ¥åãšå€ãæã€POSTãã©ãŒã å ã«æäŸãããŸãresponse_mode=web_message
-> ã³ãŒãã¯ãã¹ãã¡ãã»ãŒãžã§éä¿¡ãããŸãïŒwindow.opener.postMessage({"code": "asdasdasd...
SSRFsãã©ã¡ãŒã¿
ãã®ç 究ããã§ã㯠ãã®æè¡ã®è©³çŽ°ã«ã€ããŠã
OAuthã®åçã¯ã©ã€ã¢ã³ãç»é²ã¯ã**Server-Side Request Forgery (SSRF)**æ»æã®ããã®éèŠãªãã¯ã¿ãŒãšããŠæ©èœããŸãããã®ãšã³ããã€ã³ãã¯ãã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ã«é¢ãã詳现ãåãåããããæªçšãããå¯èœæ§ã®ããæ©å¯URLãå«ãããšããããŸãã
éèŠãªãã€ã³ãïŒ
- åçã¯ã©ã€ã¢ã³ãç»é²ã¯éåžž
/register
ã«ãããã³ã°ãããclient_name
ãclient_secret
ãredirect_uris
ãããã³ããŽãJSON Web Key Sets (JWKs)ã®URLãªã©ã®è©³çŽ°ãPOSTãªã¯ãšã¹ãã§åãå ¥ããŸãã - ãã®æ©èœã¯RFC7591ããã³OpenID Connect Registration 1.0ã®ä»æ§ã«åŸã£ãŠãããSSRFã«å¯ŸããŠæœåšçã«è匱ãªãã©ã¡ãŒã¿ãå«ã¿ãŸãã
- ç»é²ããã»ã¹ã¯ã以äžã®æ¹æ³ã§ãµãŒããŒãSSRFã«ãããå¯èœæ§ããããŸãïŒ
logo_uri
ïŒã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ã®ããŽã®URLã§ããµãŒããŒããã§ããããå¯èœæ§ããããSSRFãåŒãèµ·ããããURLã誀ã£ãŠåŠçããããšXSSãåŒãèµ·ããå¯èœæ§ããããŸããjwks_uri
ïŒã¯ã©ã€ã¢ã³ãã®JWKããã¥ã¡ã³ããžã®URLã§ãæªæã®ãã圢ã§äœæãããå ŽåããµãŒããŒãæ»æè ãå¶åŸ¡ãããµãŒããŒã«ã¢ãŠãããŠã³ããªã¯ãšã¹ããè¡ãåå ãšãªããŸããsector_identifier_uri
ïŒredirect_uris
ã®JSONé åãåç §ãããµãŒããŒããã§ããããå¯èœæ§ããããSSRFã®æ©äŒãäœãåºããŸããrequest_uris
ïŒã¯ã©ã€ã¢ã³ãã®èš±å¯ããããªã¯ãšã¹ãURIããªã¹ããããµãŒããŒãèªèšŒããã»ã¹ã®éå§æã«ãããã®URIããã§ããããå Žåãæªçšãããå¯èœæ§ããããŸãã
æªçšæŠç¥ïŒ
logo_uri
ãjwks_uri
ããŸãã¯sector_identifier_uri
ã®ãããªãã©ã¡ãŒã¿ã«æªæã®ããURLãå«ãæ°ããã¯ã©ã€ã¢ã³ããç»é²ããããšã§ãSSRFãåŒãèµ·ããããšãã§ããŸããrequest_uris
ãä»ããçŽæ¥ã®æªçšã¯ãã¯ã€ããªã¹ãå¶åŸ¡ã«ãã£ãŠè»œæžãããå¯èœæ§ããããŸãããäºåã«ç»é²ãããæ»æè ãå¶åŸ¡ããrequest_uri
ãæäŸããããšã§ãèªèšŒãã§ãŒãºäžã«SSRFãä¿é²ããããšãã§ããŸãã
OAuthãããã€ããŒã®ã¬ãŒã¹ã³ã³ãã£ã·ã§ã³
ãã¹ãããŠãããã©ãããã©ãŒã ãOAuthãããã€ããŒã§ããå Žåããããèªãã§ã¬ãŒã¹ã³ã³ãã£ã·ã§ã³ã®ãã¹ããè¡ã£ãŠãã ããã
åèæç®
- https://medium.com/a-bugz-life/the-wondeful-world-of-oauth-bug-bounty-edition-af3073b354c1
- https://portswigger.net/research/hidden-oauth-attack-vectors
{% embed url="https://websec.nl/" %}
ãŒãããããŒããŒãŸã§ã®AWSãããã³ã°ãåŠã¶ htARTE (HackTricks AWS Red Team Expert)!
HackTricksããµããŒãããä»ã®æ¹æ³ïŒ
- HackTricksã§äŒç€Ÿã®åºåã衚瀺ããããHackTricksãPDFã§ããŠã³ããŒããããå Žåã¯ããµãã¹ã¯ãªãã·ã§ã³ãã©ã³ããã§ãã¯ããŠãã ããïŒ
- å ¬åŒPEASS & HackTricksã°ããºãæã«å ¥ããŸããã
- The PEASS FamilyãçºèŠããç§ãã¡ã®ç¬å çãªNFTsã³ã¬ã¯ã·ã§ã³ããã§ãã¯ããŠãã ãã
- ð¬ Discordã°ã«ãŒããŸãã¯Telegramã°ã«ãŒãã«åå ããããTwitter ðŠ @carlospolopmããã©ããŒããŠãã ããã
- ãããã³ã°ã®ããªãã¯ãå ±æããã«ã¯ã HackTricksããã³HackTricks Cloudã®GitHubãªããžããªã«PRãæåºããŠãã ããã