File tree Expand file tree Collapse file tree
java/ql/src/experimental/Security/CWE/CWE-295 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,10 +12,18 @@ import semmle.code.java.security.Encryption
1212import semmle.code.java.dataflow.TaintTracking
1313
1414/*
15- * This query is version specific to JXBrowser 6.x.x . The version is indirectly detected.
15+ * This query is version specific to JXBrowser < 6.24 . The version is indirectly detected.
1616 * In version 6.x.x the `Browser` class is in a different package compared to version 7.x.x.
1717 */
1818
19+ /**
20+ * Holds if a safe JXBrowser 6.x.x version is used, such as version 6.24.
21+ * This is detected by the the presence of the `addBoundsListener` in the `Browser` class.
22+ */
23+ private predicate isSafeJXBrowserVersion ( ) {
24+ exists ( Method m | m .getDeclaringType ( ) instanceof JXBrowser | m .hasName ( "addBoundsListener" ) )
25+ }
26+
1927/** The `com.teamdev.jxbrowser.chromium.Browser` class. */
2028private class JXBrowser extends RefType {
2129 JXBrowser ( ) { this .hasQualifiedName ( "com.teamdev.jxbrowser.chromium" , "Browser" ) }
@@ -69,5 +77,6 @@ private class JXBrowserTaintTracking extends TaintTracking::Configuration {
6977from JXBrowserTaintTracking cfg , DataFlow:: Node src
7078where
7179 cfg .isSource ( src ) and
72- not cfg .hasFlow ( src , _)
80+ not cfg .hasFlow ( src , _) and
81+ not isSafeJXBrowserVersion ( )
7382select src , "This JXBrowser instance allows man-in-the-middle attacks."
You can’t perform that action at this time.
0 commit comments