✨
AppSec & Pentest
AppSec
AppSec
  • AppSec Book
  • Intro
  • PII: Персональные данные
  • Поисковые движки
  • Построение модели угроз / анализ угроз
  • Платформы оркестрации, автоматизации пентеста
  • Audit and Compliance
  • Methodologies
    • Security Check Lists
    • Security Cheat Sheets
    • MNA Process
    • DD Process
    • Написание политик
    • Какие-то модные прикладные инструменты
    • Pentest
      • BlackBox vs GreyBox vs WhiteBox
      • Threat Modeling
      • MITRE ATT&CK
      • OSSTMM
      • CVSS
      • CIS Standarts
      • WASC
      • OWASP Testing Guides
      • PCI DSS
      • PTES
      • NIST SP 800-115
      • ISSAF
  • peoples & blogs
    • Intro
    • Companies
    • Mobile
    • People & Gitbooks
    • Podcasts
    • Jobs
  • Базы уязвимостей
    • vulners
    • zero.today
    • Регистрация CVE
  • Pentest IDE
    • Nuclei (Go)
    • jaeles (Go)
    • Pentest Collaboration Framework
    • Lair Framework (Go)
    • Faraday IDE
    • Nucleus
    • Bulwark
    • Написание отчетов
  • Payloads & Wordlists
    • Генерация wordlists
    • Payloads
      • Подборка
      • Directories
      • Passwords
      • Поддомены
      • Пароли по умолчанию
      • usernames & logins
      • Headers
      • RCE
      • XXE
      • XXS
      • JWT Secrets
    • Расширения файлов, которые можно искать
    • Bypass Something
      • bypass dot
      • 40x bypass
  • AppSec / WEB
    • Common
      • Типовая последовательность действий
      • Common Go Tools
      • Guidelines
    • Automated WebApp Pentest
      • Other tools
      • Burp Suite
        • Режимы в Intruder
        • Как заводить крякнутый
        • Plugins
        • Инструменты для Burp
        • Написание расширений
          • Documentation & Examples
          • UI
          • kotlin
            • Basic
            • Examples
          • jpython
            • Пример
        • Papers
        • Tips
    • Server-Side Vulnerabilities
      • Broken Access Control
      • Bruteforce [credentials]
        • About
        • Papers & Books
        • Tools
          • Hydra
          • Medusa
          • Potator
      • Business Logic Vuln
      • CSV-injection
      • DOS
      • DDOS
      • Dependency Confusion Attack
      • Deserialization
        • About
        • JSON
        • Java
        • .Net / ViewState
        • PHP
        • Python
        • Ruby
        • Тестовые стенды
      • Host Header Injection
      • HTTP Smuggling
      • IDOR
      • JSON Hijacking
      • LFI
      • LFR
      • Open Redirect
        • Cases
          • Open Redirect To XSS
        • CheetSheets
      • OS Command Injection
      • Path Traversal
      • Phishing
      • Race Condition
      • Regular Expression
      • Reverse Shell
      • Searching
      • Session Fixation
      • SQLi
        • Description
        • Databases
          • HQL inj
          • DQL inj
          • postgres
          • Yandex ClickHouse
        • Exec Code
        • Tools
          • Как отработает запрос в разных базах
          • sqli exploit
        • Papers
          • SQLi in Node.js
          • Cheat Sheets
      • SSRF
        • Description
        • Tools
        • Papers
      • SSTI/CSTI
      • Subdomain Takeover
        • Description
        • Tools
        • Papers
      • Upload File
        • MIME type bypass & filter evasions
        • Example: Upload File
        • Some Attacks
        • ImageMagick
        • Inject Payloads
          • To Image
          • WebShell
          • In office macros
          • Контейнеры
            • png
          • XXE/XXS -> Office
        • Tools & MindMaps
      • XML/SOAP injection/XXE
        • About
        • Tools
        • Examples XXE
        • Papers
      • Web Cache Deception
      • Web Cache Poising
    • Client-Side Vulnerabilities
      • Vulnerabilities
      • CSRF
      • CRLF
      • XSS
        • Description
        • Attacks
          • Exploiting XSS
          • GTM (and other TMS) XSS
          • Через SVG
          • DOM-based vulnerabilities
            • About
            • DOM-based XSS
            • DOM-based open redirect
            • DOM Clobbering
          • Local File Read via HTML injection in PDF
          • RCE in DOMPDF
          • [висячая разметка] Dangling markup injection
          • String.prototype.replace
          • CSS injection
          • jQuery XSS
          • AngularJS Sandbox Escape
        • Gadgets
        • Tools
        • Cheat Sheets
        • Papers
      • Prototype Pollution Attack
      • Client-Side & Client-Server Communications
        • window.postMessage
        • Server-Sent Event (SSE)
      • Eval-based Injections
      • Serialization
      • Incorrect work with location
      • Clickjacking (UI redressing)
    • Technics
      • OSINT
        • Tools
          • Поиск по сервисам
            • Github
            • Gitlab
            • Slack
            • Google Dorks
            • Facebook / Instagram
            • LinkedIn
          • Swiss Army Knife
            • Bellingcat's Online Investigation Toolkit
            • MS Threat Intelligence Platform
            • foca/goca
            • spiderfoot
            • Shodan
            • BinaryEdge (Shodan alternative)
            • Maltego
            • theharvester
            • PublicWWW
            • Разное / TODO
          • Поиск по логину / имени/компании
          • Get IP or Geo-location
          • Разное
            • База CommonCrawl
            • ТОП сайтов
        • Certificate Transparency
        • Papers
      • Кодировки
      • Web Application Testing with CryptoPro Sign
      • Получить IP спрятанный за CDN (Search Real IP)
    • SSDLC
    • DevSecOps
      • Materials
      • IAST
      • SAST
        • About
        • SAST List
        • Python: Bandit
        • Semgrep
          • Intro
          • Getting Started
          • Writing rules
            • Pattern syntax
            • Rule syntax
          • Rulesets
          • Papers
        • CodeQL
          • Intro
          • Docs & Papers
          • Get Started
          • Usage
          • CodeQL CLI
          • Writing CodeQL queries
            • About
            • CodeQL Packs
            • CodeQL Queries
            • QL Language
              • About
              • Predicates
              • Queries
              • Types
            • Libraries
              • Intro
              • Javascript
            • Basic types
            • Creating alert queries
            • Creating path queries
          • TODO
        • Checkmarx
      • DAST
        • About
        • NetSparker
        • Rapid7
        • Acunetix
        • OWASP ZAP
        • HP WebInspect
        • Burp Enterprise
        • Wallarm FAST
      • RASP
      • API ST
      • OSA/SCA — Open Source Scanners & Dependency Check
    • Browser PWN
    • Вопросы
      • Как хранить пароли?
      • Куки или токены?
      • Сброс пароля через email
      • Про процессы и контроли
      • Application Security Design Antipatterns
    • ЯП
      • JS
        • Search links
        • RCE on Desktop Clients (ex: win)
        • Обход валидаторов
    • Books & Papers
    • Tools
      • Crawling
      • CSP bypass
      • Web Fuzzers
        • Intro
        • Tools
          • Other tools
          • ffuf (Go)
          • wfuzz
      • Subdomain Enum
        • Combines
          • Amass
          • Monitorizer
          • Findomain
          • dnsdumpster
        • Another tools
        • Brute subdomains
        • Sources
        • Mutators
        • Techniques
      • Other tools
      • Scanners
      • Fingerprinting
      • Scrappers
      • CVEs List
  • Technologies
    • WEB
      • Аналитика & Маркетинг
        • Dark
        • Dark SEO
        • Просто список
      • RSS-каналы
        • Клиенты
        • Atom
      • CMIS
        • About
      • HTTP/WEB
        • Рекомендуемые заголовки (Headers)
        • HSTS
        • SameSite
        • Content-Security-Policy (CSP)
        • Same-Origin Policy (SOP)
        • Cross-Origin Resource Sharing (CORS)
        • Типы запросов
        • First Party Sets
        • Subresource Integrity (SRI)
        • HTTP Reverse Proxy
        • Papers & Resources
      • CMS
        • ModX
        • Joomla
        • Drupal
        • WordPress
        • Liferay
      • Админки/CRM
        • Zend Framework
        • Bitrix
        • Salesforce
      • WAF
      • GraphQL
      • Virtual Hosts
      • OAUTH/OpenID/2FA
        • Общие рекомендации для авторизации
        • 2FA
        • OAuth 2.0
          • About
          • Definitions
            • Clients
            • Tokens
            • Scopes
            • Grant Types
            • Redirect URL
            • The Resourse Server
          • Flows
            • Server Side App Authorization Flow
            • Single Page App Auhtorization Flow
            • Mobile and Native Apps Authorization Flow
            • Authorization Flow
            • Access Tokens Flow
              • Authorization Code Request
              • Password Grant
              • Client Credentials
              • Access Token Reponse
              • Access Token Lifetime
              • Refreshing Access Tokens
              • Making Authenticated Requests
            • Listing Authorizations and Revoking Access Flow
            • OAuth for Browserless and Input Constrained Devices
            • PKCE
            • Token Introspection Server Flow
          • Vulnerabilities
            • Common 1
            • Common 2
        • OpenID Connect (OIDC)
          • About
          • Vulnerabilities
          • Papers
        • IndieAuth
        • Разница между OAuth и OpenID
        • JWT
      • Servers
        • Oracle WebLogic
        • Jetty
        • JBoss (WildFly)
        • Nginx
        • Apache
          • .htaccess
          • <server-url>/server-status
          • Apache Tomcat
          • Apache Struts2
          • CVE
        • F5 BIG-IP
    • Покупка SIM-карт и номеров
    • Banks & Payments
      • Definitions
      • Kind of payments
      • 3DS
      • PCI DSS
      • Эквайринг
      • Vulnerabilities
      • Доклады
      • ATM
    • Программы лояльности
    • Digital Rights Management (DRM)
    • ELK — Elasticsearch, Logstash, Kibana
      • About
      • Elasticsearch
      • Logstash
      • Kibana
    • 1C
    • CI/CD
      • Jenkins
      • huskyCI
      • Travis CI
      • CircleCI
      • Общее
    • SCM
      • Gitlab
      • Tools
      • Vulns
    • Honeypots
    • ChatGPT
  • Learning
    • Компетенции
    • Материалы SANS & Offensive Security
    • Просто норм материалы/gitbooks по пентесту вцелом...
    • Platforms & Playground Labs
    • Бумажная ИБ
      • Информация Общая
      • Иерархия (виды) информации
  • Bug Bounty
    • Notes
    • Browser Plugins
    • Cheat Sheets
    • Платформы
    • Specific tools
  • Hardware/IoT
    • Tools
    • Training
    • Papers & Books
Powered by GitBook
On this page

Was this helpful?

  1. Technologies
  2. WEB
  3. OAUTH/OpenID/2FA

Разница между OAuth и OpenID

PreviousIndieAuthNextJWT

Last updated 5 years ago

Was this helpful?

Разница между OAuth и OpenID:

tl;dr

Most security issues are with implementation and not protocol, the simpler the better.
SAML/WS-Federation and OpenID Connect all use cryptographically signed tokens that support optional encryption
SAML/WS-Fed is XML based and takes on the XML threat model while OpenID Connect is JSON based {} and takes on the OAuth2 threat model
OpenID Connect provides the authentication layer for OAuth2 and addresses some of the most important security gaps with OAuth2
OpenID Connect when properly implemented and used can be just as secure and SAML/WS-Fed OpenID Connect is a "modern" protocol and well suited for newer use case such as devices and native mobile apps.

SAML is a protocol for flows like Web SSO as well as a format for an XML based token (assertion) that is protected via a XML Digital Signature (XML DSIG) and optionally XML encryption (XML ENC). The protocol supports several bindings including SOAP and HTTP (redirect/post)

WS-Federation is a lot more complex in that its actually based on a large set of WS-* standards such as WS-Trust & WS-security that are SOAP based. WS-Federation is agnostic to the token format as it was designed to be a protocol to negotiate tokens (aka Security Token Service). It's common to use SAML format tokens with WS-Federation, but you could technically also use something like a custom token or even a JWT! There is also a "passive" flow for browser based scenarios that is very similar to HTTP redirect binding for the SAML Authentication Request Protocol

OAuth2 is NOT and authentication protocol but rather an authorization delegation protocol. It defines a set of flows (grant types) to obtain tokens but doesn't define the format of a token. Different flows are specified to accommodate the needs of different applications (clients in OAuth) such as a browser, a background server daemon application, or a native mobile app.

OpenID Connect is built on-top of OAuth2 and provides the authentication layer. It adds a new token to OAuth (id_token) that is JWT based and set of mandatory params and claims for the protocol and token (assertion). OpenID Connect was designed to be the "modern authentication" answer to most of the SAML/WS-Fed use cases without the XML & SOAP based overhead for modern apps such as native mobile apps and devices.

When comparing SAML/WS-Fed to OpenID Connect (remember vanilla OAuth2 is NOT an authentication protocol), we need to consider the security of the protocol and security of the token (assertion) but also the software "implementation" of both. More complexity to specifications often leads to more developer bugs!

SAML has common XML threats (www.owasp.org/index.php/SAML_Security_Cheat_Sheet) and puts a lot of complexity on both the IdP and SP to get right from as security perspective. SAML for Web SSO with HTTP binding (most common) depends on TLS for transport security to ensure the token is not intercepted. SAML Assertions are commonly issued as a "Bearer Token" which means that there is not way to bind the issued token to the client that presents the token. If you have the assertion that you are presumed to be the subject of the token. The Identity Provider (IdP) acts as the Authentication Service and issues a SAML assertions (token) that is returned to the pre-configured destination known as the service provider (SP).

The request/response messages can use HTTP redirects or Form POST depending on IdP/SP configuration. A successful response form the IdP contains a protocol envelope message with metadata and an assertion (token). The response and/or the assertion needs to digitally signed with XML DSIG by the IdP using it's private key and optionally encrypted with the SP's public key.

The request/response protocol is very minimal but its important to note that the actual user authentication happens over the browser typically with HTML/JS and is not defined the protocol (yes there is a binding that can use HTTP Basic Auth but its not really used in most deployments). The requesting application is typically not authenticated so the most significant threat from a protocol perspective is to ensure that the IdP only delivers the response to the configured SP and not an attacker. SAML Assertions are commonly issued as a "Bearer Token" which means that there is not way to bind the issued token to the client that presents the token. If you have the assertion that you are presumed to be the subject of the token. The location where the assertion is delivered via redirect or POST URL is typically whitelisted in the IdP to ensure that it can only be delivered to "trusted locations" (assuming you trust DNS, TLS, CA's, and your browser!).

WS-Federation as mentioned before is a lot more complex. The active RPC-like SOAP protocol can optionally use any number of features from the wS-* stack such as message or transport security and bearer or proof-of-possession tokens (where the party presenting the token must cryptographically prove they are the subject of the token). The passive flow is similar to SAML from a security perspective.

Most security issues with SAML/WS-Federation have to deal with the dependency on XML and XML Security (signature & encryption). These are very complicated technologies to get right and most developers only test happy path scenarios. There are so many ways one can implement parsing and data validation that leaves room for an attacker to exploit. A common attack is XML signature wrapping (www.ws-attacks.org/XML_Signature_Wrapping).

OpenID Connect (OIDC) is based on OAuth2 and takes on most of the well documented OAuth 2.0 Threat Model and Security Considerations (rfc6819). There has also been a recent Comprehensive Formal Security Analysis of OAuth 2.0 (). OIDC adds an additional security layer to OAuth2 by returning a signed JWT token to the requesting application called the id token (). Just like SAML with HTTP binding it also relies on TLS for transport security and takes on the typical DNS, TLS, CA's threat model. JWTs can be signed with shared secret or public/private key HMAC and optionally encrypted. The JSON Web Signature (rfc7515) and Encryption (rfc7516) are a lot more simple than their XML DSIG/ENC counterparts which hopefully means more secure implementations but there have been known issues with common libraries (www.chosenplaintext.ca/2015/03/31/jwt-algorithm-confusion.html). OAuth2 requires on client registration which provides identity for the requesting application which can be public or confidential and require client authentication. User authentication is performed over the browser just like SAML.

There is a lot more inputs to validate with OAuth2 than there is with SAML! Most common issues deal with input validation and binding request/response params to the client. There has been a lot of recent work in the OAuth working group to define best practices for native apps (draft-ietf-oauth-native-apps-06). There is a recent draft in OAuth2 working group to identify additional open security topics (draft-lodderstedt-oauth-security-topics-00).

https://arxiv.org/abs/1601.01229
https://openid.net/2016/07/16/preventing-mix-up-attacks-with-openid-connect/