-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/asn1: accepts non-minimal OID encoding #36881
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
Comments
/cc @FiloSottile @agl |
Do we know of frequent occurrences of this in the wild? (Trying to understand if we'll cause breakage.) |
I haven't seen this in the wild, but I also haven't looked. Just occurred to me to try out Go's behavior when I read that section of the spec. |
Let's fix this early so it has time to bake. I'd take a CL for it! |
Reject base 128 encoded integers that aren't using minimal encoding, specifically if the leading octet of an encoded integer is 0x80. This only affects parsing of tags and OIDs, both of which expect this encoding (see X.690 8.1.2.4.2 and 8.19.2). Fixes golang#36881 Change-Id: I969cf48ac1fba7e56bac334672806a0784d3e123
Reject base 128 encoded integers that aren't using minimal encoding, specifically if the leading octet of an encoded integer is 0x80. This only affects parsing of tags and OIDs, both of which expect this encoding (see X.690 8.1.2.4.2 and 8.19.2). Fixes golang#36881 Change-Id: I969cf48ac1fba7e56bac334672806a0784d3e123
Reject base 128 encoded integers that aren't using minimal encoding, specifically if the leading octet of an encoded integer is 0x80. This only affects parsing of tags and OIDs, both of which expect this encoding (see X.690 8.1.2.4.2 and 8.19.2). Fixes golang#36881 Change-Id: I969cf48ac1fba7e56bac334672806a0784d3e123
Change https://golang.org/cl/227320 mentions this issue: |
@rolandshoemaker @FiloSottile @jsha could we perhaps send a release note documenting this update? It is a new change that'll surprise some folks. |
Yup, will do. |
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Passed an invalidly-encoded OID to
asn1.Unmarshal
What did you expect to see?
Parse error.
What did you see instead?
Successful parse.
Here's an example program demonstrating the problem, along with a reference to the ASN.1 spec:
https://play.golang.org/p/ETqZ6Kxz16G
The text was updated successfully, but these errors were encountered: