Unmarshalling with encoding/json doesn't handle duplicates #1

Open
opened 2021-11-08 13:37:36 +00:00 by aydinmercan · 0 comments
aydinmercan commented 2021-11-08 13:37:36 +00:00 (Migrated from github.com)

Consider the following JWK:

{
    "use": "sig",
    "kid": "foobar",
    "alg": "EdDSA",
    "kty": "OKP",
    "crv": "Ed25519",
    "n": KEY_1,
    "n": KEY_2
}

When unmarhsalled into a struct that has the field "n", we will get KEY_1 and not an error during the process.

Is This A Security Issue?

Probably not? Public keys should be fetched over TLS, QUIC etc. and obviously intercepted secure connections and/or unreliable authorities are something this library cannot, should not and would not do. However, considering how other libraries act this is a surefire way to cough up some vulns.

So This Behavior Can Stay?

No. This is still something to be fixed as this currently makes dumb-jose accept invalid JSON.

Consider the following JWK: ```json { "use": "sig", "kid": "foobar", "alg": "EdDSA", "kty": "OKP", "crv": "Ed25519", "n": KEY_1, "n": KEY_2 } ``` When unmarhsalled into a struct that has the field "n", we will get `KEY_1` and not an error during the process. ## Is This A Security Issue? Probably not? Public keys should be fetched over TLS, QUIC etc. and obviously intercepted secure connections and/or unreliable authorities are something this library cannot, should not and would not do. However, considering how other libraries act this is a surefire way to cough up some vulns. ## So This Behavior Can Stay? No. This is still something to be fixed as this currently makes dumb-jose accept invalid JSON.
jaiden added a new dependency 2021-12-06 16:34:14 +00:00
jaiden removed a dependency 2021-12-06 16:34:20 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jaiden/dumb-jose#1
There is no content yet.