mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Address improper URL authorization
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
{
|
||||
Uri uri = Uri.parse(url);
|
||||
// BAD: partial domain match, which allows an attacker to register a domain like myexample.com to circumvent the verification
|
||||
if (uri.getHost() != null && uri.getHost().endsWith("example.com")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
{
|
||||
Uri uri = Uri.parse(url);
|
||||
// BAD: partial domain match, which allows an attacker to register a domain like myexample.com to circumvent the verification
|
||||
if (uri.getHost() != null && uri.getHost().endsWith("example.com")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Uri uri = Uri.parse(url);
|
||||
// GOOD: full domain match
|
||||
if (uri.getHost() != null && uri.getHost().endsWith(".example.com")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
Uri uri = Uri.parse(url);
|
||||
// GOOD: full domain match
|
||||
if (uri.getHost() != null && uri.getHost().endsWith(".example.com")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user