Skip to content

Spoofable extractors are used with the knowledge of the risks #2998

@yanns

Description

@yanns

The ticket follows the discussion in #2507 (comment)

Some extractors, like Host or Scheme, can use the values of some HTTP headers that could be spoofed by malicious users.

We should find a way to make users aware of the risks of using those extractors.

Some ideas:

  • using unsafe. This is not the idea of unsafe and we would be mis-using it. I think that this can be discarded.
  • encapsulating the value in a new struct like SpoofableValue so that users have to call some function to get the value. The name and the documentation of the function should make the user aware of the risk. Example:
async fn handler(Host(host): Host) -> String {
  val value = host.spoofable_value();
  value
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions