Skip to content

Commit 6d69e09

Browse files
committed
Fix SSRF bypass via specific local address URLs - two new cases
1 parent 7f5201a commit 6d69e09

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This file includes only changes we consider noteworthy for users, admins and plu
1717
- Fix support for untyped tokens in OIDC backchannel logout, require unset `nonce` (#10097)
1818
- Security: Fix various vulnerabilities in the password plugin using session-injected username
1919
- Security: Fix stored XSS via unescaped attachment MIME type on the attachment-validation warning page [CVE-2026-54432]
20+
- Security: Fix SSRF bypass via specific local address URLs - two new cases
2021

2122
## Release 1.7.1
2223

program/lib/Roundcube/rcube_utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ public static function is_local_url($url)
437437
$host = trim($host, '[]');
438438

439439
// IPLib does not seem to work with IPv6 syntax for IPv4 addresses
440-
$host = preg_replace('/^::ffff:/i', '', $host);
440+
$host = preg_replace('/^[0:]*:ffff:/i', '', $host);
441441

442-
if (preg_match('/([0-9a-f.-]+)\.nip\.io$/i', $host, $matches)) {
442+
if (preg_match('/([0-9a-f.-]+)\.(nip|sslip)\.io$/i', $host, $matches)) {
443443
$host = trim($matches[1], '-.');
444444
}
445445

tests/Framework/UtilsTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,9 @@ public static function provide_is_local_url_cases(): iterable
726726
['http://[::ffff:127.0.0.1]:8080', true],
727727
['http://127.0.0.1.nip.io', true],
728728
['http://metadata.google.internal', true],
729+
['http://127.0.0.1.sslip.io/', true],
730+
['http://[0:0:0:0:0:ffff:127.0.0.1]/', true],
731+
['http://0/', true],
729732
// Non-local hosts
730733
['http://[2001:470::76:0:0:0:2]', false],
731734
['http://domain.tld', false],

0 commit comments

Comments
 (0)