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

Header types are not validated #82

Closed
tjade273 opened this issue Jun 30, 2022 · 1 comment · Fixed by #87
Closed

Header types are not validated #82

tjade273 opened this issue Jun 30, 2022 · 1 comment · Fixed by #87
Assignees
Milestone

Comments

@tjade273
Copy link

Section 3.1 of RFC 8152 defines a number of common COSE header parameters and their associated value types. Applications using the go-cose library may rely on COSE-defined headers decoded by the library to be of a specified type. For example, the COSE specification defines the content-type header to be of type either text string or unsigned integer. The go-cose library currently only validates the alg and crit parameters.

An application using go-cose to verify and validate incoming COSE messages may for example use the content-type header to index a map, expecting the content type to be a valid string or integer. If that assumption is violated, a malicious message may cause a panic in the receiver.

The lack of validation also allows users to serialize messages that will be rejected by other conforming COSE libraries - for example https://github.com/laurencelundblade/t_cose rejects messages with incorrect header types.

The implementation should validate common header types, and/or clearly document which headers are validated.

@SteveLasker SteveLasker added this to the v1.0.0-RC1 milestone Jul 1, 2022
@SteveLasker
Copy link
Contributor

Agreeing to take as it makes it consistent with t_cose

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 a pull request may close this issue.

3 participants