webtty
webtty copied to clipboard
Make backend readonly by default
Description:
By default, WebTty shouldn't allow clients to write any keystrokes or commands into the forked process. Except for window resizing events which should still take effect. An extra command line flag should be provided to permit clients to write input to the TTY. However, accepting input from remote clients is dangerous for most commands. These security considerations should be properly documented ex README.md.
To Do:
- [ ] Stop listening for std input requests in read-only mode and do not redirect std input stream from the forked process.
- [ ] Add command-line option (
-wor--write) to enable writing into the process, this then does redirect std input stream from the forked process and will write from the socket into std input. - [ ] ~~Add command line option to trigger emulator mode (
--emulator). This makes the backend behave like a terminal emulator. Allow writing into process and lookup default system terminal on startup.~~ - [ ] ~~When not in emulator mode throw error when no process to startup is provided.~~
- [ ] Update
README.mdwith security considerations
Example:
-w | --write Permit clients to write to the TTY (BE CAREFUL)
--emulator Act like normal terminal emulator: allows writing and lookup default shell.