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
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:de362628-3779-e698-626f-22f94118d9b3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BE24:2BFDE6:39DEBF:544EC9:6A4E0422 |
| html-safe-nonce | 8fa60e93b3222f2193a7aa49d94eded656d274f70e16af19bcb08be72ff4812e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTI0OjJCRkRFNjozOURFQkY6NTQ0RUM5OjZBNEUwNDIyIiwidmlzaXRvcl9pZCI6IjM5MTA0MTM5NTIwNzczOTkwNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4f1c5c06247d9350cd4bba794513704404a25ba0ebf32cb353c9ccf26fd21e1e |
| hovercard-subject-tag | pull_request:662573774 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/github/codeql/pull/6021/files |
| twitter:image | https://avatars.githubusercontent.com/u/37377780?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/37377780?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/github/codeql git https://github.com/github/codeql.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 143040428 |
| octolytics-dimension-repository_nwo | github/codeql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 143040428 |
| octolytics-dimension-repository_network_root_nwo | github/codeql |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 52bde38e24398476f8eb1e0760c81346c6a00812 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width