Repository navigation
Add PotentiallyUnguardedProtocolHandler query for Java and C++ - #32
Merged
Merged
Conversation
|
|
||
| public void bad1(HttpServletRequest request) throws IOException, URISyntaxException { | ||
| String url = request.getParameter("url"); | ||
| Desktop.getDesktop().browse(new URI(url)); |
Check warning
Code scanning / CodeQL
URL redirection from remote source
| String url = request.getParameter("url"); | ||
| URI uri = new URI(url); | ||
| if (uri.getScheme().equals("https") || uri.getScheme().equals("http")) { | ||
| Desktop.getDesktop().browse(uri); |
Check warning
Code scanning / CodeQL
URL redirection from remote source
|
|
||
| // Weak check - only checks if scheme exists, not what it is | ||
| if (uri.getScheme() != null) { | ||
| Desktop.getDesktop().browse(uri); |
Check warning
Code scanning / CodeQL
URL redirection from remote source
| public void bad6_rundll32(HttpServletRequest request) throws IOException { | ||
| String url = request.getParameter("url"); | ||
| // ProcessBuilder with list | ||
| ProcessBuilder pb = new ProcessBuilder("rundll32", "url.dll,FileProtocolHandler", url); |
Check failure
Code scanning / CodeQL
Uncontrolled command line
ex0dus-0x
force-pushed
the
alan/untrusted-protocol-handle
branch
from
January 2, 2026 17:49
c3d12d8 to
3275b0d
Compare
ex0dus-0x
marked this pull request as ready for review
January 8, 2026 14:29
GrosQuildu
reviewed
Feb 12, 2026
ex0dus-0x
force-pushed
the
alan/untrusted-protocol-handle
branch
from
April 6, 2026 18:00
29a9a76 to
e0d42d1
Compare
Restrict scheme guards to successful HTTP and HTTPS validation. Model composed C++ commands and Java Runtime and ProcessBuilder calls. Add focused positive and negative tests plus query help.
Require recognized handlers to be the executable rather than a later argument. Add decoy-command regression tests, align Java expectations with CI, and remove duplicate documentation and newline churn.
GrosQuildu
approved these changes
Nov 10, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This a multi-language query that attempts to model CVE-2022-43550 for desktop apps that employ protocol handling on untrusted URLs through a variety of mechanisms. If no sanitization/guards are introduced, then links with arbitrary protocols (eg.
smb://andsome-custom-vuln-handler://) can be supplied to trigger unintended actions against a user that clicks.Languages and frameworks supported:
rundll32 url.dll,FileProtocolHandler,xdg-openandopenfor their respective platformsQDesktopServices::openUrlDesktop.browse()