Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
L
libxml2
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 69
    • Issues 69
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • libxml2
  • Issues
  • #197

Closed
Open
Opened Oct 22, 2020 by Robert Sebastian Herlim@Ngiong

Missing -maxmem Sanity Check on parseAndPrintFile

Hello,

We are currently working on a new fuzz testing feature, and we found a crash in xmllint.

Step to Reproduce

We configured and built zlib using CFLAGS="-g -O0 -fPIC" ./configure --static and make

and configured xmllint using CFLAGS="-g -O0" ./configure --with-zlib=${ZLIB_PATH} and built using make,

and run it with:

./xmllint -maxmem 0 --push --nofixup-base-uris <attached_file> --insert --repeat --memory

Attachment: poc_0003.txt

Environment

  • OS: Ubuntu 18.04.4 LTS
  • Compiler: gcc 7.5.0
  • libxml2 version: 2.9.10 (ftp://xmlsoft.org/libxml2/libxml2-sources-2.9.10.tar.gz)
  • zlib version: 1.2.11 (https://www.zlib.net/zlib-1.2.11.tar.xz)

Additional context

It seems that the current behavior of xmllint does not sanity check the -maxmem 0 flag.

Here's the stack trace: stack_trace_0003.txt

Program received signal SIGSEGV, Segmentation fault.
0x0000000000409765 in parseAndPrintFile ()
#0  0x0000000000409765 in parseAndPrintFile ()
#1  0x0000000000412531 in main ()

Thank you.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/libxml2#197