Skip to content

Memory leak (71768558) #111

@Google-Autofuzz

Description

@Google-Autofuzz

Hello YAML team,

As part of our fuzzing efforts at Google, we have identified an issue affecting
YAML (tested with revision * master d050fe3).

To reproduce, we are attaching a Dockerfile which compiles the project with
LLVM, taking advantage of the sanitizers that it offers. More information about
how to use the attached Dockerfile can be found here:
https://docs.docker.com/engine/reference/builder/

TL;DR instructions:
artifacts_71768558.zip

  • mkdir project
  • cp Dockerfile.YAML /path/to/project/Dockerfile
  • docker build --no-cache /path/to/project
  • docker run -it image_id_from_docker_build

From another terminal, outside the container:
docker cp /path/to/attached/reproducer running_container_hostname:/fuzzing/reproducer
(reference: https://docs.docker.com/engine/reference/commandline/cp/)

And, back inside the container:
/fuzzing/repro.sh /fuzzing/reproducer

Alternatively, and depending on the bug, you could use gcc, valgrind or other
instrumentation tools to aid in the investigation. The sanitizer error that we
encountered is here:

INFO: Seed: 1568918539
/fuzzing/yaml_fuzzer: Running 1 inputs 1 time(s) each.
Running: /tmp/poc
Executed /tmp/poc in 2 ms

=================================================================
==11==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x4ce128 in __interceptor_malloc (/fuzzing/yaml_fuzzer+0x4ce128)
    #1 0x7f1a9c500c89 in yaml_parser_scan_plain_scalar /fuzzing/libyaml/src/scanner.c:3400:10
    #2 0x7f1a9c4eddf8 in yaml_parser_fetch_plain_scalar /fuzzing/libyaml/src/scanner.c:1903:10
    #3 0x7f1a9c4e7257 in yaml_parser_fetch_more_tokens /fuzzing/libyaml/src/scanner.c:846:14
    #4 0x7f1a9c507193 in yaml_parser_parse_node /fuzzing/libyaml/src/parser.c:582:21
    #5 0x7f1a9c50a767 in yaml_parser_parse_block_mapping_value /fuzzing/libyaml/src/parser.c:919:20
    #6 0x50dd01 in emitter_main /fuzzing/security-research-pocs/autofuzz/yaml_fuzzer.cc:2634:18
    #7 0x50e858 in LLVMFuzzerTestOneInput /fuzzing/security-research-pocs/autofuzz/yaml_fuzzer.cc:2814:13
    #8 0x51544c in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/fuzzing/yaml_fuzzer+0x51544c)
    #9 0x50e91c in main (/fuzzing/yaml_fuzzer+0x50e91c)

SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).

We will gladly work with you so you can successfully confirm and reproduce this
issue. Do let us know if you have any feedback surrounding the documentation.

Once you have reproduced the issue, we'd appreciate to learn your expected
timeline for an update to be released. With any fix, please attribute the report
to "Google Autofuzz project".

Don't hesitate to let us know if you have any questions!

Google AutoFuzz Team

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions