File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
java/ql/lib/semmle/code/java/security Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,21 @@ module ResponseSplittingLocalConfig implements DataFlow::ConfigSig {
1313 predicate isSink ( DataFlow:: Node sink ) { sink instanceof HeaderSplittingSink }
1414
1515 predicate isBarrier ( DataFlow:: Node node ) {
16- node .getType ( ) instanceof PrimitiveType or
16+ node .getType ( ) instanceof PrimitiveType
17+ or
1718 node .getType ( ) instanceof BoxedType
19+ or
20+ exists ( MethodAccess ma , string methodName , CompileTimeConstantExpr target |
21+ node .asExpr ( ) = ma and
22+ ma .getMethod ( ) .hasQualifiedName ( "java.lang" , "String" , methodName ) and
23+ target = ma .getArgument ( 0 ) and
24+ (
25+ methodName = "replace" and target .getIntValue ( ) = [ 10 , 13 ] // 10 == "\n", 13 == "\r"
26+ or
27+ methodName = "replaceAll" and
28+ target .getStringValue ( ) .regexpMatch ( ".*([\n\r]|\\[\\^[^\\]\r\n]*\\]).*" )
29+ )
30+ )
1831 }
1932}
2033
You can’t perform that action at this time.
0 commit comments