Skip to content

Proxito: escaped HTTP headers and CF worker #11129

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

Open
humitos opened this issue Feb 20, 2024 · 4 comments
Open

Proxito: escaped HTTP headers and CF worker #11129

humitos opened this issue Feb 20, 2024 · 4 comments
Labels
Needed: design decision A core team decision is required

Comments

@humitos
Copy link
Member

humitos commented Feb 20, 2024

I'm open this issue to keep the discussion about where the HTTP header values should be escaped and how. This conversation started in #11100 (review)

There are different approach discussed there:

  1. escape HTTP values in the server and in the worker (it requires re-implementing a Python's function into JavaScript)
  2. escape HTTP values only in the server and trust them from the worker
  3. other alternatives?

The code is currently secure and safe and there is no need to change it. However, this issue will help us to discuss what path to follow.

@stsewd
Copy link
Member

stsewd commented Feb 20, 2024

We don't need to escape values twice, only in the context where they are used, the 1st option should be to escape the values in the worker only. Escaping the values twice would lead to an incorrect value.

@humitos
Copy link
Member Author

humitos commented Feb 20, 2024

We don't need to escape values twice, only in the context where they are used, the 1st option should be to escape the values in the worker only

I'm more confused now. Why we would like to put an unsafe value over the wire if it has to be escaped to be used securely anyways?

@stsewd
Copy link
Member

stsewd commented Feb 20, 2024

@humitos the value isn't unsafe by itself, it's only unsafe in the context where it's used, in this case when building the HTML by concatenating the values. If we want to use the value just a string, we want to have the original value as is <value> instead of manipulating it as &gt;value&lt;, or if we were to use that string for other purposes (in the command line, in a request, etc), it should be escaped for that context.

This is similar to why we escape the values from our search API where they are used instead of escaping them from the server.

@humitos
Copy link
Member Author

humitos commented Feb 20, 2024

Gotcha 👍🏼 . I got confused because what you are describing here solves a more broad problem -- it's a "general purpose solution", but we don't have those issues here. We just need a filename here without need to manipulate it or anything similar.

I'm happy to implement the generic approach you are describing once we need it 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

2 participants