René's URL Explorer Experiment


Title: Java: CWE-326 Query to detect weak HMAC secret keys used to sign JWT by luchua-bc · Pull Request #6021 · github/codeql · GitHub

Open Graph Title: Java: CWE-326 Query to detect weak HMAC secret keys used to sign JWT by luchua-bc · Pull Request #6021 · github/codeql

X Title: Java: CWE-326 Query to detect weak HMAC secret keys used to sign JWT by luchua-bc · Pull Request #6021 · github/codeql

Description: JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted through a digital signature. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA. JWT Best Practices require human-memorizable passwords MUST NOT be directly used as the key to a keyed-MAC algorithm such as “HS256”. RFC 7518 recommends to use a password that is as large as (or larger than) the derived key length in JSON web algorithms. Common JWT signature algorithms are HS256, HS384, and HS512. Popular JWT libraries offer a method to set signing key with a handy string argument in addition to the method with a byte array argument taking the binary cryptographic key. It is a common mistake that JWT users are confused by the method signature and attempted to use raw password strings as the key argument, which is almost always incorrect for cryptographic hashes and can produce insecure results. Signature algorithms are vulnerable to brute force attack when a weak key of shorter length is used. This query detect uses of signature algorithms with a weak key of shorter length. It checks the following three scenarios with two popular JWT frameworks jjwt and jose4j: Weak keys allowed by jjwt builds before version 0.10.0 released on July 30, 2018 that are still being used by many GitHub repositories Weak keys explicitly enabled by jose4j through the method call of relaxing key validation Weak keys hashed to meet the length requirement but don't have have sufficient entropy Please consider to merge the PR. Thanks.

Open Graph Description: JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be ver...

X Description: JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be ver...

Opengraph URL: https://github.com/github/codeql/pull/6021

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:de362628-3779-e698-626f-22f94118d9b3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBE24:2BFDE6:39DEBF:544EC9:6A4E0422
html-safe-nonce8fa60e93b3222f2193a7aa49d94eded656d274f70e16af19bcb08be72ff4812e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTI0OjJCRkRFNjozOURFQkY6NTQ0RUM5OjZBNEUwNDIyIiwidmlzaXRvcl9pZCI6IjM5MTA0MTM5NTIwNzczOTkwNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4f1c5c06247d9350cd4bba794513704404a25ba0ebf32cb353c9ccf26fd21e1e
hovercard-subject-tagpull_request:662573774
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql/pull/6021/files
twitter:imagehttps://avatars.githubusercontent.com/u/37377780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/37377780?s=400&v=4
og:image:altJSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be ver...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonedf0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql git https://github.com/github/codeql.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id143040428
octolytics-dimension-repository_nwogithub/codeql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id143040428
octolytics-dimension-repository_network_root_nwogithub/codeql
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release52bde38e24398476f8eb1e0760c81346c6a00812
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql/pull/6021/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F6021%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F6021%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql
Reloadhttps://github.com/github/codeql/pull/6021/files
Reloadhttps://github.com/github/codeql/pull/6021/files
Reloadhttps://github.com/github/codeql/pull/6021/files
Please reload this pagehttps://github.com/github/codeql/pull/6021/files
github https://github.com/github
codeqlhttps://github.com/github/codeql
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql
Fork 2k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Star 9.8k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Code https://github.com/github/codeql
Issues 987 https://github.com/github/codeql/issues
Pull requests 426 https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality 0 https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Code https://github.com/github/codeql
Issues https://github.com/github/codeql/issues
Pull requests https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
luchua-bchttps://github.com/luchua-bc
github:mainhttps://github.com/github/codeql/tree/main
luchua-bc:java/weak-jwt-hmac-secrethttps://github.com/luchua-bc/ql/tree/java/weak-jwt-hmac-secret
Conversation 2 https://github.com/github/codeql/pull/6021
Findings https://github.com/github/codeql/pull/6021/findings
Commits 1 https://github.com/github/codeql/pull/6021/commits
Checks 0 https://github.com/github/codeql/pull/6021/checks
Files changed https://github.com/github/codeql/pull/6021/files
Please reload this pagehttps://github.com/github/codeql/pull/6021/files
Java: CWE-326 Query to detect weak HMAC secret keys used to sign JWT https://github.com/github/codeql/pull/6021/files#top
Show all changes 1 commit https://github.com/github/codeql/pull/6021/files
ddcaf7c Query to detect weak HMAC secret keys used to sign JWT luchua-bc Jun 5, 2021 https://github.com/github/codeql/pull/6021/commits/ddcaf7cb2e8996b0d1fee879cf72b743169c9581
Clear filters https://github.com/github/codeql/pull/6021/files
Please reload this pagehttps://github.com/github/codeql/pull/6021/files
Please reload this pagehttps://github.com/github/codeql/pull/6021/files
WeakJwtSecretKey.java https://github.com/github/codeql/pull/6021/files#diff-7780f9cdc503f177a3ce0e7d72845ba61be2617cfc84dc796dc80c0fdb76d06a
WeakJwtSecretKey.qhelp https://github.com/github/codeql/pull/6021/files#diff-5b107c0f96ec9cc5e09250c8af98df9e7ed56fb32900eba2bc5f4d9e12dbe3e0
WeakJwtSecretKey.ql https://github.com/github/codeql/pull/6021/files#diff-31095cae2e89802e7b34581cba1c36d81dd39fcd8294282e04578a9543672a3b
MissingJWTSignatureCheck.ql https://github.com/github/codeql/pull/6021/files#diff-a5f5c383cdeddee4f7a59b62aa967a74c5ab7c06d90e734496b0d2eeee043789
Jjwt.qll https://github.com/github/codeql/pull/6021/files#diff-af9fcfbe03b2a19e1ec5102b7cd41b949c0fddaf5ab8b1c0a6ab9aec0166d555
Jose4j.qll https://github.com/github/codeql/pull/6021/files#diff-6c9eb3852974df06c2754aa86845bf9fa7f5b3a0a30f9f020da62d2d4aa3f700
WeakJwtSecretKey.expected https://github.com/github/codeql/pull/6021/files#diff-f3701ac330bac851a93d04e993f6d9b601de6da89051a78b923cc2e39548b193
WeakJwtSecretKey.java https://github.com/github/codeql/pull/6021/files#diff-24f6e77e7a246dfba4cb4f0d36a36c16dd8e93796ea7beb66ce08a70c36b84b4
WeakJwtSecretKey.qlref https://github.com/github/codeql/pull/6021/files#diff-129c10d8dc2e41441ba6897c54e8db18fc83c166ad87b3bd8a5c9df1aedf0076
options https://github.com/github/codeql/pull/6021/files#diff-1f0c6a11e6437a508030c715367483485a788cc71a3a456527414e8b8f3ba523
AlgorithmIdentifiers.java https://github.com/github/codeql/pull/6021/files#diff-dcb0f5d4afbf297cb3c4e42157f0e96c0af75fe86d2c25f1e3b08eb9f0cebc90
JsonWebSignature.java https://github.com/github/codeql/pull/6021/files#diff-af76343918d6159964089a5961133d1e1d73006e1d1620d876d058abd8eab88c
JwtClaims.java https://github.com/github/codeql/pull/6021/files#diff-bb11797e725073aadc14a81d2a148b0ef815424f1c7052221b61b2f0fc721dd3
MalformedClaimException.java https://github.com/github/codeql/pull/6021/files#diff-21b49d9f233951ff16773cc9533246755e107ffec4d2ecbce065ef61ad013ec9
InvalidJwtException.java https://github.com/github/codeql/pull/6021/files#diff-0eb6b50049bf95330f347d165ae0fb80692b7d0b85012a4f440dc98a41bb0c26
JwtConsumer.java https://github.com/github/codeql/pull/6021/files#diff-2b277a30c3386a7ac6c584d467ef4a668e08447e7f207bf666ec7ad677c91254
JwtConsumerBuilder.java https://github.com/github/codeql/pull/6021/files#diff-13f2bc92929a9994b206b108c8238da1afb3cc2bc7d9fc31bf0497d75f989688
JsonWebStructure.java https://github.com/github/codeql/pull/6021/files#diff-542244bd380cbccf9e4ab6ed3621b052c162de11039847759712f32bf3d59cd8
HmacKey.java https://github.com/github/codeql/pull/6021/files#diff-72ffe0fcb00cd231899cce2e05bdb3e449f1594aab1c47bed403125971ba1b1f
JoseException.java https://github.com/github/codeql/pull/6021/files#diff-d872b43de69588f7c444e67932f84ef16dc679507f5a61db71ec04b8e30ee14f
JwtBuilder.java https://github.com/github/codeql/pull/6021/files#diff-3e0b7cf7edab530547fd98c94f9b02396b8386948ea28969d0615018d2ba3a24
Jwts.java https://github.com/github/codeql/pull/6021/files#diff-ae6b560b2124ecaa296c34b5efc85920a889791c4746a595eb033b4c73e5e9dd
SignatureAlgorithm.java https://github.com/github/codeql/pull/6021/files#diff-9fe7a1508505632f9763c72d04ed376e3d7356da5633a74e40cec8c4557ae541
InvalidKeyException.java https://github.com/github/codeql/pull/6021/files#diff-0ebcb671db6c4a8332122536ed8ffdd3bcee63f2acbcff25e08be7cf6d4f601c
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-326/WeakJwtSecretKey.javahttps://github.com/github/codeql/pull/6021/files#diff-7780f9cdc503f177a3ce0e7d72845ba61be2617cfc84dc796dc80c0fdb76d06a
View file https://github.com/luchua-bc/ql/blob/ddcaf7cb2e8996b0d1fee879cf72b743169c9581/java/ql/src/experimental/Security/CWE/CWE-326/WeakJwtSecretKey.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/6021/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-326/WeakJwtSecretKey.qhelphttps://github.com/github/codeql/pull/6021/files#diff-5b107c0f96ec9cc5e09250c8af98df9e7ed56fb32900eba2bc5f4d9e12dbe3e0
View file https://github.com/luchua-bc/ql/blob/ddcaf7cb2e8996b0d1fee879cf72b743169c9581/java/ql/src/experimental/Security/CWE/CWE-326/WeakJwtSecretKey.qhelp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/6021/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-326/WeakJwtSecretKey.qlhttps://github.com/github/codeql/pull/6021/files#diff-31095cae2e89802e7b34581cba1c36d81dd39fcd8294282e04578a9543672a3b
View file https://github.com/luchua-bc/ql/blob/ddcaf7cb2e8996b0d1fee879cf72b743169c9581/java/ql/src/experimental/Security/CWE/CWE-326/WeakJwtSecretKey.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/6021/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-347/MissingJWTSignatureCheck.qlhttps://github.com/github/codeql/pull/6021/files#diff-a5f5c383cdeddee4f7a59b62aa967a74c5ab7c06d90e734496b0d2eeee043789
View file https://github.com/luchua-bc/ql/blob/ddcaf7cb2e8996b0d1fee879cf72b743169c9581/java/ql/src/experimental/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/6021/{{ revealButtonHref }}
https://github.com/github/codeql/pull/6021/files#diff-a5f5c383cdeddee4f7a59b62aa967a74c5ab7c06d90e734496b0d2eeee043789
https://github.com/github/codeql/pull/6021/files#diff-a5f5c383cdeddee4f7a59b62aa967a74c5ab7c06d90e734496b0d2eeee043789
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/semmle/code/java/frameworks/Jjwt.qllhttps://github.com/github/codeql/pull/6021/files#diff-af9fcfbe03b2a19e1ec5102b7cd41b949c0fddaf5ab8b1c0a6ab9aec0166d555
View file https://github.com/luchua-bc/ql/blob/ddcaf7cb2e8996b0d1fee879cf72b743169c9581/java/ql/src/experimental/semmle/code/java/frameworks/Jjwt.qll
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/6021/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/semmle/code/java/frameworks/Jose4j.qllhttps://github.com/github/codeql/pull/6021/files#diff-6c9eb3852974df06c2754aa86845bf9fa7f5b3a0a30f9f020da62d2d4aa3f700
View file https://github.com/luchua-bc/ql/blob/ddcaf7cb2e8996b0d1fee879cf72b743169c9581/java/ql/src/experimental/semmle/code/java/frameworks/Jose4j.qll
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/6021/{{ revealButtonHref }}
Please reload this pagehttps://github.com/github/codeql/pull/6021/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.