Skip to content

telnet: use pointer[0] for "unknown" option instead of pointer[i] - #18851

Closed
MegaManSec wants to merge 1 commit into
curl:masterfrom
MegaManSec:telnet
Closed

telnet: use pointer[0] for "unknown" option instead of pointer[i]#18851
MegaManSec wants to merge 1 commit into
curl:masterfrom
MegaManSec:telnet

Conversation

@MegaManSec

Copy link
Copy Markdown
Contributor

i is taken from pointer[length-2] (often the IAC byte) before we do length -= 2, so using pointer[i] indexes an arbitrary/stale byte unrelated to the option code. pointer[0] is the suboption’s option code per the telnet SB format, so printing pointer[0] yields correct, stable diagnostics.

i is taken from pointer[length-2] (often the IAC byte) before we do length -= 2,
so using pointer[i] indexes an arbitrary/stale byte unrelated to the option code.
pointer[0] is the suboption’s option code per the telnet SB
format, so printing pointer[0] yields correct, stable diagnostics.
@MegaManSec

Copy link
Copy Markdown
Contributor Author

Note: An initial analysis showed this may actually patch an OOB read, but I think that isn't possible.

@bagder bagder closed this in eb88092 Oct 5, 2025
@bagder

bagder commented Oct 5, 2025

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants