Language: JavaScript
Label: vulnerable
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
Graph.zapGremlins=function(b){for(var e=0,g=[],p=0;p<b.length;p++){var y=b.charCodeAt(p);(32<=y||9==y||10==y||13==y)&&65535!=y&&65534!=y||(g.push(b.substring(e,p)),e=p+1)}0<e&&e<b.length&&g.push(b.substring(e));return 0==g.length?b:g.join("")};Graph.stringToBytes=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=b.charCodeAt(g);return e};Graph.bytesToString=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=String.fromCharCode(b[g]);return e.join("")};