fix: harden security, protocol, and resource boundaries#73
Merged
Conversation
Address the full security/standards review: enable cookie public-suffix rejection, cap transparent decompression, inject HTTP forward-proxy URL credentials, bound connections/H2 streams/pool lifetime, tighten redirect and response-status retry defaults, and document the new behavior.
Pass strict_host_header into bridge normalization from the WebSocket handshake path (feature was untested locally without --all-features), and apply cargo fmt so the CI gate is green.
Replace Option match ladders with ? so CI clippy 1.97 -D warnings passes.
Use ? for the optional EXPIRES header so clippy 1.97 -D warnings is clean.
Use LevelFilter::TRACE so RUST_LOG cannot suppress debug events, match trace messages more permissively, and surface captured messages when retry/redirect events are missing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the full security / standards review findings for OpenWire:
Security
Jarembeds Mozilla PSL and rejectsDomain=.com-style cookies (RFC 6265 §5.3); honorsSecuremax_decompressed_body_bytes)http://user:pass@proxyinjectsProxy-Authorizationon the initial request (parity with CONNECT/SOCKS)strict_host_header(true)rejects Host ≠ URI authorityX-Api-Key,X-Auth-Token, and related token headersCorrectness / protocol
retry_non_idempotent(true)to restore old behavior)max_retries(request/client config), not only the default-policy fielddeflateauto-detects zlib-wrapped vs raw DEFLATEPerformance / resources
MemoryCacheStoredefaults: 1024 keys / 64 MiB body budget; normalized cache keys (host case + default ports)Test plan
cargo test -p openwire --libcargo test -p openwire --test integrationcargo test -p openwire-cache --tests