Skip to content

KNOWN_BUGS.md: Windows stdin relay accepts unauthenticated local conn… - #21433

Closed
bagder wants to merge 3 commits into
masterfrom
bagder/stdin-relay
Closed

bagder wants to merge 3 commits into
masterfrom
bagder/stdin-relay

Conversation

@bagder

@bagder bagder commented Apr 24, 2026

Copy link
Copy Markdown
Member

…ections

A windows developer could have a look at this.

…ections

A windows developer could have a look at this.
@github-actions github-actions Bot added the CI Continuous Integration label Apr 24, 2026
@bagder
bagder marked this pull request as ready for review April 24, 2026 07:10
@bagder

bagder commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

I'll leave this open for a while for visibility.

@vszakats

Copy link
Copy Markdown
Member

The implementation is a hot-spot of many issues. One that comes
to mind is using the API TerminateThread(), which is strongly
discouraged by documentation:
"TerminateThread is a dangerous function that should only be used in the most extreme cases."

@bagder bagder closed this in aa1e954 Apr 25, 2026
@bagder
bagder deleted the bagder/stdin-relay branch April 25, 2026 14:15
@11soda11

11soda11 commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

since the auth would require an RNG impl in the tool, would it be fine to move the one in libcurls weak_random() into curlx for this?

@vszakats

Copy link
Copy Markdown
Member

Curl_win32_random() could be moved to curlx (e.g. to winapi.c) for reuse in tool, yes.
It's also proper, non-weak, random.

(moving whole weak_random() seems overkill, since this issue is Windows-specific.)

@11soda11

11soda11 commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Curl_win32_random() could be moved to curlx (e.g. to winapi.c) for reuse in tool, yes. It's also proper, non-weak, random.

(moving whole weak_random() seems overkill, since this issue is Windows-specific.)

i wanted to do that, but in case of MS-DOS win32 isn't available right? At least there are a lot of #ifdef _WIN32 inside tool_doswin

@vszakats

Copy link
Copy Markdown
Member

Curl_win32_random() could be moved to curlx (e.g. to winapi.c) for reuse in tool, yes. It's also proper, non-weak, random.
(moving whole weak_random() seems overkill, since this issue is Windows-specific.)

i wanted to do that, but in case of MS-DOS win32 isn't available right? At least there are a lot of #ifdef _WIN32 inside tool_doswin

It isn't, but MS-DOS doesn't need a random, only win32_stdin_read_thread() and related logic does, that's #ifdef _WIN32.

@11soda11

Copy link
Copy Markdown
Contributor

whoops ur right, thx.

11soda11 added a commit to 11soda11/curl that referenced this pull request Apr 29, 2026
The windows stdin relay ìn `src/tool_doswin.c` works
by having a background thread accept a TCP connection
from the main thread, to which it then forwards stdin data.

As there is currently no authentication, an attacker can race
to connect to the socket before curl and exfiltrate said data.

Fix this by verifying the peer with a random number in the
background thread.

Ref: curl#21433
11soda11 added a commit to 11soda11/curl that referenced this pull request Apr 29, 2026
The windows stdin relay ìn `src/tool_doswin.c` works
by having a background thread accept a TCP connection
from the main thread, to which it then forwards stdin data.

As there is currently no authentication, an attacker can race
to connect to the socket before curl and exfiltrate said data.

Fix this by verifying the peer with a random number in the
background thread.

Fixes: curl#21433
11soda11 added a commit to 11soda11/curl that referenced this pull request Apr 29, 2026
The windows stdin relay ìn `src/tool_doswin.c` works
by having a background thread accept a TCP connection
from the main thread, to which it then forwards stdin data.

As there is currently no authentication, an attacker can race
to connect to the socket before curl and exfiltrate said data.

Fix this by verifying the peer with a random number in the
background thread.

Ref: curl#21433
11soda11 added a commit to 11soda11/curl that referenced this pull request Apr 29, 2026
The windows stdin relay ìn `src/tool_doswin.c` works
by having a background thread accept a TCP connection
from the main thread, to which it then forwards stdin data.

As there is currently no authentication, an attacker can race
to connect to the socket before curl and exfiltrate said data.

Fix this by verifying the peer with a random number in the
background thread.

Ref: curl#21433
11soda11 added a commit to 11soda11/curl that referenced this pull request Apr 30, 2026
The windows stdin relay ìn `src/tool_doswin.c` works
by having a background thread accept a TCP connection
from the main thread, to which it then forwards stdin data.

As there is currently no authentication, an attacker can race
to connect to the socket before curl and exfiltrate said data.

Fix this by verifying the peer with a random number in the
background thread.

Ref: curl#21433
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
…ections

A windows developer could have a look at this.

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

Labels

CI Continuous Integration documentation help wanted Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

3 participants