Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ All notable changes to OriginWeave are documented in this file. The format follo

### Security

- Explicit proxy server identifiers require ASCII decimal port tokens before numeric range parsing, preventing Rust-specific leading-plus spellings from widening proxy authority.
- Raw page content cannot become a trusted instruction.
- Raw secrets are rejected and secret-capable actions require an opaque broker handle.
- Crawler mode is read-only, must pair with the public-crawl purpose, and fails closed without an applicable robots-policy decision.
Expand Down
3 changes: 3 additions & 0 deletions crates/originweave-destination/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ fn explicit_port(authority: &str) -> Result<Option<u16>, ProxyServerError> {
port
};
Comment on lines 446 to 447

@devin-ai-integration devin-ai-integration Bot Aug 24, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Bracketless IPv6 still routed through host:port split

A scheme-less bare IPv6 literal such as 2001:db8::1 takes the non-bracket branch, where rsplit_once(':') treats the trailing segment as a port. The new digit check does not affect this pre-existing path; downstream Origin::parse of https://{authority} (proxy.rs) generally rejects such authorities. Out of scope here, noted only because the port path was touched.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


if !port_text.bytes().all(|byte| byte.is_ascii_digit()) {
return Err(ProxyServerError::InvalidIdentifier);
}
let port = port_text
.parse::<u16>()
.map_err(|_error| ProxyServerError::InvalidIdentifier)?;
Expand Down
29 changes: 29 additions & 0 deletions crates/originweave-destination/tests/proxy_port_syntax.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use originweave_destination::{ProxyServer, ProxyServerError};

#[test]
fn proxy_server_rejects_non_digit_port_prefixes() {
for input in [
"proxy.example:+8080",
"http://proxy.example:+8080",
"https://proxy.example:+8443",
"socks5://proxy.example:+1080",
"https://[2001:db8::1]:+8443",
] {
assert_eq!(
ProxyServer::parse(input),
Err(ProxyServerError::InvalidIdentifier),
"input={input}",
);
}
}

#[test]
fn proxy_server_rejects_decimal_ports_outside_u16_range() {
for input in ["proxy.example:65536", "https://[2001:db8::1]:65536"] {
assert_eq!(
ProxyServer::parse(input),
Err(ProxyServerError::InvalidIdentifier),
"input={input}",
);
}
}
Loading