r: add fuzzing targets for the R programming language - #15952
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
kevinushey is integrating a new project: |
33013fb to
d23db2c
Compare
Add R as an OSS-Fuzz project. The fuzz harnesses and build logic live in a separate repository (https://github.com/r-devel/r-oss-fuzz), cloned at build time, following the pattern used by the aspell project; projects/r/ is a thin bootstrap that checks out R and delegates the build. Targets: parse, unserialize (readRDS), grep (TRE/PCRE2), coerce, datetime, decompress (memDecompress), scan (read.table/csv), agrep.
d23db2c to
1f90391
Compare
DavidKorczynski
left a comment
There was a problem hiding this comment.
The project looks good.
However, we would like to see maintainer involvement/endorsement when integrating into OSS-Fuzz. Can you help me understand the R governance so I can validate if we have maintainer(s) onboard? I tried to look at e.g. https://www.r-project.org/contributors.html and didn't see your name (from github) there. Am not sure what the best approach here, but can you somehow assist in ensuring we have core maintainers in the project.yaml CCs list and they are happy to integrate into OSS-Fuzz?
|
Thanks David! To confirm, the work in this project is funded by an RSMF grant (https://blog.r-project.org/2025/12/17/rsmf-enabling-the-next-generation-of-contributors-to-r/), and is being overseen by Heather Turner (@hturner) and Simon Urbanek (@s-u), both members of the R Core team. I'll add them as CC's for the project, and also ask them to sign off on this PR as well. |
thank you! Once we get confirmation from them then this should be good! |
Contact structure agreed with R Core: an R Core member as primary contact, with the R-core list and the harness maintainer CCed.
Keep the initial triage volume manageable: UBSan on a codebase of R's age produces many low-severity reports (signed overflow, alignment), each carrying a 90-day disclosure clock. Add undefined once triage of the initial targets has a rhythm.
|
Thanks! We're deliberating internally to iron out who the primary contact + cc's should be -- we'll get back soon. |
|
@DavidKorczynski Thanks for your patience! We now have an e-mail alias set up for the fuzz reports, and I've updated the PR. We should now be all good to go -- @s-u can you sign off here to confirm we're ready? |
|
@DavidKorczynski sorry for the delay, we were sorting out the communication details and setting up dedicated address on our end. In my capacity as an R core developer and president of the R foundation, I am confirming this has been filed on behalf of the R project. Thanks. |
|
As Project Lead of the RSMF-funded project and an R core developer, I also confirm support for this PR. |
Adds the R programming language as a new OSS-Fuzz project.
R is one of the most widely used languages for statistics, data analysis, and
scientific computing, with a very large user base across academia and industry.
Base R is implemented largely in C, and much of that C code parses untrusted
input:
readRDS()deserialization, the regex engines, delimited-text/CSVreading, date/time parsing, and decompression are all routinely fed data from
external sources.
Fuzz targets
Eight libFuzzer harnesses, each embedding R via
Rf_initEmbeddedR():parseR_ParseVector— the lexer/parserunserializeunserialize()/readRDS— the deserializer (security-critical)grepsub()coerceas.numeric,as.complex,as.logical,type.convert)datetimestrptime/as.Date/as.POSIXct/as.POSIXltdecompressmemDecompress— R's gzip/bzip2/xz wrapper layerscanscan()— the delimited-text parser behindread.table/read.csvagrepagrep/agrepl— TRE approximate (edit-distance) matchingStructure
Following the existing
aspellproject (which clonesgnuaspell/aspell-fuzz),the harnesses and build logic are maintained in a separate repository,
r-devel/r-oss-fuzz, so the Rmaintainers can update them without a
google/oss-fuzzPR. The project here isa thin bootstrap: the
Dockerfilechecks out R (SVN trunk) and clones thatrepo, and
build.shdelegates to itsossfuzz.sh.R is built with
--enable-strict-barrier(strict GC write-barrier checking) tosurface additional memory-safety issues. A few targets set
detect_leaks=0(via
[asan]options) for known benign leaks in R internals and the bundled TREregex library; all other AddressSanitizer checks remain enabled.
Testing
python3 infra/helper.py build_fuzzersandcheck_buildpass locally under theaddressandundefinedsanitizers, and the coverage build succeeds.Primary contact: kevin@posit.co