Language: JavaScript
Label: vulnerable
CWE: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Code:
EditorUi.prototype.onKeyPress=function(a){var c=this.editor.graph;!this.isImmediateEditingEvent(a)||c.isEditing()||c.isSelectionEmpty()||0===a.which||27===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(c.escape(),c.startEditing(),mxClient.IS_FF&&(c=c.cellEditor,null!=c.textarea&&(c.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(c.textarea),a.collapse(!1),c=window.getSelection(),c.removeAllRanges(),c.addRange(a))))};