2019-03-25 Authlete Partner Meetup
OAuth Security Workshop 2019 Recap
Tatsuo Kudo
Authlete, Inc.
OAuth Security Workshop (OSW)
• OAuthとその周辺のセキュリティについて
集中的に討議するワークショップ
• 仕様策定者、研究者、学生、ベンダー、
実務担当者が参加
• 2016年から年1回、IETF Meetingの前の
週に開催
2
Source: https://sec.uni-stuttgart.de/events/osw2019
OSW 2019
https://sec.uni-stuttgart.de/events/osw2019
• 2019年3月20日〜22日
@ シュトゥットガルト
– 翌週にIETF 104 @ プラハ
• 参加者数73人
– 前回と前々回はそれぞれ
30人くらいだった
3
Source: https://sec.uni-stuttgart.de/events/osw2019
Schedule
• Wednesday
– Tutorials
• FAPI F2F
– Talks
– Conference
Dinner
• Thursday
– Talks
– Unconference
– Conference
Dinner
• Friday
– Talks
– Invited Talk
– Lightning Talks
– Unconference
4
Topics(私見)
• Financial-grade API (FAPI)
• Best Current Practice (BCP)
• JWT Profile for Access Token
• New Use Cases
• Security Enhancement and Practice
5
FAPI
Meeting
OIDF FAPI WG F2F
• Updates on external organization
– Berlin Group, STET, UK Open Banking, EMVco, FDX
(Financial Data Exchange), FDATA, EBA
– 各所に修正を働きかけている。デザインを修正できたと
ころも、すでに間に合わなかったところもある
– アルゴリズム移行の難しさ → ジェネリックな登録情報
管理のしくみが必要かも
• HTTP Signing
– 複数の仕様が使われている。その中にはすでに expire し
た Internet Draft も含まれている
– FAPI としてテクニカル・リポート的な文書を取りまとめ
る方向
• Testing and certification
– 4月1日からOIDFが担う
– 今後 App-to-App のコンフォーマンスも必要かも
• Lodging intent pattern
– クライアントが認可サーバーに、事前に intent (決済
メッセージなど)を登録し、その intent のハンドルを、
Request Object や scope を用いて認可リクエストに載せ
るパターン
– Request Object のクレームとして、OIDC/OAuth 特有の
ものと、決済のようなアプリケーション特有のものを混
在させることの是非について議論
• Issues
– #212, #201
7
Talk + 2 Unconference Slots
Formal Security Analysis of the OpenID Financial-gradeAPI
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid_financial-grade_api
• “Web Infrastructure Model” をベースにFAPI
特有のモデルを開発
• そのモデルからセキュリティ・プロパティ
を定義
• そのセキュリティ・プロパティの証明を試
みた結果、それまで知られていなかった攻
撃手法を発見
• その攻撃に対するミティゲーションを開発
し、FAPI の ”formal proof” に成功
8
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/hosseyni_-
_formal-analysis-fapi.pdf
Talk + 2 Unconference Slots
Formal Security Analysis of the OpenID Financial-gradeAPI (cont.)
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid_financial-grade_api
• カッコウのトークン攻撃
– 攻撃者の認可サーバーが不正なトークンをクライアントにバインドする。その結果、リソースサーバーがその「クライアントに
バインドされたトークン」を受け入れてしまう
– 緩和策: リソースサーバーがアクセストークンの発行者 (issuer) を確認する
9Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/hosseyni_-_formal-analysis-fapi.pdf
Talk + 2 Unconference Slots
Formal Security Analysis of the OpenID Financial-gradeAPI (cont.)
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid_financial-grade_api
• アクセストークン注入
– 攻撃者がクライアントの管理者を欺き、攻撃者の下にあるトークンEPをクライアントが用いるように仕向ける。
その結果、クライアントはトークンレスポンスとして、不正なトークンをつかまされる
– 緩和策: 認可サーバーが at_hash を提供し、クライアントにアクセストークンの値を検証させる
10Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/hosseyni_-_formal-analysis-fapi.pdf
Unconference
Request/Response Signing
by Dave Tonge
11
• HTTPリクエスト/レスポンスに対する署名方法の比較
– 「金融API」の観点からは、決済リクエストや銀行APIのレスポンスなどで
必要となる(もしくは、必要とされている)
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/tonge_- _http_signi ng.pdf
Talk
Client Initiated BackchannelAuthentication
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkclient_initiated_backchannel_authentication
12
• CIBAの概要と現状
• 他にあまり出てきていないネタ(小ネタ?)
– CIBAfor Payments: “UK Open Banking Team, quite keen on
CIBA.” Merchant に流れる PII を最小化できることも利点
– Poll / Push / Ping モード: ネットワークオペレーターはPush
を好んでいたけど、セキュリティモデルが変わってしまう。
CIBAFAPIプロファイルでは禁止している
– ユーザー識別の問題:モバイル前提の場合にはdiscovery
serviceが使えた(なので、あまり検討されてこなかった)
• 「RPにidentifierを渡す方法はいろいろあるはず。議論
していきたい」
BCP
13
Talk + 1 Unconference Slot
OAuth Security BCP
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkoauth_security_bcp
14
• 当初 (2012年) の想定と、現状との乖離
– 実装時の問題:アンチパターンの利用(仕様に書いて
あるのに)、OAuth周辺の技術の変化
– High-stakesな適用分野:金融や医療
– 動的な連携: クライアントが複数のAS/RSと連携し、
かつ動的な連携が行われるように
• そこで、過去の同種のドキュメントを更新する
– OAuth 2.0 Threat Model and Security Considerations
(RFC 6819)
– OAuth 2.0 Security Considerations (RFC 6749 &
6750)
Talk + 1 Unconference Slot
OAuth Security BCP(cont.)
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkoauth_security_bcp
15
• 新たな推奨事項の例
– Authorization Code Grant の場合はPKCE 必須 (MUST)。
また高リスクの場合には mTLS で sender–constrained すべき
(SHOULD)
• Implicit Grant は使うべきではない (SHOULD NOT)。フロントチャネ
ルにアクセストークンを露見させることは、漏洩したときの対策を取
れない限りは、すべきではない
• PKCEを必須とすることにより、stateパラメーターを文字通り「状態
を表す」目的に使えるように
– リフレッシュトークンのローテーション
• 未決事項いろいろ
– 認可サーバーとユーザーがファイアウォールの内側にいる
ケース、”Self-Issued IdP”、mTLSが容易ではないケース、
stateパラメーターの扱い、redirect_uri がローカルホストである
際にポートをランダムにしたいケース、…
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/lodderstedt_fett_-
_oauth_2.0_security_reinforced.pdf
Talk
A summary of draft-ietf-oauth-browser-based-apps
https://sec.uni-stuttgart.de/events/osw2019/agenda#talka_summary_of_draft-ietf-oauth-browser-based-apps
16
• SPA, PWA向けBCP
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/waite_-_browser_apps_oauth.pdf
JWT PROFILE FOR
ACCESS TOKEN
Talk + 2 Unconference Slots
Usage of JWT in Access Tokens
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkusage_of_jwt_in_access_tokens
• 「JWTなアクセストークン」のガイドラインを作りたい
– JWTなATを使っている既存のIDaaS / ソフトウェアの、そのJWTの
クレームがどうなっているかを分析・分類し、標準的なプロファイ
ルを提案(したい)
Claims idtoken Auth0 Azure AD PingIdentity IdentityServer AWS OKTA Profile
Validation iss
aud
exp
iat
nonce
auth_time
iss
aud
exp
iat
iss
aud
exp
iat
nbf
iss
exp
jti
[aud]
iss
aud
nbf
exp
auth_time
iss
iat
exp
auth_time
iss
aud
iad
exp
iss
aud
exp
iat
jti
auth_time
Identity sub
lots
sub
<any>
sub
name
preferred_user
name
oid
ipaddr
unique_name
sub
email
uid
[sub] sub
username
sub
cid
uid
sub
Authorization N/A scope roles
scp
groups
scope
memberOf
scope scope scp scope
?roles, groups
Context/misc azp
acr
amr
azp
gty
aio
app_displayname
appid
idp
tid
uti
ver
xms_tcdt
---
azp
azpacr
idpid
client_id
client_id
idp
amr
token_use ver client_id
acr
amr
?idp
?azpacr
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/bertocci_- _a_jwt_pr ofile_for_ats.pptx
18
Talk + 2 Unconference Slots
Usage of JWT in Access Tokens (con’t)
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkusage_of_jwt_in_access_tokens
• 議論百出
– そもそもなぜATの中身をclientに見せてしまうのか。暗号化すべきではない
か。PII leakageについてはどうするのか
– 暗号化アルゴリズムはオプションがあって良いのではないか
– Resource Indicatorを使ってクレームの種類を絞ることができると良いので
はないか
– ASとRSとの間のUser Claims Schemaが必要なのではないか(OIDCのク
レーム定義はIdPとclientとの間)
– 法的根拠のある同意が必要ではないか。Profile をATに入れることを誰かが
承認する必要がある。AS/RS に閉じなくなる(1st party scenarioではなくな
る)。3rd Party (client) に開示することになる
• → JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens
https://tools.ietf.org/id/draft-bertocci-oauth-access-token-jwt-00.txt 19
NEW USE CASES
20
Talk + 1 Unconference Slot
OAuth in a Kubernetes Environment
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkoauth_in_a_kubernetes_environment
• k8s環境向け
OAuthフローの提案
– “OAuth Controller” が
ASから認可コードを
取得し、それをPodに
提供
– Podは初期化時に自己
署名証明書を作成し、
トークンリクエスト時
のクライアント証明書
としてASに提示
– ASは証明書にバイン
ドしたトークンを返却
• クレデンシャル保持の
最小化
21
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/madden_- _oauth_in_k8s.pdf
Talk
Security Analysis of IETF ACE-OAuth Protocol
https://sec.uni-stuttgart.de/events/osw2019/agenda#talksecurity_analysis_of_ietf_ace-oauth_protocol
• ACE-OAuth: 制約環境下の
OAuth
– Authentication and Authorization
for Constrained Environments
(ACE) using the OAuth 2.0
Framework
• 同仕様のセキュリティ・アナリ
シスを実施(現在進行中)
22Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/arnaboldi_tschofenig_-
_security_analysis_of_ace_oauth.pdf
SECURITY
ENHANCEMENT
AND PRACTICE
Tutorial
Improving your protocol design skills with formal methods
https://sec.uni-stuttgart.de/events/osw2019/agenda#tutorialimproving_your_protocol_design_skills_with_formal_methods
• Tamarinを用いた、プロトコルの形式検証の
ノウハウ
– 「ポーカーみたいなもの。ルールに従って手札
を出し、どういう振る舞いをするか確認する」
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/arnaboldi_-_secure_protocol_design_through_for mal_methods.pdf
24
Talk
WPSE: Fortifying Web Protocols via Browser-Side Security Monitoring
https://sec.uni-stuttgart.de/events/osw2019/agenda#talkwpsefortifying_web_protocols_via_browser-side_security_monitoring
• ブラウザをWebプロトコルに遵守させるためのブラウザ拡張
– メッセージの順序や制約をチェック
– メッセージ内容をランダム値で置き換え
25
Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/squarcina_-_wpse.pdf
Talk
An Approachfor Secure Code Generation of Single Sign-On and AccessDelegationSolutions for
Mobile Native Appshttps://sec.uni-stuttgart.de/events/osw2019/agenda#talkan_approach_for_secure_code_generation_of_single_sign -on_and_access_delegation_solutions_for_mobile_na tive_apps
• 現状、Native App開発者はIDMP (e.g. Okta, OAuth0, Google, …)
ごとにドキュメントをチェックしたりSDKを組み込んだりしない
といけない
• それらの差異を吸収するためのウィザード (Android Studio Plugin)
を開発した
26
Unconference
Locking Down Tokens in Browsers
by Johan Peeters https://yo1peeters.blogspot.com/2019/03/token-lockdown.html
• ブラウザベースWebアプリケーションにおける、XSS脆弱性によるトークン
窃取の可能性と、その対策を、Reactアプリケーションを用いて実演
27
Unconference
iFrame Sandbox for Tokens
by Jim Manico
• 認可コードがメインページに返ってくる
• それをiframeに渡してトークン交換を行う
Source: https://handouts.secappdev.org/handouts/2019/Philippe%20D e%20R yck%20-%20The%20security%20model%20of%20the%20web%20.pdf 28
Invited Talk
WhyAre We TalkingAbout XSS in 2019?
https://sec.uni-stuttgart.de/events/osw2019/agenda#invited_talkwhy_are_we_talking_about_xss_in_2019
• XSSの現状と対策
29Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/manico_-_why_are_we_talking_about_xss_in_2019.pdf
Unconference
Browser-based Web-Cryptoa.k.a. Asynchronous PKCE (or DPoP)
by John Bradley
• クライアントの鍵ペアをスピンアップする方法
としてWebCrypto APIを用いる
• iframeを作り、その中で:
– WebCrypto APIで鍵ペアを作る
– 公開鍵からPKCEチャレンジ(ハッシュ)を作る
– ASに認可リクエストを送りcodeを取得
– Token EPへのリクエストを、codeとかredirect uri
とかを詰めたsigned JWTとして送りATを取得
– RSへのリクエストを、ATとかを詰めたsigned
JWTとして送る
30
Unconference
OAuth-JAR
by Nat Sakimura
• Issue #80: Add explanatory text on `aud`
https://bitbucket.org/Nat/oauth-jwsreq/issues/80/add-explanatory-text-on-aud
31
まとめ
まとめ(私見)
• Financial-grade API (FAPI)
– “Proved security under strong attacker
model”
– 今後 Lodging Intent Pattern, Req/Res
Signing が盛り上がりそう
• Best Current Practice (BCP)
– 基本としての “Authz Code Grant w/
PKCE and mTLS”
• JWT Profile for Access Token
– プライバシー保護と同意管理に留意
• New Use Cases
– Self-signedmTLS auth code power flow
• Security Enhancement and Practice
– XSS!!
33
Resources
• Slides https://sec.uni-stuttgart.de/events/osw2019/agenda
• Twitter https://twitter.com/hashtag/osw2019
• 過去の日本語記事 (OSW 2017)
– OAuthを将来にわたって安全にするためには
〜OAuthセキュリティ・ワークショップ2017 | @_Nat Zone
https://www.sakimura.org/2017/07/3823/
– OAuth Security Workshop 2017 #osw17
https://www.slideshare.net/tkudo/oauth-security-workshop-2017-osw17
34
Thanks!

#OAuth Security Workshop 2019 Recap @ #Authlete Partner Meetup Spring 2019

  • 1.
    2019-03-25 Authlete PartnerMeetup OAuth Security Workshop 2019 Recap Tatsuo Kudo Authlete, Inc.
  • 2.
    OAuth Security Workshop(OSW) • OAuthとその周辺のセキュリティについて 集中的に討議するワークショップ • 仕様策定者、研究者、学生、ベンダー、 実務担当者が参加 • 2016年から年1回、IETF Meetingの前の 週に開催 2 Source: https://sec.uni-stuttgart.de/events/osw2019
  • 3.
    OSW 2019 https://sec.uni-stuttgart.de/events/osw2019 • 2019年3月20日〜22日 @シュトゥットガルト – 翌週にIETF 104 @ プラハ • 参加者数73人 – 前回と前々回はそれぞれ 30人くらいだった 3 Source: https://sec.uni-stuttgart.de/events/osw2019
  • 4.
    Schedule • Wednesday – Tutorials •FAPI F2F – Talks – Conference Dinner • Thursday – Talks – Unconference – Conference Dinner • Friday – Talks – Invited Talk – Lightning Talks – Unconference 4
  • 5.
    Topics(私見) • Financial-grade API(FAPI) • Best Current Practice (BCP) • JWT Profile for Access Token • New Use Cases • Security Enhancement and Practice 5
  • 6.
  • 7.
    Meeting OIDF FAPI WGF2F • Updates on external organization – Berlin Group, STET, UK Open Banking, EMVco, FDX (Financial Data Exchange), FDATA, EBA – 各所に修正を働きかけている。デザインを修正できたと ころも、すでに間に合わなかったところもある – アルゴリズム移行の難しさ → ジェネリックな登録情報 管理のしくみが必要かも • HTTP Signing – 複数の仕様が使われている。その中にはすでに expire し た Internet Draft も含まれている – FAPI としてテクニカル・リポート的な文書を取りまとめ る方向 • Testing and certification – 4月1日からOIDFが担う – 今後 App-to-App のコンフォーマンスも必要かも • Lodging intent pattern – クライアントが認可サーバーに、事前に intent (決済 メッセージなど)を登録し、その intent のハンドルを、 Request Object や scope を用いて認可リクエストに載せ るパターン – Request Object のクレームとして、OIDC/OAuth 特有の ものと、決済のようなアプリケーション特有のものを混 在させることの是非について議論 • Issues – #212, #201 7
  • 8.
    Talk + 2Unconference Slots Formal Security Analysis of the OpenID Financial-gradeAPI https://sec.uni-stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid_financial-grade_api • “Web Infrastructure Model” をベースにFAPI 特有のモデルを開発 • そのモデルからセキュリティ・プロパティ を定義 • そのセキュリティ・プロパティの証明を試 みた結果、それまで知られていなかった攻 撃手法を発見 • その攻撃に対するミティゲーションを開発 し、FAPI の ”formal proof” に成功 8 Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/hosseyni_- _formal-analysis-fapi.pdf
  • 9.
    Talk + 2Unconference Slots Formal Security Analysis of the OpenID Financial-gradeAPI (cont.) https://sec.uni-stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid_financial-grade_api • カッコウのトークン攻撃 – 攻撃者の認可サーバーが不正なトークンをクライアントにバインドする。その結果、リソースサーバーがその「クライアントに バインドされたトークン」を受け入れてしまう – 緩和策: リソースサーバーがアクセストークンの発行者 (issuer) を確認する 9Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/hosseyni_-_formal-analysis-fapi.pdf
  • 10.
    Talk + 2Unconference Slots Formal Security Analysis of the OpenID Financial-gradeAPI (cont.) https://sec.uni-stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid_financial-grade_api • アクセストークン注入 – 攻撃者がクライアントの管理者を欺き、攻撃者の下にあるトークンEPをクライアントが用いるように仕向ける。 その結果、クライアントはトークンレスポンスとして、不正なトークンをつかまされる – 緩和策: 認可サーバーが at_hash を提供し、クライアントにアクセストークンの値を検証させる 10Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/hosseyni_-_formal-analysis-fapi.pdf
  • 11.
    Unconference Request/Response Signing by DaveTonge 11 • HTTPリクエスト/レスポンスに対する署名方法の比較 – 「金融API」の観点からは、決済リクエストや銀行APIのレスポンスなどで 必要となる(もしくは、必要とされている) Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/tonge_- _http_signi ng.pdf
  • 12.
    Talk Client Initiated BackchannelAuthentication https://sec.uni-stuttgart.de/events/osw2019/agenda#talkclient_initiated_backchannel_authentication 12 •CIBAの概要と現状 • 他にあまり出てきていないネタ(小ネタ?) – CIBAfor Payments: “UK Open Banking Team, quite keen on CIBA.” Merchant に流れる PII を最小化できることも利点 – Poll / Push / Ping モード: ネットワークオペレーターはPush を好んでいたけど、セキュリティモデルが変わってしまう。 CIBAFAPIプロファイルでは禁止している – ユーザー識別の問題:モバイル前提の場合にはdiscovery serviceが使えた(なので、あまり検討されてこなかった) • 「RPにidentifierを渡す方法はいろいろあるはず。議論 していきたい」
  • 13.
  • 14.
    Talk + 1Unconference Slot OAuth Security BCP https://sec.uni-stuttgart.de/events/osw2019/agenda#talkoauth_security_bcp 14 • 当初 (2012年) の想定と、現状との乖離 – 実装時の問題:アンチパターンの利用(仕様に書いて あるのに)、OAuth周辺の技術の変化 – High-stakesな適用分野:金融や医療 – 動的な連携: クライアントが複数のAS/RSと連携し、 かつ動的な連携が行われるように • そこで、過去の同種のドキュメントを更新する – OAuth 2.0 Threat Model and Security Considerations (RFC 6819) – OAuth 2.0 Security Considerations (RFC 6749 & 6750)
  • 15.
    Talk + 1Unconference Slot OAuth Security BCP(cont.) https://sec.uni-stuttgart.de/events/osw2019/agenda#talkoauth_security_bcp 15 • 新たな推奨事項の例 – Authorization Code Grant の場合はPKCE 必須 (MUST)。 また高リスクの場合には mTLS で sender–constrained すべき (SHOULD) • Implicit Grant は使うべきではない (SHOULD NOT)。フロントチャネ ルにアクセストークンを露見させることは、漏洩したときの対策を取 れない限りは、すべきではない • PKCEを必須とすることにより、stateパラメーターを文字通り「状態 を表す」目的に使えるように – リフレッシュトークンのローテーション • 未決事項いろいろ – 認可サーバーとユーザーがファイアウォールの内側にいる ケース、”Self-Issued IdP”、mTLSが容易ではないケース、 stateパラメーターの扱い、redirect_uri がローカルホストである 際にポートをランダムにしたいケース、… Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/lodderstedt_fett_- _oauth_2.0_security_reinforced.pdf
  • 16.
    Talk A summary ofdraft-ietf-oauth-browser-based-apps https://sec.uni-stuttgart.de/events/osw2019/agenda#talka_summary_of_draft-ietf-oauth-browser-based-apps 16 • SPA, PWA向けBCP Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/waite_-_browser_apps_oauth.pdf
  • 17.
  • 18.
    Talk + 2Unconference Slots Usage of JWT in Access Tokens https://sec.uni-stuttgart.de/events/osw2019/agenda#talkusage_of_jwt_in_access_tokens • 「JWTなアクセストークン」のガイドラインを作りたい – JWTなATを使っている既存のIDaaS / ソフトウェアの、そのJWTの クレームがどうなっているかを分析・分類し、標準的なプロファイ ルを提案(したい) Claims idtoken Auth0 Azure AD PingIdentity IdentityServer AWS OKTA Profile Validation iss aud exp iat nonce auth_time iss aud exp iat iss aud exp iat nbf iss exp jti [aud] iss aud nbf exp auth_time iss iat exp auth_time iss aud iad exp iss aud exp iat jti auth_time Identity sub lots sub <any> sub name preferred_user name oid ipaddr unique_name sub email uid [sub] sub username sub cid uid sub Authorization N/A scope roles scp groups scope memberOf scope scope scp scope ?roles, groups Context/misc azp acr amr azp gty aio app_displayname appid idp tid uti ver xms_tcdt --- azp azpacr idpid client_id client_id idp amr token_use ver client_id acr amr ?idp ?azpacr Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/bertocci_- _a_jwt_pr ofile_for_ats.pptx 18
  • 19.
    Talk + 2Unconference Slots Usage of JWT in Access Tokens (con’t) https://sec.uni-stuttgart.de/events/osw2019/agenda#talkusage_of_jwt_in_access_tokens • 議論百出 – そもそもなぜATの中身をclientに見せてしまうのか。暗号化すべきではない か。PII leakageについてはどうするのか – 暗号化アルゴリズムはオプションがあって良いのではないか – Resource Indicatorを使ってクレームの種類を絞ることができると良いので はないか – ASとRSとの間のUser Claims Schemaが必要なのではないか(OIDCのク レーム定義はIdPとclientとの間) – 法的根拠のある同意が必要ではないか。Profile をATに入れることを誰かが 承認する必要がある。AS/RS に閉じなくなる(1st party scenarioではなくな る)。3rd Party (client) に開示することになる • → JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens https://tools.ietf.org/id/draft-bertocci-oauth-access-token-jwt-00.txt 19
  • 20.
  • 21.
    Talk + 1Unconference Slot OAuth in a Kubernetes Environment https://sec.uni-stuttgart.de/events/osw2019/agenda#talkoauth_in_a_kubernetes_environment • k8s環境向け OAuthフローの提案 – “OAuth Controller” が ASから認可コードを 取得し、それをPodに 提供 – Podは初期化時に自己 署名証明書を作成し、 トークンリクエスト時 のクライアント証明書 としてASに提示 – ASは証明書にバイン ドしたトークンを返却 • クレデンシャル保持の 最小化 21 Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/madden_- _oauth_in_k8s.pdf
  • 22.
    Talk Security Analysis ofIETF ACE-OAuth Protocol https://sec.uni-stuttgart.de/events/osw2019/agenda#talksecurity_analysis_of_ietf_ace-oauth_protocol • ACE-OAuth: 制約環境下の OAuth – Authentication and Authorization for Constrained Environments (ACE) using the OAuth 2.0 Framework • 同仕様のセキュリティ・アナリ シスを実施(現在進行中) 22Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/arnaboldi_tschofenig_- _security_analysis_of_ace_oauth.pdf
  • 23.
  • 24.
    Tutorial Improving your protocoldesign skills with formal methods https://sec.uni-stuttgart.de/events/osw2019/agenda#tutorialimproving_your_protocol_design_skills_with_formal_methods • Tamarinを用いた、プロトコルの形式検証の ノウハウ – 「ポーカーみたいなもの。ルールに従って手札 を出し、どういう振る舞いをするか確認する」 Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/arnaboldi_-_secure_protocol_design_through_for mal_methods.pdf 24
  • 25.
    Talk WPSE: Fortifying WebProtocols via Browser-Side Security Monitoring https://sec.uni-stuttgart.de/events/osw2019/agenda#talkwpsefortifying_web_protocols_via_browser-side_security_monitoring • ブラウザをWebプロトコルに遵守させるためのブラウザ拡張 – メッセージの順序や制約をチェック – メッセージ内容をランダム値で置き換え 25 Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/squarcina_-_wpse.pdf
  • 26.
    Talk An Approachfor SecureCode Generation of Single Sign-On and AccessDelegationSolutions for Mobile Native Appshttps://sec.uni-stuttgart.de/events/osw2019/agenda#talkan_approach_for_secure_code_generation_of_single_sign -on_and_access_delegation_solutions_for_mobile_na tive_apps • 現状、Native App開発者はIDMP (e.g. Okta, OAuth0, Google, …) ごとにドキュメントをチェックしたりSDKを組み込んだりしない といけない • それらの差異を吸収するためのウィザード (Android Studio Plugin) を開発した 26
  • 27.
    Unconference Locking Down Tokensin Browsers by Johan Peeters https://yo1peeters.blogspot.com/2019/03/token-lockdown.html • ブラウザベースWebアプリケーションにおける、XSS脆弱性によるトークン 窃取の可能性と、その対策を、Reactアプリケーションを用いて実演 27
  • 28.
    Unconference iFrame Sandbox forTokens by Jim Manico • 認可コードがメインページに返ってくる • それをiframeに渡してトークン交換を行う Source: https://handouts.secappdev.org/handouts/2019/Philippe%20D e%20R yck%20-%20The%20security%20model%20of%20the%20web%20.pdf 28
  • 29.
    Invited Talk WhyAre WeTalkingAbout XSS in 2019? https://sec.uni-stuttgart.de/events/osw2019/agenda#invited_talkwhy_are_we_talking_about_xss_in_2019 • XSSの現状と対策 29Source: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/manico_-_why_are_we_talking_about_xss_in_2019.pdf
  • 30.
    Unconference Browser-based Web-Cryptoa.k.a. AsynchronousPKCE (or DPoP) by John Bradley • クライアントの鍵ペアをスピンアップする方法 としてWebCrypto APIを用いる • iframeを作り、その中で: – WebCrypto APIで鍵ペアを作る – 公開鍵からPKCEチャレンジ(ハッシュ)を作る – ASに認可リクエストを送りcodeを取得 – Token EPへのリクエストを、codeとかredirect uri とかを詰めたsigned JWTとして送りATを取得 – RSへのリクエストを、ATとかを詰めたsigned JWTとして送る 30
  • 31.
    Unconference OAuth-JAR by Nat Sakimura •Issue #80: Add explanatory text on `aud` https://bitbucket.org/Nat/oauth-jwsreq/issues/80/add-explanatory-text-on-aud 31
  • 32.
  • 33.
    まとめ(私見) • Financial-grade API(FAPI) – “Proved security under strong attacker model” – 今後 Lodging Intent Pattern, Req/Res Signing が盛り上がりそう • Best Current Practice (BCP) – 基本としての “Authz Code Grant w/ PKCE and mTLS” • JWT Profile for Access Token – プライバシー保護と同意管理に留意 • New Use Cases – Self-signedmTLS auth code power flow • Security Enhancement and Practice – XSS!! 33
  • 34.
    Resources • Slides https://sec.uni-stuttgart.de/events/osw2019/agenda •Twitter https://twitter.com/hashtag/osw2019 • 過去の日本語記事 (OSW 2017) – OAuthを将来にわたって安全にするためには 〜OAuthセキュリティ・ワークショップ2017 | @_Nat Zone https://www.sakimura.org/2017/07/3823/ – OAuth Security Workshop 2017 #osw17 https://www.slideshare.net/tkudo/oauth-security-workshop-2017-osw17 34
  • 35.