Skip to content

Fix: Bind web server to IPv6 localhost for security#21

Open
MBanucu wants to merge 5 commits intoshekohex:mainfrom
MBanucu:fix-web-server-binding
Open

Fix: Bind web server to IPv6 localhost for security#21
MBanucu wants to merge 5 commits intoshekohex:mainfrom
MBanucu:fix-web-server-binding

Conversation

@MBanucu
Copy link
Contributor

@MBanucu MBanucu commented Feb 7, 2026

Fixes issue #19: Web server binds to 0.0.0.0 exposing PTY sessions to network.

Changes:

  • Bind to ::1 (IPv6 localhost) by default with configurable PTY_WEB_HOSTNAME
  • Updated tests and docs
  • All tests pass

Remove the .devenv.flake.nix file which is auto-generated by devenv and not needed in the repository.
Change default hostname from 'localhost' to '::1' for IPv6 support.
Add PTY_WEB_HOSTNAME environment variable to allow configuration.
Update tests and documentation accordingly.
@shekohex
Copy link
Owner

shekohex commented Feb 7, 2026

CI fails.

Refactor the test to spawn multiple bun test processes asynchronously
and wait for their completion, improving test reliability and allowing
better detection of race conditions or non-deterministic behavior.
@MBanucu
Copy link
Contributor Author

MBanucu commented Feb 7, 2026

I don't know why this spawn repeat test is failing. It is very flaky and hard to reproduce. In the last hour I couldn't reproduce the error, the hour before I could reproduce the error. I changed something with Bun.spawn instead of Bun.spawnSync and I am reading both stdout and stderr. Maybe it was just a piping error on OS level.

@MBanucu
Copy link
Contributor Author

MBanucu commented Feb 7, 2026

#21 (comment)
I don't know why this spawn repeat test is failing. It is very flaky and hard to reproduce. In the last hour I couldn't reproduce the error, the hour before I could reproduce the error. I changed something with Bun.spawn instead of Bun.spawnSync and I am reading both stdout and stderr. Maybe it was just a piping error on OS level.

I tested the hypothesis and the result is clear: You have to read stdout/stderr if it is piped or else there is a rare flakiness happening.

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.

[Bug]: Web server binds to 0.0.0.0 exposing read/write PTY sessions to network

2 participants