bytecodealliance / bytecodealliance/wasmtime
WASIp3 HTTP request path-and-query is more lenient than RFC 3986
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 121
Description
According to [RFC 3986 §3.3](https://www.rfc-editor.org/rfc/rfc3986#section-3.3), the following predicate should define the valid characters in a path component (besides the `/` and `?` delimiters):
```rust
fn is_valid_path_char(ch: char) -> bool {
// pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
ch.is_ascii_alphanumeric() || "-._~".contains(ch) // unreserved
|| ch == '%' // pct-encoded
|| "!$&'()*+,;=".contains(ch) // sub-delims
|| ":@".contains(ch)
}
```
However, the following paths are accepted via `request.set_path_and_query`:
* `/"`
* `/{`
* `/|`
* `/}`
* `/^`
* `/[`
* `/]`
* `/\`
* `/#`
What should change here, the spec or Wasmtime?
Relatedly, Wasmtime accepts non-absolute paths, which I am not sure are valid; https://github.com/WebAssembly/WASI/issues/791#issuecomment-3359974132.
Contributor guide
Assessment
This issue has not been assessed yet.