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

Incorrect REQUESTED-ADDRESS-FAMILY attribute length #12

Closed
weiss opened this issue Jul 11, 2022 · 6 comments
Closed

Incorrect REQUESTED-ADDRESS-FAMILY attribute length #12

weiss opened this issue Jul 11, 2022 · 6 comments

Comments

@weiss
Copy link

weiss commented Jul 11, 2022

stunner sets the length of the REQUESTED-ADDRESS-FAMILY attribute to 1 byte, whereas the "length of this attribute is 4 bytes" as per RFC 6256 (just as for e.g. REQUESTED-TRANSPORT, which does have the correct length):

image

(Wireshark calls it REQUESTED-ADDRESS-TYPE, as that was the initial name for attribute 0x0017.)

At least eturnal rejects requests for this reason (because "be strict in what you accept").

Many thanks for this great tool!

firefart added a commit that referenced this issue Jul 11, 2022
@firefart
Copy link
Owner

@weiss good catch thanks! I currently have no IPv6 enabled turn server at hand for testing but pushed a quick fix to the main branch. Can you please test if this now works with eturnal ?

@weiss
Copy link
Author

weiss commented Jul 11, 2022

Seems you're setting the length to 5 byte now (the payload + 4 bytes of padding) 😄

@firefart
Copy link
Owner

Jeah the RFC is not clear about this whether the length value should include the reserved bytes or not, wireshark decodes it correctly but that does not mean anything :)
This page https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-turn/e7efc457-9312-4a6b-8089-94032a599198 means to always set the length to 0x0004 so will try that

firefart added a commit that referenced this issue Jul 11, 2022
@firefart
Copy link
Owner

With the latest changes:
image
can you please try again?

@weiss
Copy link
Author

weiss commented Jul 11, 2022

Jeah the RFC is not clear about this whether the length value should include the reserved bytes or not,

I think the answer is "yes it should include them", it's one byte payload plus three reserved bytes, no?

always set the length to 0x0004 so will try that

Yes I'm pretty sure that's what the RFC is trying to say as well. Wireshark and other servers can obviously decode things just fine by accepting other lengths (as long as they match reality), I'm just deliberately picky in eturnal.

can you please try again?

Works just fine now, thank you very much for the super-quick fix! 👍

@weiss weiss closed this as completed Jul 11, 2022
@firefart
Copy link
Owner

Thanks! Uploaded version v0.4.0 with this fix:
https://github.com/firefart/stunner/releases/tag/v0.4.0

thanks again for the report!

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

No branches or pull requests

2 participants