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: restrict custom HTTP request headers to specific URL patterns #1298

Open
sanmai-NL opened this issue Nov 14, 2023 · 2 comments
Open
Labels
enhancement New feature or request question Further information is requested request-for-comments

Comments

@sanmai-NL
Copy link

sanmai-NL commented Nov 14, 2023

Currently, the --header CLI and configuration parameter does not distinguish between target URLs. If the user were to supply a crucial secret in there, in order to make some URLs accessible during CI, then this secret would leak to all other hosts for which URLs are found.

Solution design

Rather than implementing URL/header mapping logic in Lychee, I propose to separate this concern into an, if you so choose, external tool like a proxy. If Lychee were to have proxying support, complex logic, mappings, analysis, flows, etc. can be configured through a proxy. If common use cases are documented in a how-to style within the Lychee docs, the value for the user would not be much less than with a native implementation by Lychee (one could argue, much more indeed).

@sanmai-NL sanmai-NL changed the title Security: allow restrict custom HTTP request header to specific URL patterns Security: restrict custom HTTP request headers to specific URL patterns Nov 14, 2023
@sanmai-NL
Copy link
Author

An example of a tool that could support this functionality: https://docs.mitmproxy.org/stable/overview-features/#modify-headers

@mre
Copy link
Member

mre commented Jan 29, 2024

I like the modify_headers syntax you linked to. We could add something like this.
Just to clarify, this doesn't require a proxy, but rather a way to pass these headers to reqwest, our HTTP request client, right?

@mre mre added enhancement New feature or request question Further information is requested request-for-comments 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 question Further information is requested request-for-comments
Projects
None yet
Development

No branches or pull requests

2 participants