Penetration Test Report (Hackmanit): Penetration Test Report DENIC ID by Hackmanit

Penetration Test Report:
DENIC ID
Version: 1.2.1
19.01.2024
Dr.-Ing. Juraj Somorovsky
|
Phone: (+49)(0)234/45930961 E-Mail: juraj.somorovsky@hackmanit.de
Project Information
Customer: DENICeG
Kaiserstraße75-77
60329FrankfurtamMain,Deutschland
Contact: MarcosSanz
Commissionedto: HackmanitGmbH
Universitätsstraße60(Exzenterhaus)
44789Bochum,Germany
Projectexecutive: Dr.-Ing. JurajSomorovsky
Phone: (+49)(0)234/45930961
Fax: (+49)(0)234/45930960
E-Mail: juraj.somorovsky@hackmanit.de
Projectmembers: KarstenMeyerzuSelhausen(HackmanitGmbH)
Dr.-Ing. VladislavMladenov(HackmanitGmbH)
MarioKorth(HackmanitGmbH)
Projectperiod: 11.03.2019–19.03.2019
Versionofthereport: 1.2.1
ThisreportwastechnicallyverifiedbyDr.-Ing. VladislavMladenov.
ThisreportwaslinguisticallyverifiedbyDavidHerring.
HackmanitGmbH
Representedby: Prof. Dr. JörgSchwenk,Prof. Dr. JurajSomorovsky,
Dr. ChristianMainka,Prof. Dr. MarcusNiemietz
Registercourt: AmtsgerichtBochum,HRB14896,Germany
1
Contents
Contents
1 Summary 4
2 ProjectTimeline 5
3 Methodology 5
4 GeneralConditionsandScope 6
5 ScenarioDescription 7
6 OverviewofWeaknesses,Recommendations,andInformation 11
7 Weaknesses 15
7.1 H01 SignatureExclusionattheIdentityAgent . . . . . . . . . . . . . . . . . . 15
7.2 M01 InsufficientClickjackingProtections . . . . . . . . . . . . . . . . . . . . . . 16
7.3 M02 UserEnumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.4 M03 Missing Binding Between HTTP Parameter sessionID and Session
Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.5 M04 InsufficientCross-siteRequestForgeryProtection . . . . . . . . . . . . . 19
7.6 M05 FaultySessionManagement . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.7 M06 IdentityAuthorityAllowsHTTPRedirectURIs . . . . . . . . . . . . . . . 21
7.8 L01 MissingBruteForceProtections . . . . . . . . . . . . . . . . . . . . . . . . 22
7.9 L02 Denial-of-ServiceAttackattheIdentityAgent . . . . . . . . . . . . . . . 22
8 Recommendations 24
8.1 R01 IssueaNewAccessTokentoAccesstheIdentityAgentatUserinfoEnd-
point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.2 R02 ImplementAccessTokensasOne-Time-UseTokensatIdentityAgent . 24
8.3 R03 Revoke Authorization Code When It Is Redeemed Using False Client
Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.4 R04 RevokeTokensIftheRelatedAuthorizationCodeIsRedeemedaSecond
Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.5 R05 RevokeTokensWhentheUserChangeshisPassword . . . . . . . . . . 25
8.6 R06 ImplementRefreshTokensasOne-Time-UseTokens . . . . . . . . . . . 26
8.7 R07 RevokeTokensWhenaRefreshTokenIsRedeemedaSecondTime . . 26
8.8 R08 PreventConcurrentLogins . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.9 R09 SecureCookieswithHttpOnlyFlag . . . . . . . . . . . . . . . . . . . . 27
8.10 R10 SecureCookieswithSecureFlag . . . . . . . . . . . . . . . . . . . . . . 27
8.11 R11 EnforceHTTPStrictsTransportSecurity . . . . . . . . . . . . . . . . . . . 27
8.12 R12 RestrictCross-OriginResourceSharingtoWhitelist . . . . . . . . . . . . 28
8.13 R13 EnableContentSecurityPolicy . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.14 R14 SetXSSProtectionHTTPHeader . . . . . . . . . . . . . . . . . . . . . . . 28
8.15 R15 DisableRefererHTTPHeader . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.16 R16 DisableContentTypeSniffing . . . . . . . . . . . . . . . . . . . . . . . . . 29
2
Contents
8.17 R17 SetCacheControlHTTPHeaders . . . . . . . . . . . . . . . . . . . . . . . 29
8.18 R18 UseDiscoveryMechanismatIdentityAgent . . . . . . . . . . . . . . . . . 29
9 Information 30
9.1 I01 InformationDisclosureontheConsentPage . . . . . . . . . . . . . . . . 30
10 FurtherEvaluations 32
10.1 OpenIDConnectParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
10.2 AuthorizationCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
10.3 AccessToken . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
10.4 RefreshToken . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
10.5 ClientRegistrationEndpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
10.6 EndSessionEndpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
10.7 IntrospectionEndpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
10.8 RevocationEndpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
10.9 TokenEndpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
10.10 UserinfoEndpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
10.11 UpdatingStoredClaims . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
10.12 OpenRedirects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
10.13 Cross-siteScripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
10.14 XML-basedAttacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
10.15 TLSConfiguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
11 References 44
3
1 Summary
1 Summary
DENIC ID is the first widely-deployed implementation of the ID4me protocol [1]. ID4me is a
novelprotocolforfederatedidentitymanagement,ofwhichthetwomaingoalsaretoprovide
(1)AuthorizationofauserforaccesstoanythirdpartyacceptingID4meidentifiersand(2)Con-
trolled communication of the user’s personal information to the third parties accessed by the
user [1]. ID4me is based on well-established standards such as OpenID Connect (OIDC) [12]
anddomainnamesystem(DNS)[4].
Hackmanit GmbH was commissioned to perform a penetration test of DENIC ID. After an ini-
tial kick-off meeting at the office of DENIC eG in Frankfurt am Main, the penetration test was
performedremotelywithatotalexpenseof11man-days.
Weaknesses. During the penetration test, one weakness classified as High and five weak-
nessesclassifiedasMediumwereidentified. Thehighestrankedweaknesstargetedtheiden-
tityagent. Insteadofenforcingthattheaccesstoken(whichisaJWT)containsasignaturefrom
theidentityauthority,theidentityagentacceptedaccesstokenswhichdonotcontainanysig-
nature at all. This allowed an attacker to craft his own access tokens and use them to access
thestoredpersonalinformationofarbitraryusers. Anothermentionableweakness,whichwas
identifiedattheidentityauthority,allowedanattackertologavictimintohisaccount. Depend-
ingontheserviceprovidedbytherelyingpartythismightresultinthevictimrevealingpersonal
informationorfilestotheattacker.
Bothweaknessesdescribedabovewerealreadyfixedbyupdatesoftheidentityauthorityand
identityagentduringthepenetrationtest. AccordingtoDENIC,allremainingweaknessesclas-
sified as Medium were fixed by the end of June. In our retests, we tested and successfully
verifiedthecorrectnessofthreecountermeasures( H01 , M03 ,and M05 ).
Additionally,westronglyrecommendfixingtheweaknessesclassifiedasLowandInformation
aswellastoimplementtherecommendationsgiveninSection8toimprovetheoverallsecurity
ofthetestedsystems.
Top Weaknesses:
RiskLevel Finding Reference
H01 SignatureExclusionattheIdentityAgent Section7.1,page15
Structure. Thereportisstructuredasfollows:InSection2,thetimelineofthepenetrationtest
is listed. Section 3 introduces our methodology and Section 4 explains the general conditions
andscopeofthepenetrationtest. Section6providesanoverviewoftheidentifiedweaknesses,
as well as, further recommendations and information. In Section 7, all identified weaknesses
arediscussedindetailandspecificcountermeasuresaredescribed.Section8summarizesour
recommendations resulting from observations of the application. In Section 9, observations
of unusual configurations and possibly unwanted behavior of the application are desc