-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #81122: SSRF bypass in FILTER_VALIDATE_URL
We need to ensure that the password detected by parse_url() is actually a valid password; we can re-use is_userinfo_valid() for that.
- Loading branch information
1 parent
e6063db
commit 5a1fe88
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Bug #81122 (SSRF bypass in FILTER_VALIDATE_URL) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('filter')) die("skip filter extension not available"); | ||
?> | ||
--FILE-- | ||
<?php | ||
$urls = [ | ||
"https://example.com:\\@test.com/", | ||
"https://user:\\epass@test.com", | ||
"https://user:\\@test.com", | ||
]; | ||
foreach ($urls as $url) { | ||
var_dump(filter_var($url, FILTER_VALIDATE_URL)); | ||
} | ||
?> | ||
--EXPECT-- | ||
bool(false) | ||
bool(false) | ||
bool(false) |