Skip to content

Stack-overflow occured when parsing a bad json file #121

@bladchan

Description

@bladchan

Hi,

I'm playing fuzzing and I found a stack-overflow issue when parsing a bad json file

Environment: Ubuntu 18.04 + gcc 7.5.0

Poc stack_overflow.zip

Driver program:

// test.cc
#include "tao/json.hpp"
#include "tao/json/contrib/traits.hpp"

int main(int argc, char** argv){
	
	if ( argc != 2 ) return -1;
	const tao::json::value v = tao::json::from_file( argv[1] );
	return 0;
	
}

To reproduce:

  1. Compile the driver program with ASAN:
 g++ -fsanitize=address -o harness -std=c++17 -lstdc++fs
  1. Run poc:
./test ./stack_overflow.json

ASAN says:
There is too much stack information need to attach, so I save the information into a file.
asan_report.txt

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions