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
The text was updated successfully, but these errors were encountered:
…s/135) - Missing require('fs') in `server/app.js` See issue [#135](../../issues/135) - Patched read-config to mitigate vulnerability in js-yaml - issue not exploitable on webssh2 implementation - patched anyway - sending my patch upstream to read-config, webssh2 package.json points to patched version in my repository https://github.com/billchurch/nodejs-read-config - See nodeca/js-yaml#475 for more detail