Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jwk-json-leak template matcher #11414

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

seqre
Copy link

@seqre seqre commented Dec 25, 2024

Template / PR Information

According to the RFC 7517 section 4.5:

The "kid" value is a case-sensitive string. Use of this member is OPTIONAL.

On the other hand, section 4.1 mentions:

The "kty" value is a case-sensitive string. This member MUST be present in a JWK.

With that in mind, I've changed the kid from the template's matcher to kty as there is a higher chance that this field will be present.

Template Validation

I've validated this template locally?

  • YES
  • NO

Example jwks.json file from Appendix A of the RFC:

{"keys":
 [
   {"kty":"EC",
    "crv":"P-256",
    "x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
    "y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
    "use":"enc",
    "kid":"1"},

   {"kty":"RSA",
    "n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
    "e":"AQAB",
    "alg":"RS256",
    "kid":"2011-04-29"}
 ]
}

I hosted this file locally as visible and then with the kid fields removed. The new template matches the file in both cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant