News for hackers. Stuff that matters.
Re:Fuzzing Java in OSS-Fuzz by lucb1e on Wednesday March 10, 2021 @04:00PM (#26416174)
> fuzzing code written in memory safe languages, such as JVM-based languages, is useful for finding bugs where code behaves incorrectly or crashes. Incorrect behavior can be just as dangerous as memory corruption. For example, Jazzer was used to find CVE-2021-23899 in json-sanitizer which could be exploited for cross-site scripting (XSS). Bugs causing crashes or incorrect exceptions can sometimes be used for denial of service.

So the prime examples are denial of service and cross-site scripting. Definitely dangerous and good to apply fuzzing, but I do want to emphasize that this is a different class than all the memory corruption vulnerabilities we're seeing in C(-like) languages. Executing arbitrary code on systems in many cases is definitely worse than executing code in a browser with the privileges of the currently logged-in user. As someone working in security, it seems to me like moving away from memory-unsafe languages is long overdue by 2020---scratch that, 2021.

Re:Fuzzing Java in OSS-Fuzz by fhenneke on Wednesday March 10, 2021 @04:11PM (#26416313)
While I agree with most of what you are saying (let's hope that 2021 will finally be "the year of memory-safe languages"), remote code execution issues also affect Java. https://securitylab.github.com/research/securing-the-fight-a... is just one of the latest prominent examples.
Re:Fuzzing Java in OSS-Fuzz by lucb1e on Wednesday March 10, 2021 @04:24PM (#26416458)
Yep, for sure. One of the things we see most frequently leading to code execution is still deserialization... but it's much more rare now, so a step forwards from my point of view.
Re:Fuzzing Java in OSS-Fuzz by fhenneke on Wednesday March 10, 2021 @01:38PM (#26414480)
One of the authors of Jazzer here. Feel free to ask any questions regarding Jazzer (https://github.com/CodeIntelligenceTesting/jazzer) or how to integrate Java/JVM projects into OSS-Fuzz.
Re:Fuzzing Java in OSS-Fuzz by exdsq on Wednesday March 10, 2021 @03:25PM (#26415706)
I've been interested in applying fuzzing to some projects I work on but every time I go to do this I'm not really sure where to start. Do you have any recommended sources to learn about how to use them in practice? :)
Re:Fuzzing Java in OSS-Fuzz by fhenneke on Wednesday March 10, 2021 @03:34PM (#26415837)
That depends on the language you want to fuzz. A good general introduction and hands-on "course" for C/C++ is https://github.com/Dor1s/libfuzzer-workshop. If you prefer Java and just want to get a feeling for how concrete fuzz targets can look like, take a look at the Jazzer examples at https://github.com/CodeIntelligenceTesting/jazzer/tree/main/....
Re:Fuzzing Java in OSS-Fuzz by victor106 on Wednesday March 10, 2021 @01:49PM (#26414602)
This is awesome!!! going to explore and start using it.

Thanks for working on this.

Re:Fuzzing Java in OSS-Fuzz by saagarjha on Wednesday March 10, 2021 @05:33PM (#26417349)
Re:Fuzzing Java in OSS-Fuzz by The_rationalist on Wednesday March 10, 2021 @01:31PM (#26414383)
Another great tool is Pitest for mutation testing on the JVM (make coverage more meaningful) https://github.com/hcoles/pitest
Re:Fuzzing Java in OSS-Fuzz by spockz on Wednesday March 10, 2021 @02:00PM (#26414745)
If you want an easy way to have better mutation coverage, check out property based testing. Eg junit-quickcheck for Java.

https://github.com/pholser/junit-quickcheck

Re:Fuzzing Java in OSS-Fuzz by exdsq on Wednesday March 10, 2021 @03:26PM (#26415726)
How does property based testing relate to mutation testing, unless you just mean you'll have a larger test vector?
Re:Fuzzing Java in OSS-Fuzz by chriswarbo on Wednesday March 10, 2021 @04:23PM (#26416440)
I've found Scalacheck quite pleasant (run through Scalatest)
Re:Fuzzing Java in OSS-Fuzz by The_rationalist on Wednesday March 10, 2021 @02:55PM (#26415385)
Thanks!
Re:Fuzzing Java in OSS-Fuzz by spullara on Wednesday March 10, 2021 @03:00PM (#26415444)
I was hoping this was about fuzzing OpenJDK, but alas.
Re:Fuzzing Java in OSS-Fuzz by fhenneke on Wednesday March 10, 2021 @03:35PM (#26415854)
With minor changes to the default exclude list for coverage instrumentation, you can use Jazzer to fuzz the Java standard library (at least the parts that are implemented in Java).
Re:Fuzzing Java in OSS-Fuzz by spullara on Thursday March 11, 2021 @05:02PM (#26429587)
Was mostly thinking about things like the garbage collector, JIT, and other native code.