Closed freedom1b2830 closed 1 year ago
Should be fixed by #699.
BTW. the following regex issue is found in your example. I haven't checked if it's actually problematic in the jgit
use-case, though.
== Java Exception: com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow: Regular Expression Injection
Regular expression patterns that contain unescaped untrusted input can consume
arbitrary amounts of CPU time. To properly escape the input, wrap it with
Pattern.quote(...).
at com.code_intelligence.jazzer.sanitizers.RegexInjection.hookInternal(RegexInjection.kt:151)
at com.code_intelligence.jazzer.sanitizers.RegexInjection.compileWithFlagsHook(RegexInjection.kt:55)
at org.eclipse.jgit.ignore.internal.Strings.convertGlob(Strings.java:411)
at org.eclipse.jgit.ignore.internal.WildCardMatcher.<init>(WildCardMatcher.java:31)
at org.eclipse.jgit.ignore.internal.PathMatcher.createNameMatcher0(PathMatcher.java:146)
at org.eclipse.jgit.ignore.internal.PathMatcher.createPathMatcher(PathMatcher.java:104)
at org.eclipse.jgit.attributes.AttributesRule.<init>(AttributesRule.java:122)
at org.eclipse.jgit.attributes.AttributesNode.parse(AttributesNode.java:79)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
Caused by: java.util.regex.PatternSyntaxException: Unclosed character class near index 2
\\[
^
at java.base/java.util.regex.Pattern.error(Pattern.java:2038)
at java.base/java.util.regex.Pattern.clazz(Pattern.java:2700)
at java.base/java.util.regex.Pattern.sequence(Pattern.java:2149)
at java.base/java.util.regex.Pattern.expr(Pattern.java:2079)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1793)
at java.base/java.util.regex.Pattern.<init>(Pattern.java:1440)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1105)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:731)
at com.code_intelligence.jazzer.sanitizers.RegexInjection.hookInternal(RegexInjection.kt:142)
... 9 more
BTW. the following regex issue is found in your example. I haven't checked if it's actually problematic in the
jgit
use-case, though.== Java Exception: com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow: Regular Expression Injection Regular expression patterns that contain unescaped untrusted input can consume arbitrary amounts of CPU time. To properly escape the input, wrap it with Pattern.quote(...). at com.code_intelligence.jazzer.sanitizers.RegexInjection.hookInternal(RegexInjection.kt:151) at com.code_intelligence.jazzer.sanitizers.RegexInjection.compileWithFlagsHook(RegexInjection.kt:55) at org.eclipse.jgit.ignore.internal.Strings.convertGlob(Strings.java:411) at org.eclipse.jgit.ignore.internal.WildCardMatcher.<init>(WildCardMatcher.java:31) at org.eclipse.jgit.ignore.internal.PathMatcher.createNameMatcher0(PathMatcher.java:146) at org.eclipse.jgit.ignore.internal.PathMatcher.createPathMatcher(PathMatcher.java:104) at org.eclipse.jgit.attributes.AttributesRule.<init>(AttributesRule.java:122) at org.eclipse.jgit.attributes.AttributesNode.parse(AttributesNode.java:79) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) Caused by: java.util.regex.PatternSyntaxException: Unclosed character class near index 2 \\[ ^ at java.base/java.util.regex.Pattern.error(Pattern.java:2038) at java.base/java.util.regex.Pattern.clazz(Pattern.java:2700) at java.base/java.util.regex.Pattern.sequence(Pattern.java:2149) at java.base/java.util.regex.Pattern.expr(Pattern.java:2079) at java.base/java.util.regex.Pattern.compile(Pattern.java:1793) at java.base/java.util.regex.Pattern.<init>(Pattern.java:1440) at java.base/java.util.regex.Pattern.compile(Pattern.java:1105) at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:731) at com.code_intelligence.jazzer.sanitizers.RegexInjection.hookInternal(RegexInjection.kt:142) ... 9 more
I will say more, this library has an OOM exception) Thanks for the fix, I'm waiting for the next maven release
target:
org.eclipse.jgit.attributes.AttributesNode::parse(java.io.InputStream)
os:
Linux archlinux 6.2.8-arch1-1
jazzer0.16.1
java -version