Closed
Description
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
expands into { "1,2,1,2": "key" }
?
- &e
- &c
- &a 1
- &b 2
- &d
- *a
- *b
- &f
- *c
- *d
: key
expands into { "1,2,1,2,1,2,1,2": "key" }
?
- &g
- &e
- &c
- &a 1
- &b 2
- &d
- *a
- *b
- &f
- *c
- *d
- &h
- *e
- *f
: key
expands into { "1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2": "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