Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Using complex arrays as map keys may hang the process #475
Arrays can be yaml keys. Arrays can be arbitrarily nested data structures that can reference each other. Yaml keys are serialized into strings.
As a result, we have a possibility of user creating yaml that will cause map key to grow exponentially from linearly growing input.
? - &c - &a 1 - &b 2 - &d - *a - *b : key
? - &e - &c - &a 1 - &b 2 - &d - *a - *b - &f - *c - *d : key
? - &g - &e - &c - &a 1 - &b 2 - &d - *a - *b - &f - *c - *d - &h - *e - *f : key
Which is doubling the output, with only linearly growing input... and so on. Give it 30 levels of nesting, you'll get 1GB worth of data out of 10kB input file.
relevant issue here: #169