Skip to content

[core] Validate IPv6 XOR-MAPPED-ADDRESS length in STUN parser - #3115

Merged
andywolk merged 1 commit into
masterfrom
dmitry/stun_xor_ipv6
Aug 8, 2026
Merged

[core] Validate IPv6 XOR-MAPPED-ADDRESS length in STUN parser#3115
andywolk merged 1 commit into
masterfrom
dmitry/stun_xor_ipv6

Conversation

@morbit85

@morbit85 morbit85 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

switch_stun_packet_attribute_get_xor_mapped_address() read and XOR-rewrote a 16-byte IPv6 address whenever the family byte was 2, without checking the attribute value was that long. Reject family == 2 values shorter than sizeof(switch_stun_ipv6_t) and clear the output address and port. Adds a regression test.

`switch_stun_packet_attribute_get_xor_mapped_address()` read and
XOR-rewrote a 16-byte IPv6 address whenever the `family` byte was 2,
without checking the attribute value was that long. Reject `family == 2`
values shorter than `sizeof(switch_stun_ipv6_t)` and clear the output
address and port. Adds a regression test.
@morbit85
morbit85 requested a review from andywolk August 8, 2026 20:19
@morbit85 morbit85 added the bug Something isn't working label Aug 8, 2026
@andywolk
andywolk merged commit 2c8802e into master Aug 8, 2026
20 checks passed
@andywolk
andywolk deleted the dmitry/stun_xor_ipv6 branch August 8, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants