ttyd icon indicating copy to clipboard operation
ttyd copied to clipboard

Add functionality to write to a temp file through url arguments

Open vaishalikumanan opened this issue 4 years ago • 11 comments
trafficstars

This feature is similar to the existing option that allows url arguments to be passed in as command line arguments. Instead, we create a temporary file in /tmp/ and write the url arguments to this file, separated by newlines. The temporary file name is then passed to the command as a command line argument. Because of this behaviour, the command line args option and the temporary file option should be mutually exclusive.

We can then use this to pass secret values to the running process as command line arguments are easily visible through process status.

vaishalikumanan avatar Aug 05 '21 21:08 vaishalikumanan

writing to a temp file without cleanup? I prefer setting it as env

tsl0922 avatar Aug 18 '21 16:08 tsl0922

@tsl0922 you are right that with temp file, we are relying on the receiver to delete the file. we considered passing via env var (https://github.com/tsl0922/ttyd/pull/745/) and one side effect is that env vars are easily visible if you run ps e.

While it's true that users with permissions to /proc/<pid>/environ would also have permission to read the temp file, internal security review prefers we reduce the likelihood of accidental information leakage.

Would you prefer if we add both the env and file options? We will only use the file option but maybe others will find the env option helpful too.

kahing avatar Aug 18 '21 18:08 kahing

@tsl0922 any more thoughts on this?

kahing avatar Aug 25 '21 22:08 kahing

@kahing sorry I'm a little busy this week, I'm OK with this feature, will review it soon.

tsl0922 avatar Aug 27 '21 14:08 tsl0922

@tsl0922 I updated the PR and addressed your comments. Let me know if you have more feedback

kahing avatar Sep 02 '21 19:09 kahing

@tsl0922 Hi any updates?

kahing avatar Sep 09 '21 23:09 kahing

@tsl0922 Hi any updates?

kahing avatar Sep 28 '21 20:09 kahing

@tsl0922 hi any updates?

kahing avatar Oct 27 '21 21:10 kahing

@tsl0922 Hi any updates on this PR?

kahing avatar Dec 13 '21 19:12 kahing

Hi @tsl0922, would you still be interested in this feature?

vaishalikumanan avatar May 03 '23 21:05 vaishalikumanan

@tsl0922 hi this patch is a bit outdated, but we are happy to do the work to update it if you want to take this

kahing avatar Jun 07 '23 17:06 kahing