Skip to content

Conversation

@touchweb-vincent
Copy link
Contributor

@touchweb-vincent touchweb-vincent commented Nov 6, 2025

Hello,

I propose to extend the URL detection rule to cover IPv6 literals and SSH URLs, and apply it to both ARGS and XML collections.

Changes:

  • Added ssh scheme support.
  • Added IPv6 detection ([a-fA-F0-9:]+ within brackets).
  • Expanded target to ARGS|XML:/*.

It will improve detection of SSRF-style patterns using IPv6 or alternative protocols, and increases coverage for XML payloads.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

Copy link
Member

@EsadCetiner EsadCetiner left a comment

Choose a reason for hiding this comment

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

I haven't seen RFI attacks with brackets, do certain web apps accept URLs within brackets.

Why is this check required for IPv6 and not an optional one?

@touchweb-vincent
Copy link
Contributor Author

touchweb-vincent commented Nov 7, 2025

According to RFC 2732 later incorporated into RFC 3986 Appendix A - square brackets around IPv6 literals are mandatory within the host component of a URL.

This syntax rule exists because IPv6 addresses use colons (:), which would otherwise conflict with the colon used to denote the port (e.g., https://host:443/).

That said, if we slightly adjust the regex to ensure that there are at least two colon characters (:) in the host part - which reliably indicates an IPv6 literal - I consider the false positive risk low enough to justify making the brackets optional in the detection logic.

(?i)^(file|ftps?|https?|ssh)://(?:\[?[a-f0-9]+:[a-f0-9]*?:[a-f0-9:]+\]?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})

Copy link
Member

@EsadCetiner EsadCetiner left a comment

Choose a reason for hiding this comment

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

Good catch on the accidental matching on a domain name with a port number

Can you add a positive test for matching IPv6 with no brackets, and a negative one for not matching domain names with a port (Within the a-f 0-9 range)?

@touchweb-vincent
Copy link
Contributor Author

It seems I am tired. This can never happen - a domain name must always contain a dot, and that character is excluded from the group.

I’ve updated the regex and the unit test accordingly.

@EsadCetiner EsadCetiner changed the title feat(931100): add IP6 support / XML scan and SSH scheme. feat(931100): add IPv6 support / XML scan and SSH scheme. Nov 7, 2025
@EsadCetiner EsadCetiner added this pull request to the merge queue Nov 7, 2025
Merged via the queue into coreruleset:main with commit 4e96d22 Nov 7, 2025
7 checks passed
@touchweb-vincent touchweb-vincent deleted the patch-3 branch November 7, 2025 13:53
@fzipi fzipi added the release:new-detection In this PR we introduce a new detection label Dec 1, 2025
@fzipi fzipi mentioned this pull request Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:new-detection In this PR we introduce a new detection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants