Skip to content

[201811][dhcp_relay] Check payload size to prevent buffer overflow in dhcpv6 option #10252

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

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

kellyyeh
Copy link
Contributor

This is a cherry-pick of #9740

Why I did it

When parsing through relay reply packets, parse_dhcpv6_option introduces vulnerability in buffer overflow, allowing up to 2 byte/65535 copied into a fixed buffer of size 4096.

How I did it

Add bound checks to before and after option parsing

How to verify it

Send a dummy packet with option length greater than 4096. dhcp6relay should not perform memcpy on invalid option length.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@kellyyeh kellyyeh merged commit beea989 into sonic-net:201811 Mar 17, 2022
@kellyyeh kellyyeh deleted the 201811-dhcp6-buffer branch March 17, 2022 16:14
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.

2 participants