Skip to content

BFD: check lengths when decoding auth header#887

Open
matzf wants to merge 1 commit intogoogle:masterfrom
matzf:fix-bfd-panic
Open

BFD: check lengths when decoding auth header#887
matzf wants to merge 1 commit intogoogle:masterfrom
matzf:fix-bfd-panic

Conversation

@matzf
Copy link

@matzf matzf commented Jun 22, 2021

Check that the length field of the authentication header matches the
data size and check that the slice is long enough before reading the keyed
MD5/SHA1 authentication section.
Note that the BFD specification (RFC 5880) restricts the valid size of
the authentication header "Data" field for all types, but this is (still) not enforced.

This fixes a "slice bounds out of range" panic when decoding the
Sequence Number field for the keyed MD5/SHA1 authentication section
on truncated messages.

Found with go-fuzz in scionproto/scion.

Check that the length field of the authentication header matches the
data size and check that the slice is long enough before reading the keyed
MD5/SHA1 authentication section.
Note that the BFD specification (RFC 5880) restricts the valid size of
the authentication header "Data" field for all types, but this is
(still) not enforced.

This fixes a "slice bounds out of range" panic when decoding the
Sequence Number field for the keyed MD5/SHA1 authentication section
on truncated messages.

Found with [go-fuzz](https://github.com/dvyukov/go-fuzz) in
[scionproto/scion](https://github.com/scionproto/scion).
@matzf
Copy link
Author

matzf commented Sep 17, 2021

Friendly ping @gconnell. Let me know if I can help in any way with getting this PR reviewed.

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