Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security: don't print provided HTTP header value as part of help info #1297

Open
sanmai-NL opened this issue Nov 14, 2023 · 3 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@sanmai-NL
Copy link

Printing the actual provided HTTP request header is not needed to help the user. But it does add an information leak in logs. I think that a custom header in most applications of Lychee in practice, would contain sensitive values.

Actual behavior

$ read gitlabtoken
read> glpat-SECRET
$ lychee --header "PRIVATE-TOKEN=$gitlabtoken" https://gitlab.com/mysecretproject
Error: Header value must be of the form key=value, got PRIVATE-TOKEN: glpat-SECRET

Desired behavior

$ read gitlabtoken
read> glpat-SECRET
$ lychee --header "PRIVATE-TOKEN=$gitlabtoken" https://gitlab.com/mysecretproject
Error: Header value must be of the form key=value.
@sanmai-NL
Copy link
Author

Note that in the previous example, the secret token is provided on the command line, rather than read as a secret. This also a security antipattern, since it leaks secrets to the shell logs. An additional enhancement would be to allow header specification in a file (not a configuration file, useful to be shareable and with non-sensitive content).

@sanmai-NL
Copy link
Author

sanmai-NL commented Nov 14, 2023

Given #1298, this issue could be quick-fixed by keeping the current functionality intact but warning in the docs and UI that this parameter should never be used for secrets and for values that are host specific.

Alternatively, if that explicit feature scope seems too limiting, the feature could be deprecated in favor of the solution for #1298.

@mre
Copy link
Member

mre commented Jan 29, 2024

I like it.

We should also add #1298, but we can discuss that over there.

@mre mre added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants