bug: IPv6 literals are not validated correctly by the resolver #1587

Open
opened 2026-03-28 01:06:52 +00:00 by nex · 2 comments
Owner

Pretty sure this forgets to strip the square brackets around the IPv6 address, causing the parser to explode:

let ip = IPAddress::parse(dest.host()).map_err(|e| {
err!(BadServerResponse(debug_error!("Failed to parse IP literal from string: {e}")))
})?;

!admin debug resolve-true-destination [2a01:4f8:1c1e:a4f6::1]

Failed to parse IP literal from string: Invalid IP [2a01:4f8:1c1e:a4f6::1]
!admin debug resolve-true-destination [2a01:4f8:1c1e:a4f6::1]:8448

Failed to parse IP literal from string: Invalid IP [2a01:4f8:1c1e:a4f6::1]
Pretty sure this forgets to strip the square brackets around the IPv6 address, causing the parser to explode: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/9209b847f69041a1c7f2de6d8d8cdd922126d3c7/src/service/resolver/actual.rs#L382-L384 ``` !admin debug resolve-true-destination [2a01:4f8:1c1e:a4f6::1] Failed to parse IP literal from string: Invalid IP [2a01:4f8:1c1e:a4f6::1] ``` ``` !admin debug resolve-true-destination [2a01:4f8:1c1e:a4f6::1]:8448 Failed to parse IP literal from string: Invalid IP [2a01:4f8:1c1e:a4f6::1] ```
Owner

Need to rip out the resolver anyway, new one fixes this.

Need to rip out the resolver anyway, [new one fixes this](https://forgejo.ellis.link/continuwuation/resolvematrix/src/branch/main/src/server.rs#L690).
Contributor

This should be fixed by #1505 (the entire actual.rs file gets nuked)

This should be fixed by #1505 (the entire actual.rs file gets nuked)
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#1587
No description provided.