code
stringlengths 12
2.05k
| label
int64 0
1
| programming_language
stringclasses 9
values | cwe_id
stringlengths 6
14
| cwe_name
stringlengths 5
103
⌀ | description
stringlengths 36
1.23k
⌀ | url
stringlengths 36
48
⌀ | label_name
stringclasses 2
values |
---|---|---|---|---|---|---|---|
"margin-left":"18px","white-space":"normal"});f.append(g);f.append(e);return f},u=function(a){a=a||"true";null!==a&&"false"==a&&m()},n=function(b){var c=new w(b),b="wscLang"+a.dialog.getParentEditor().name,b=document.getElementById(b),d=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(c.setLangList,a.dialog.getParentEditor().name);v[c.getCurrentLangGroup(a.selectingLang)]();u(a.show_grammar);b.onchange=function(){v[c.getCurrentLangGroup(this.value)]();u(a.show_grammar);a.div_overlay.setEnable();
a.selectingLang=this.value;e.postMessage.send({message:{changeLang:a.selectingLang,text:a.dataTemp},target:a.targetFromFrame[d],id:"selectionLang_outer__page"})}},A=function(b){if("no_any_suggestions"==b){b="No suggestions";a.LocalizationButton.ChangeTo.instance.disable();a.LocalizationButton.ChangeAll.instance.disable();var c=function(b){b=a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c("ChangeTo");c("ChangeAll")}else a.LocalizationButton.ChangeTo.instance.enable(),
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
this.complete = function (result) {
if (resultsBuffer.length) {
socket.emit('result', resultsBuffer)
resultsBuffer = []
}
socket.emit('complete', result || {})
if (this.config.clearContext) {
navigateContextTo('about:blank')
} else {
self.updater.updateTestStatus('complete')
}
if (returnUrl) {
if (!/^https?:\/\//.test(returnUrl)) {
throw new Error(
'Security: Navigation to '.concat(
returnUrl,
' was blocked to prevent malicious exploits.'
)
)
}
location.href = returnUrl
}
}
| 0 |
JavaScript
|
CWE-601
|
URL Redirection to Untrusted Site ('Open Redirect')
|
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.
|
https://cwe.mitre.org/data/definitions/601.html
|
vulnerable
|
null,this.container)}));q.appendChild(m);m.className="geBtn gePrimaryBtn";b.editor.cancelFirst||q.appendChild(g);if(null!=l)for(d=0;d<l.length;d++)(function(x,y,A){x=mxUtils.button(x,function(B){y(B)});null!=A&&x.setAttribute("title",A);x.className="geBtn";q.appendChild(x)})(l[d][0],l[d][1],l[d][2]);p.appendChild(q);this.cancelBtn=g;this.okButton=m;this.container=p},TemplatesDialog=function(b,e,f,c,m,n,v,d,g,k,l,p,q,x,y){function A(ha){Fa.innerHTML=mxUtils.htmlEntities(ha);Fa.style.display="block";
setTimeout(function(){Fa.style.display="none"},4E3)}function B(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",u=X,X=null)}function I(ha,da,ca,la,ia,ma,qa){if(-1<ha.className.indexOf("geTempDlgRadioBtnActive"))return!1;ha.className+=" geTempDlgRadioBtnActive";M.querySelector(".geTempDlgRadioBtn[data-id="+la+"]").className="geTempDlgRadioBtn "+(qa?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");M.querySelector("."+da).src="/images/"+ca+"-sel.svg";M.querySelector("."+ia).src=
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
DOMPurify.removeHooks = function (entryPoint) {
if (hooks[entryPoint]) {
hooks[entryPoint] = [];
}
};
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
name: $themeRow.find( '.theme-title strong' ).text()
} )
);
}
$themeRow.remove();
// Remove theme from update count.
if ( $themeRow.hasClass( 'update' ) ) {
totals.upgrade--;
wp.updates.decrementCount( 'theme' );
}
// Remove from views.
if ( $themeRow.hasClass( 'inactive' ) ) {
totals.disabled--;
if ( totals.disabled ) {
$views.find( '.disabled .count' ).text( '(' + totals.disabled + ')' );
} else {
$views.find( '.disabled' ).remove();
}
}
// There is always at least one theme available.
$views.find( '.all .count' ).text( '(' + --totals.all + ')' );
} );
| 1 |
JavaScript
|
CWE-352
|
Cross-Site Request Forgery (CSRF)
|
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
|
https://cwe.mitre.org/data/definitions/352.html
|
safe
|
D.charAt(0)&&(D=unescape(window.atob?atob(D):Base64.decode(cont,D))),null!=D&&"%"==D.charAt(0)&&(D=decodeURIComponent(D)),null!=D&&0<D.length)){var K=mxUtils.parseXml(D).documentElement;return"mxfile"==K.nodeName||"mxGraphModel"==K.nodeName}}catch(T){}return!1};Editor.prototype.extractGraphModel=function(u,D,K){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
content: Buffer.from(str).toString('base64')
}
}
};
shared.resolveContent(mail.data, 'html', function (err, value) {
expect(err).to.not.exist;
expect(value).to.deep.equal(Buffer.from(str));
done();
});
});
| 1 |
JavaScript
|
CWE-88
|
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
|
The software constructs a string for a command to executed by a separate component
in another control sphere, but it does not properly delimit the
intended arguments, options, or switches within that command string.
|
https://cwe.mitre.org/data/definitions/88.html
|
safe
|
afterrender: function () {
Ext.get(this.getIframe()).on('load', function () {
this.iFrameLoaded();
}.bind(this));
}.bind(this)
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
makeDroppable = function() {
var targets = cwd.find('.directory:not(.'+clDroppable+',.elfinder-na,.elfinder-ro)');
if (fm.isCommandEnabled('paste')) {
targets.droppable(droppable);
}
if (fm.isCommandEnabled('upload')) {
targets.addClass('native-droppable');
}
},
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
l.isRemoteFileFormat(B,d.name)?l.isOffline()?l.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):l.parseFileData(B,mxUtils.bind(this,function(I){4==I.readyState&&(200<=I.status&&299>=I.status?g(I.responseText):k())}),d.name):k()}):A||k()}},function(q){k(q)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?p():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",p))};EditorUi.prototype.importFile=function(d,g,k,l,p,q,x,y,A,B,I,O){B=null!=
B?B:!0;var t=!1,z=null,L=mxUtils.bind(this,function(C){var E=null;null!=C&&"<mxlibrary"==C.substring(0,10)?this.loadLibrary(new LocalLibrary(this,C,x)):E=this.importXml(C,k,l,B,null,null!=O?mxEvent.isControlDown(O):null);null!=y&&y(E)});"image"==g.substring(0,5)?(A=!1,"image/png"==g.substring(0,9)&&(g=I?null:this.extractGraphModelFromPng(d),null!=g&&0<g.length&&(z=this.importXml(g,k,l,B,null,null!=O?mxEvent.isControlDown(O):null),A=!0)),A||(g=this.editor.graph,A=d.indexOf(";"),0<A&&(d=d.substring(0,
A)+d.substring(d.indexOf(",",A+1))),B&&g.isGridEnabled()&&(k=g.snap(k),l=g.snap(l)),z=[g.insertVertex(null,null,"",k,l,p,q,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+d+";")])):/(\.*<graphml )/.test(d)?(t=!0,this.importGraphML(d,L)):null!=A&&null!=x&&(/(\.v(dx|sdx?))($|\?)/i.test(x)||/(\.vs(x|sx?))($|\?)/i.test(x))?(t=!0,this.importVisio(A,L)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,x)?this.isOffline()?
| 1 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
safe
|
function nextChannel(self) {
// get the next available channel number
// fast path
if (self._curChan < MAX_CHANNEL)
return ++self._curChan;
// slower lookup path
for (var i = 0, channels = self._channels; i < MAX_CHANNEL; ++i)
if (!channels[i])
return i;
return false;
}
| 0 |
JavaScript
|
CWE-78
|
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
|
The software 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.
|
https://cwe.mitre.org/data/definitions/78.html
|
vulnerable
|
G&&(D.filename=G.getTitle());D.pagecount=null!=d.pages?d.pages.length:1;D.page=null!=d.currentPage?d.currentPage.getName():"";D.pagenumber=null!=d.pages&&null!=d.currentPage?mxUtils.indexOf(d.pages,d.currentPage)+1:1;return D};var O=g.getGlobalVariable;g.getGlobalVariable=function(D){var G=d.getCurrentFile();return"filename"==D&&null!=G?G.getTitle():"page"==D&&null!=d.currentPage?d.currentPage.getName():"pagenumber"==D?null!=d.currentPage&&null!=d.pages?mxUtils.indexOf(d.pages,d.currentPage)+1:1:
"pagecount"==D?null!=d.pages?d.pages.length:1:O.apply(this,arguments)};var t=g.labelLinkClicked;g.labelLinkClicked=function(D,G,P){var K=G.getAttribute("href");if(null==K||!g.isCustomLink(K)||!mxEvent.isTouchEvent(P)&&mxEvent.isPopupTrigger(P))t.apply(this,arguments);else{if(!g.isEnabled()||null!=D&&g.isCellLocked(D.cell))g.customLinkClicked(K),g.getRubberband().reset();mxEvent.consume(P)}};this.editor.getOrCreateFilename=function(){var D=d.defaultFilename,G=d.getCurrentFile();null!=G&&(D=null!=G.getTitle()?
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
var P=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"#000",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),J=new Editor,F=null,H=null,S=null,V=!1,M=[],W=null,U=null;this.getSelectedItem=function(){null!=H&&n(H);return H};if(null==y("#mxODPickerCss")){var X=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");X.appendChild(u);u.type="text/css";u.id="mxODPickerCss";u.appendChild(document.createTextNode(G))}b.innerHTML=
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
{clone:function(){var a=new CKEDITOR.dom.range(this.root);a.startContainer=this.startContainer;a.startOffset=this.startOffset;a.endContainer=this.endContainer;a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){if(a){this.endContainer=this.startContainer;this.endOffset=this.startOffset}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset}this.collapsed=true},cloneContents:function(){var a=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
function sendReplies() {
while (unsentGlobalRequestsReplies.length > 0
&& unsentGlobalRequestsReplies[0].type) {
const reply = unsentGlobalRequestsReplies.shift();
if (reply.type === 'SUCCESS')
proto.requestSuccess(reply.buf);
if (reply.type === 'FAILURE')
proto.requestFailure();
}
}
| 1 |
JavaScript
|
CWE-78
|
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
|
The software 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.
|
https://cwe.mitre.org/data/definitions/78.html
|
safe
|
function showUploadProgress(group, adapter, percent) {
let text = '';
let opened;
if (adapter || typeof group === 'string') {
if (adapter) {
// text += '<div class="adapter-upload-progress" data-adapter-name="' + adapter + '"';
} else {
text += '<div class="group-upload-progress"';
}
//text += ' data-adapter-group="' + group + '" style="position: absolute; width: 100%; height: 100%; opacity: ' + (percent ? 0.7 : 0) + '; top: 0; left: 0">';
opened = true;
} else {
percent = group;
group = null;
}
//percent = 80;
if (percent) {
text +=
'<table style="height: 3px; " title="' + _('Upload') + ' ' + percent + '%" class="no-space" style="width:100%; height: 100%; opacity: 0.7">' +
'<tr style="height: 100%" class="no-space">' +
'<td class="no-space" style="width:' + percent + '%;background: blue"></td>' +
'<td style="width:' + (100 - percent) + '%;opacity: 0.1" class="no-space"></td>' +
'</tr>' +
'</table>'
;
}
//text += percent ? '<table title="' + _('Upload') + ' ' + percent + '%" class="no-space" style="width:100%; height: 100%; opacity: 0.7"><tr style="height: 100%" class="no-space"><td class="no-space" style="width:' + percent + '%;background: blue"></td><td style="width:' + (100 - percent) + '%;opacity: 0.1" class="no-space"></td></tr></table>' : '';
if (opened) {
//text += '</div>';
}
return text;
}
| 1 |
JavaScript
|
CWE-22
|
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
|
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
|
https://cwe.mitre.org/data/definitions/22.html
|
safe
|
1?0:Ua.y*ia);this.shape.bounds.height=ma.height-(Ta==Ma.length-1?0:(Ua.height+Ua.y)*ia)}this.shape.redraw()}};var Ya=!1;za.setPosition=function(Ua,eb,jb){La=Math.max(Graph.minTableColumnWidth-Ea.width,eb.x-Ua.x-Ea.width);Ya=mxEvent.isShiftDown(jb.getEvent());null==Da||Ya||(La=Math.min(La,Da.width-Graph.minTableColumnWidth))};za.execute=function(Ua){if(0!=La)T.setTableColumnWidth(this.state.cell,La,Ya);else if(!M.blockDelayedSelection){var eb=T.getCellAt(Ua.getGraphX(),Ua.getGraphY())||ma.cell;T.graphHandler.selectCellForEvent(eb,
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
this.spacing=0}function Ca(){mxArrowConnector.call(this);this.spacing=0}function Ra(){mxActor.call(this)}function ab(){mxRectangleShape.call(this)}function Ka(){mxActor.call(this)}function bb(){mxActor.call(this)}function Pa(){mxActor.call(this)}function Za(){mxActor.call(this)}function z(){mxActor.call(this)}function L(){mxActor.call(this)}function M(){mxActor.call(this)}function T(){mxActor.call(this)}function ca(){mxActor.call(this)}function ia(){mxActor.call(this)}function ma(){mxEllipse.call(this)}
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
function isLiteral(ast) {
return ast.body.length === 0 ||
ast.body.length === 1 && (
ast.body[0].expression.type === AST.Literal ||
ast.body[0].expression.type === AST.ArrayExpression ||
ast.body[0].expression.type === AST.ObjectExpression);
}
| 0 |
JavaScript
|
CWE-74
|
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
|
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/74.html
|
vulnerable
|
!0);V.init()}))})})}));d.actions.put("liveImage",new Action("Live image...",function(){var n=d.getCurrentFile();null!=n&&d.spinner.spin(document.body,mxResources.get("loading"))&&d.getPublicUrl(d.getCurrentFile(),function(y){d.spinner.stop();null!=y?(y=new EmbedDialog(d,'<img src="'+(n.constructor!=DriveFile?y:"https://drive.google.com/uc?id="+n.getId())+'"/>'),d.showDialog(y.container,450,240,!0,!0),y.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})}));d.actions.put("embedImage",
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
node: $('<span/>')
.attr({title: fm.i18n('autoSync')})
.on('click', function(e){
e.stopPropagation();
e.preventDefault();
node.parent()
.toggleClass('ui-state-disabled', fm.options.syncStart)
.parent().removeClass('ui-state-hover');
fm.options.syncStart = !fm.options.syncStart;
fm.autoSync(fm.options.syncStart? null : 'stop');
})
};
node = self.extra.node;
node.ready(function(){
setTimeout(function(){
node.parent().toggleClass('ui-state-disabled', !fm.options.syncStart).css('pointer-events', 'auto');
}, 10);
});
}
});
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
WebUtil.createCookie = function(name,value,days) {
var date, expires, secure;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
} else {
expires = "";
}
if (document.location.protocol === "https:") {
secure = "; secure";
} else {
secure = "";
}
document.cookie = name+"="+value+expires+"; path=/"+secure;
};
| 1 |
JavaScript
|
CWE-310
|
Cryptographic Issues
|
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.
|
https://cwe.mitre.org/data/definitions/310.html
|
safe
|
function(C){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=C?C:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),
this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&
(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.window.setVisible(!1),this.menus.findReplaceWindow.window.destroy(),this.menus.findReplaceWindow=null);B.apply(this,arguments)};var I=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(C){I.apply(this,arguments);if(C){var D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
slug: $( this ).data( 'slug' )
}
};
target.postMessage( JSON.stringify( install ), window.location.origin );
} );
/**
* Handles postMessage events.
*
* @since 4.2.0
* @since 4.6.0 Switched `update-plugin` action to use the queue.
*
* @param {Event} event Event interface.
*/
$( window ).on( 'message', function( event ) {
var originalEvent = event.originalEvent,
expectedOrigin = document.location.protocol + '//' + document.location.hostname,
message;
if ( originalEvent.origin !== expectedOrigin ) {
return;
}
message = $.parseJSON( originalEvent.data );
if ( 'undefined' === typeof message.action ) {
return;
}
switch ( message.action ) {
// Called from `wp-admin/includes/class-wp-upgrader-skins.php`.
case 'decrementUpdateCount':
/** @property {string} message.upgradeType */
wp.updates.decrementCount( message.upgradeType );
break;
case 'install-plugin':
case 'update-plugin':
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
window.tb_remove();
/* jscs:enable */
message.data = wp.updates._addCallbacks( message.data, message.action );
wp.updates.queue.push( message );
wp.updates.queueChecker();
break;
}
} );
/**
* Adds a callback to display a warning before leaving the page.
*
* @since 4.2.0
*/
$( window ).on( 'beforeunload', wp.updates.beforeunload );
} );
| 1 |
JavaScript
|
CWE-352
|
Cross-Site Request Forgery (CSRF)
|
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
|
https://cwe.mitre.org/data/definitions/352.html
|
safe
|
!mxClient.IS_IE11)&&this.addMenuItems(Q,["toggleDarkMode"],W);Q.addSeparator(W)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(Q,W){B.menus.addMenuItems(Q,"importText plantUml mermaid - formatSql importCsv - createShape editDiagram".split(" "),W)})));mxUtils.bind(this,function(){var Q=this.get("insert"),W=Q.funct;Q.funct=function(V,X){"1"==urlParams.sketch?(B.insertTemplateEnabled&&!B.isOffline()&&B.menus.addMenuItems(V,["insertTemplate"],X),B.menus.addMenuItems(V,["insertImage",
"insertLink","-"],X),B.menus.addSubmenu("insertLayout",V,X,mxResources.get("layout")),B.menus.addSubmenu("insertAdvanced",V,X,mxResources.get("advanced"))):(W.apply(this,arguments),B.menus.addSubmenu("table",V,X))}})();var S="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),U=function(Q,W,V,X){Q.addItem(V,null,mxUtils.bind(this,function(){var p=new CreateGraphDialog(B,V,X);B.showDialog(p.container,620,420,!0,!1);p.init()}),W)};this.put("insertLayout",
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
member: function(left, right, computed) {
if (computed) return this.computedMember(left, right);
return this.nonComputedMember(left, right);
},
| 1 |
JavaScript
|
CWE-74
|
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
|
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/74.html
|
safe
|
body: function(section) {
return this.state[section].body.join('');
},
| 0 |
JavaScript
|
CWE-74
|
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
|
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/74.html
|
vulnerable
|
index:K,defVal:ja.defVal,countProperty:ja.countProperty,size:ja.size},0==K%2,ja.flipBkg),D.parentNode.insertBefore(Ha,D.nextSibling),D=Ha;u.appendChild(va);qa();return u};StyleFormatPanel.prototype.addStyles=function(u){function D(ja){mxEvent.addListener(ja,"mouseenter",function(){ja.style.opacity="1"});mxEvent.addListener(ja,"mouseleave",function(){ja.style.opacity="0.5"})}var K=this.editorUi,T=K.editor.graph,N=document.createElement("div");N.style.whiteSpace="nowrap";N.style.paddingLeft="24px";
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
CKEDITOR.dialog.add("checkspell",function(a){function c(a,c){var d=0;return function(){"function"==typeof window.doSpell?("undefined"!=typeof e&&window.clearInterval(e),j(a)):180==d++&&window._cancelOnError(c)}}function j(c){var f=new window._SP_FCK_LangCompare,b=CKEDITOR.getUrl(a.plugins.wsc.path+"dialogs/"),e=b+"tmpFrameset.html";window.gFCKPluginName="wsc";f.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:g,lang:a.config.wsc_lang||f.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
var doSynchronize = function(requisition, rescanExisting) {
RequisitionsService.startTiming();
RequisitionsService.synchronizeRequisition(requisition.foreignSource, rescanExisting).then(
function() { // success
growl.success('The import operation has been started for ' + requisition.foreignSource + ' (rescanExisting? ' + rescanExisting + ')<br/>Use <b>refresh</b> to update the deployed statistics');
requisition.setDeployed(true);
},
errorHandler
);
};
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
module: app.getModuleName(),
action: 'Fields',
mode: 'validateFile',
fieldName: fieldInfo['name'],
base64: evt.target.result
})
.done((data) => {
if (data.result.validate) {
aDeferred.resolve(evt.target.result);
} else {
aDeferred.reject(data.result.validateError);
}
})
.fail(function () {
aDeferred.reject();
});
};
| 1 |
JavaScript
|
CWE-434
|
Unrestricted Upload of File with Dangerous Type
|
The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.
|
https://cwe.mitre.org/data/definitions/434.html
|
safe
|
this.cwd = function() {
return files[cwd] || {};
}
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
this.customFonts)))}finally{U.getModel().endUpdate()}}}));this.editorUi.showDialog(W.container,380,Editor.enableWebFonts?250:180,!0,!0);W.init()}),y,null,!0)})))}})();function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=p.focusIndex}))}},hbox:function(a,b,c,e,d){if(!(4>arguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.widths||null,i=d&&d.height||null,l,k={role:"presentation"};d&&d.align&&(k.align=d.align);CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"hbox"},e,"table",{},k,function(){var a=['<tbody><tr class="cke_dialog_ui_hbox">'];for(l=0;l<c.length;l++){var b="cke_dialog_ui_hbox_child",e=[];0===
l&&(b="cke_dialog_ui_hbox_first");l==c.length-1&&(b="cke_dialog_ui_hbox_last");a.push('<td class="',b,'" role="presentation" ');f?f[l]&&e.push("width:"+r(f[l])):e.push("width:"+Math.floor(100/c.length)+"%");i&&e.push("height:"+r(i));d&&void 0!=d.padding&&e.push("padding:"+r(d.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&g[l].align)&&e.push("text-align:"+g[l].align);0<e.length&&a.push('style="'+e.join("; ")+'" ');a.push(">",c[l],"</td>")}a.push("</tr></tbody>");return a.join("")})}},vbox:function(a,
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
function build (enabled) {
if (enabled) {
return {
storage: SemVerStore,
deriveVersion: function (req, ctx) {
return req.headers['accept-version']
}
}
}
return {
storage: SemVerStore,
deriveVersion: function (req, ctx) {},
disabled: true
}
}
| 1 |
JavaScript
|
CWE-444
|
Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
|
The product acts as an intermediary HTTP agent
(such as a proxy or firewall) in the data flow between two
entities such as a client and server, but it does not
interpret malformed HTTP requests or responses in ways that
are consistent with how the messages will be processed by
those entities that are at the ultimate destination.
|
https://cwe.mitre.org/data/definitions/444.html
|
safe
|
summary[tagId] = {'textValue': _.escape(tag.textValue),
'id': tag.id,
'canRemove': false,
'canRemoveCount': 0,
'links': [],
'addedBy': []
};
}
// Add link to list...
var l = tag.link;
// slice parent class 'ProjectI' > 'Project'
l.parent.class = l.parent.class.slice(0, -1);
summary[tagId].links.push(l);
// ...and summarise other properties on the tag
if (l.permissions.canDelete) {
summary[tagId].canRemoveCount += 1;
}
summary[tagId].canRemove = summary[tagId].canRemove || l.permissions.canDelete;
if (summary[tagId].addedBy.indexOf(linkOwner) === -1) {
summary[tagId].addedBy.push(linkOwner);
}
});
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
text: Ext.util.Format.htmlEncode(nodeName),
path: nodeData.path,
name: nodeData.name,
nodeRecord: newNodeRecord,
account_grants: nodeData.account_grants,
id: nodeData.id
});
newNode.attributes.nodeRecord.beginEdit();
newNode.attributes.nodeRecord.set('path', nodeData.path);
newNode.attributes.nodeRecord.endEdit();
newNode.parentNode = target;
return newNode;
},
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
var set = function set(obj, path, val) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var internalPath = path,
objPart;
options = _objectSpread({
"transformRead": returnWhatWasGiven,
"transformKey": returnWhatWasGiven,
"transformWrite": returnWhatWasGiven
}, options); // No object data
if (obj === undefined || obj === null) {
return;
} // No path string
if (!internalPath) {
return;
}
internalPath = clean(internalPath); // Path is not a string, throw error
if (typeof internalPath !== "string") {
throw new Error("Path argument must be a string");
}
if ((0, _typeof2["default"])(obj) !== "object") {
return;
} // Path has no dot-notation, set key/value
if (isNonCompositePath(internalPath)) {
obj = decouple(obj, options);
obj[options.transformKey(unEscape(internalPath))] = val;
return obj;
}
var newObj = decouple(obj, options);
var pathParts = split(internalPath);
var pathPart = pathParts.shift();
var transformedPathPart = options.transformKey(pathPart);
var childPart = newObj[transformedPathPart];
if ((0, _typeof2["default"])(childPart) !== "object") {
// Create an object or array on the path
if (String(parseInt(transformedPathPart, 10)) === transformedPathPart) {
// This is an array index
newObj[transformedPathPart] = [];
} else {
newObj[transformedPathPart] = {};
}
objPart = newObj[transformedPathPart];
} else {
objPart = childPart;
}
return set(newObj, transformedPathPart, set(objPart, pathParts.join('.'), val, options), options);
};
| 0 |
JavaScript
|
CWE-915
|
Improperly Controlled Modification of Dynamically-Determined Object Attributes
|
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
|
https://cwe.mitre.org/data/definitions/915.html
|
vulnerable
|
function fa(e) {function c(a,c,b) {var d,e=this.w,f,g;for(g=0;g<a;)switch(d=Z(this,c),d) {case 16:for(f=3+J(this,2);f--;)b[g++]=e;break;case 17:for(f=3+J(this,3);f--;)b[g++]=0;e=0;break;case 18:for(f=11+J(this,7);f--;)b[g++]=0;e=0;break;default:e=b[g++]=d}this.w=e;return b}var d=J(e,5)+257,b=J(e,5)+1,a=J(e,4)+4,f=new (u?Uint8Array:Array)(L.length),g,k,m,p;for(p=0;p<a;++p)f[L[p]]=J(e,3);if (!u) {p=a;for(a=f.length;p<a;++p)f[L[p]]=0}g=D(f);k=new (u?Uint8Array:Array)(d);m=new (u?Uint8Array:Array)(b);e.w=
| 1 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
safe
|
$scope.initialize = function(customHandler) {
var value = $cookies.get('requisitions_page_size');
if (value) {
$scope.pageSize = value;
}
growl.success('Retrieving requisition ' + $scope.foreignSource + '...');
RequisitionsService.getRequisition($scope.foreignSource).then(
function(requisition) { // success
$scope.requisition = requisition;
$scope.filteredNodes = requisition.nodes;
$scope.updateFilteredNodes();
if (customHandler) {
customHandler();
}
},
$scope.errorHandler
);
};
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
c.nodeName&&(v=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{q.endUpdate()}null!=v&&this.chromelessResize&&this.chromelessResize(!0,v)}return g};EditorUi.prototype.getCopyFilename=function(c,e){var g=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var k=g.lastIndexOf(".");0<=k&&(c=g.substring(k),g=g.substring(0,k));if(e){e=g;var m=new Date;g=m.getFullYear();k=m.getMonth()+1;var q=m.getDate(),v=m.getHours(),x=m.getMinutes();m=m.getSeconds();
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
shortcuts = function() {
var sh = fm.shortcuts();
// shortcuts tab
html.push('<div id="shortcuts" class="ui-tabs-panel ui-widget-content ui-corner-bottom">');
if (sh.length) {
html.push('<div class="ui-widget-content elfinder-help-shortcuts">');
$.each(sh, function(i, s) {
html.push(stpl.replace(/\{pattern\}/, s[0]).replace(/\{descrip\}/, s[1]));
});
html.push('</div>');
} else {
html.push('<div class="elfinder-help-disabled">'+fm.i18n('shortcutsof')+'</div>');
}
html.push('</div>');
},
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
function dialog_ajax(a,b,c,d,e,f,g,h){b="undefined"==typeof b||!1===b?alert("You send an invalid url"):b;d="undefined"==typeof d||!1===d?"POST":d;e="undefined"==typeof e||!1===e?"JSON":e;h="undefined"==typeof h||!1===h?$("document.body"):h;a="undefined"==typeof a||!1===a?set_popup_title():a;c._cat_ajax=1;$.ajax({type:d,url:b,dataType:e,context:h,data:c,beforeSend:function(b){$(".fc_popup").remove();b.process=set_activity(a);"undefined"!=typeof f&&!1!==f&&f.call(this)},success:function(a,b,c){return_success(c.process,
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
r=g.isEventsEnabled();g.setEventsEnabled(!1);var q=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.cellRenderer.redraw,x=g.states;a=g.scale;if(this.clipping){var A=new mxRectangle((f.x+t.x)*a,(f.y+t.y)*a,f.width*a/p,f.height*a/p),E=this;this.graph.cellRenderer.redraw=function(D,B,v){if(null!=D){var y=x.get(D.cell);if(null!=y&&(y=g.getBoundingBox(y,!1),null!=y&&0<y.width&&0<y.height&&!mxUtils.intersects(A,y))||!E.isCellVisible(D.cell))return}u.apply(this,
arguments)}}a=null;try{var C=[this.getRoot()];a=new mxTemporaryCellStates(g,c,C,null,mxUtils.bind(this,function(D){return this.getLinkForCellState(D)}))}finally{if(mxClient.IS_IE)g.overlayPane.innerHTML="",g.canvas.style.overflow="hidden",g.canvas.style.position="relative",g.canvas.style.top=this.marginTop+"px",g.canvas.style.width=f.width+"px",g.canvas.style.height=f.height+"px";else for(c=e.firstChild;null!=c;)C=c.nextSibling,b=c.nodeName.toLowerCase(),"svg"==b?(c.style.overflow="hidden",c.style.position=
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
message: new MockBuilder(
{
from: 'test@valid.sender',
to: 'test@valid.recipient'
},
message
)
},
function (err) {
expect(err).to.not.exist;
pool.close();
done();
}
);
});
| 1 |
JavaScript
|
CWE-88
|
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
|
The software constructs a string for a command to executed by a separate component
in another control sphere, but it does not properly delimit the
intended arguments, options, or switches within that command string.
|
https://cwe.mitre.org/data/definitions/88.html
|
safe
|
D=K}return D};Graph.prototype.getCellsById=function(u){var D=[];if(null!=u)for(var K=0;K<u.length;K++)if("*"==u[K]){var T=this.model.getRoot();D=D.concat(this.model.filterDescendants(function(Q){return Q!=T},T))}else{var N=this.model.getCell(u[K]);null!=N&&D.push(N)}return D};var S=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(u){return S.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(u))};Graph.prototype.isAllTagsHidden=function(u){if(null==u||0==u.length||
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
this.destroy = function() {
if (node && node[0].elfinder) {
this.options.syncStart = false;
this.autoSync('stop');
this.trigger('destroy').disable();
clipboard = [];
selected = [];
listeners = {};
shortcuts = {};
$(window).off('.' + namespace);
$(document).add(node).off('.' + namespace);
self.trigger = function() { }
beeper.remove();
node.children().remove();
node.off();
node.append(prevContent.contents()).removeClass(this.cssClass).attr('style', prevStyle);
node[0].elfinder = null;
}
};
| 1 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
safe
|
title: 'Synchronize Requisition ' + _.escape(requisition.foreignSource),
buttons: {
fullSync: {
label: 'Yes',
className: 'btn-primary',
callback: function() {
doSynchronize(requisition, 'true');
}
},
dbOnlySync: {
label: 'DB Only',
className: 'btn-secondary',
callback: function() {
doSynchronize(requisition, 'dbonly');
}
},
ignoreExistingSync: {
label: 'No',
className: 'btn-secondary',
callback: function() {
doSynchronize(requisition, 'false');
}
},
main: {
label: 'Cancel',
className: 'btn-secondary'
}
}
});
}
| 1 |
JavaScript
|
CWE-352
|
Cross-Site Request Forgery (CSRF)
|
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
|
https://cwe.mitre.org/data/definitions/352.html
|
safe
|
function modeNum(mode) {
// eslint-disable-next-line no-self-compare
if (typeof mode === 'number' && mode === mode) // Valid, non-NaN number
return mode;
if (typeof mode === 'string')
return modeNum(parseInt(mode, 8));
throw new Error(`Cannot parse mode: ${mode}`);
}
| 1 |
JavaScript
|
CWE-78
|
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
|
The software 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.
|
https://cwe.mitre.org/data/definitions/78.html
|
safe
|
this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,e,g){try{null!=navigator.clipboard&&this.spinner.spin(document.body,mxResources.get("exporting"))&&
this.editor.exportToCanvas(mxUtils.bind(this,function(k,m){try{this.spinner.stop();var q=this.createImageDataUri(k,e,"png"),v=parseInt(m.getAttribute("width")),x=parseInt(m.getAttribute("height"));this.writeImageToClipboard(q,v,x,mxUtils.bind(this,function(A){this.handleError(A)}))}catch(A){this.handleError(A)}}),null,null,null,mxUtils.bind(this,function(k){this.spinner.stop();this.handleError(k)}),null,null,null!=g?g:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,
null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(k){this.handleError(k)}};EditorUi.prototype.writeImageToClipboard=function(c,e,g,k){var m=this.base64ToBlob(c.substring(c.indexOf(",")+1),"image/png");c=new ClipboardItem({"image/png":m,"text/html":new Blob(['<img src="'+c+'" width="'+e+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([c])["catch"](k)};EditorUi.prototype.copyCells=function(c,e){var g=this.editor.graph;if(g.isSelectionEmpty())c.innerHTML="";else{var k=
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0<window.location.search.length){var g="?",m;for(m in urlParams)0>mxUtils.indexOf(d,m)&&null!=urlParams[m]&&(f+=g+m+"="+urlParams[m],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var f=0<d.indexOf("?")?1:0;if("1"==urlParams.offline)d+=window.location.search;else{var g="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
null!=this.linkHint&&(this.linkHint.style.visibility="")};var Za=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Za.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(c,l,x){mxShape.call(this);this.line=c;this.stroke=l;this.strokewidth=null!=x?x:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function k(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function t(){mxActor.call(this)}function F(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function f(){mxCylinder.call(this)}function g(){mxCylinder.call(this)}function m(){mxShape.call(this)}function q(){mxShape.call(this)}
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
exports.slug = function(str) {
return str
.toLowerCase()
.replace(/ +/g, '-')
.replace(/[^-\w]/g, '');
};
| 1 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
safe
|
y.y,n.width/K,n.height/K,"fillColor=none;strokeColor=red;")}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var n=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";n=new TextareaDialog(d,"Paste Data:",n,function(y){if(0<y.length)try{var K=function(J){function E(I){if(null==C[I]){if(C[I]=!0,null!=U[I]){for(;0<U[I].length;){var T=U[I].pop();E(T)}delete U[I]}}else mxLog.debug(H+": Visited: "+I)}var H=J.parentNode.id,S=J.childNodes;J={};
for(var U={},Q=null,W={},V=0;V<S.length;V++){var X=S[V];if(null!=X.id&&0<X.id.length)if(null==J[X.id]){J[X.id]=X.id;var p=X.getAttribute("parent");null==p?null!=Q?mxLog.debug(H+": Multiple roots: "+X.id):Q=X.id:(null==U[p]&&(U[p]=[]),U[p].push(X.id))}else W[X.id]=X.id}S=Object.keys(W);0<S.length?(S=H+": "+S.length+" Duplicates: "+S.join(", "),mxLog.debug(S+" (see console)")):mxLog.debug(H+": Checked");var C={};null==Q?mxLog.debug(H+": No root"):(E(Q),Object.keys(C).length!=Object.keys(J).length&&
(mxLog.debug(H+": Invalid tree: (see console)"),console.log(H+": Invalid tree",U)))};"<"!=y.charAt(0)&&(y=Graph.decompress(y),mxLog.debug("See console for uncompressed XML"),console.log("xml",y));var B=mxUtils.parseXml(y),F=d.getPagesForNode(B.documentElement,"mxGraphModel");if(null!=F&&0<F.length)try{var G=d.getHashValueForPages(F);mxLog.debug("Checksum: ",G)}catch(J){mxLog.debug("Error: ",J.message)}else mxLog.debug("No pages found for checksum");var N=B.getElementsByTagName("root");for(y=0;y<N.length;y++)K(N[y]);
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
function isObject(value) {
// http://jsperf.com/isobject4
return value !== null && typeof value === 'object';
}
| 0 |
JavaScript
|
CWE-74
|
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
|
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/74.html
|
vulnerable
|
cancel = function() {
var close = function() {
dfrd.reject();
ta.elfinderdialog('close');
};
ta.editor && ta.editor.save(ta[0], ta.editor.instance);
if (rtrim(old) !== rtrim(ta.val())) {
old = ta.val();
fm.confirm({
title : self.title,
text : 'confirmNotSave',
accept : {
label : 'btnSaveClose',
callback : function() {
save();
close();
}
},
cancel : {
label : 'btnClose',
callback : close
}
});
} else {
close();
}
},
| 1 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
safe
|
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to remove the node ' + _.escape(node.nodeLabel) + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteNode(node).then(
function() { // success
var index = -1;
for(var i = 0; i < $scope.filteredNodes.length; i++) {
if ($scope.filteredNodes[i].foreignId === node.foreignId) {
index = i;
}
}
if (index > -1) {
$scope.filteredNodes.splice(index,1);
}
growl.success('The node ' + _.escape(node.nodeLabel) + ' has been deleted.');
},
$scope.errorHandler
);
}
});
};
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
function onPayload(payload) {
// XXX: move this to the Decipher implementations?
this._onPacket();
if (payload.length === 0) {
this._debug && this._debug('Inbound: Skipping empty packet payload');
return;
}
payload = this._packetRW.read.read(payload);
const type = payload[0];
if (type === MESSAGE.USERAUTH_SUCCESS
&& !this._server
&& !this._authenticated) {
this._authenticated = true;
if (this._kex.negotiated.cs.compress === 'zlib@openssh.com')
this._packetRW.write = new ZlibPacketWriter(this);
if (this._kex.negotiated.sc.compress === 'zlib@openssh.com')
this._packetRW.read = new ZlibPacketReader();
}
const handler = MESSAGE_HANDLERS[type];
if (handler === undefined) {
this._debug && this._debug(`Inbound: Unsupported message type: ${type}`);
return;
}
return handler(this, payload);
}
| 1 |
JavaScript
|
CWE-78
|
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
|
The software 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.
|
https://cwe.mitre.org/data/definitions/78.html
|
safe
|
c&&this.setValue(e,a.lang.format["tag_"+e]);return}this.setValue("")},this)},onOpen:function(){this.showAll();for(var b in d)a.activeFilter.check(d[b])||this.hideItem(b)},refresh:function(){var b=a.elementPath();if(b){if(b.isContextFor("p"))for(var c in d)if(a.activeFilter.check(d[c]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}});CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div";CKEDITOR.config.format_p={element:"p"};CKEDITOR.config.format_div={element:"div"};
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function Y(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
d[c]=e,"o"===b[1]&&Y(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||Y(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Fa(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&F(a,a,"sZeroRecords","sLoadingRecords");
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
function isPrototypePolluted() {
const s = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
let notPolluted = true;
let st = '';
notPolluted = notPolluted || !(s.length === 62)
const ms = Date.now();
if (typeof ms === 'number' && ms > 1600000000000) {
const l = ms % 100 + 15;
let c = 0;
for (let i = 0; i < l; i++) {
const r = Math.random() * 61.99999999 + 1;
const rs = parseInt(Math.floor(r).toString(), 10)
const rs2 = parseInt(r.toString().split('.')[0], 10);
const q = Math.random() * 61.99999999 + 1;
const qs = parseInt(Math.floor(q).toString(), 10)
const qs2 = parseInt(q.toString().split('.')[0], 10);
notPolluted = notPolluted && !(r === q);
notPolluted = notPolluted && rs === rs2 && qs === qs2;
st += s[rs - 1];
}
notPolluted = notPolluted && st.length === l;
// string manipulation
let p = Math.random() * l * 0.9999999999;
let stm = st.substr(0, p) + ' ' + st.substr(p, 2000);
let sto = stm.replace(/ /g, '');
notPolluted = notPolluted && st === sto;
p = Math.random() * l * 0.9999999999;
stm = st.substr(0, p) + '{' + st.substr(p, 2000);
sto = stm.replace(/{/g, '');
notPolluted = notPolluted && st === sto;
p = Math.random() * l * 0.9999999999;
stm = st.substr(0, p) + '*' + st.substr(p, 2000);
sto = stm.replace(/\*/g, '');
notPolluted = notPolluted && st === sto;
p = Math.random() * l * 0.9999999999;
stm = st.substr(0, p) + '$' + st.substr(p, 2000);
sto = stm.replace(/\$/g, '');
notPolluted = notPolluted && st === sto;
// lower
const stl = st.toLowerCase();
notPolluted = notPolluted && (stl.length === l) && stl[l - 1] && !(stl[l])
for (let i = 0; i < l; i++) {
const s1 = st[i];
const s2 = stl[i];
const s1l = s1.toLowerCase();
notPolluted = notPolluted && s1l[0] === s2 && s1l[0] && !(s1l[1]);
}
}
return !notPolluted;
}
| 1 |
JavaScript
|
CWE-78
|
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
|
The software 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.
|
https://cwe.mitre.org/data/definitions/78.html
|
safe
|
j,!0)}function o(a,c,d){if(!m(c))return c.size=null;if(c.size){if(c.size.ignoreScroll==d&&c.size.date>new Date-ba)return null}else c.size={};return q(c.size,P(a,c,d),{date:+new Date},!0)}function C(a,c){a.view.editable=P(a,a.editable,c,!0)}function I(a,c){a.view||(a.view={});var d=a.view;if(c||!(d&&d.date>new Date-ba)){var b=a.win,d=b.getScrollPosition(),b=b.getViewPaneSize();q(a.view,{scroll:{x:d.x,y:d.y,width:a.doc.$.documentElement.scrollWidth-b.width,height:a.doc.$.documentElement.scrollHeight-
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
function(a){if(a.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var b=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")),this.document);if(a.data("cke-resizable")){var c=a.getStyle("width"),a=a.getStyle("height");c&&b.setAttribute("width",g(b.getAttribute("width"),c));a&&b.setAttribute("height",g(b.getAttribute("height"),a))}return b}})();CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function b(b){return d.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var a="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",d=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+a+"padding-%1:18px;cursor:auto;}"+(CKEDITOR.plugins.link.synAnchorSelector?
"a.cke_anchor_empty{display:inline-block;"+(CKEDITOR.env.ie&&10<CKEDITOR.env.version?"min-height:16px;vertical-align:middle":"")+"}":"")+".%2 img.cke_anchor{"+a+"width:16px;min-height:15px;height:1.15em;vertical-align:"+(CKEDITOR.env.opera?"middle":"text-bottom")+";}";CKEDITOR.addCss(b("ltr")+b("rtl"))},init:function(b){var a="a[!href]";CKEDITOR.dialog.isTabEnabled(b,"link","advanced")&&(a=a.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));CKEDITOR.dialog.isTabEnabled(b,
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
this.spacing=0}function Ca(){mxArrowConnector.call(this);this.spacing=0}function Ra(){mxActor.call(this)}function ab(){mxRectangleShape.call(this)}function Ka(){mxActor.call(this)}function bb(){mxActor.call(this)}function Pa(){mxActor.call(this)}function Za(){mxActor.call(this)}function z(){mxActor.call(this)}function L(){mxActor.call(this)}function M(){mxActor.call(this)}function T(){mxActor.call(this)}function ca(){mxActor.call(this)}function ia(){mxActor.call(this)}function ma(){mxEllipse.call(this)}
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
function(y){this.spinner.stop();this.handleError(y)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,v,null,1<x,A,k,q,m);x=this.isServices(x)?4<x?390:280:160;this.showDialog(c.container,420,x,!0,!0);c.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,e,g,k,m,q){};EditorUi.prototype.pickFolder=function(c,
e,g){e(null)};EditorUi.prototype.exportSvg=function(c,e,g,k,m,q,v,x,A,z,L,M,n,y){if(this.spinner.spin(document.body,mxResources.get("export")))try{var K=this.editor.graph.isSelectionEmpty();g=null!=g?g:K;var B=e?null:this.editor.graph.background;B==mxConstants.NONE&&(B=null);null==B&&0==e&&(B=L?this.editor.graph.defaultPageBackgroundColor:"#ffffff");var F=this.editor.graph.getSvg(B,c,v,x,null,g,null,null,"blank"==z?"_blank":"self"==z?"_top":null,null,!n,L,M);k&&this.editor.graph.addSvgShadow(F);var G=
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
wp.updates.decrementCount = function( upgradeType ) {
var count,
pluginCount,
$adminBarUpdateCount = $( '#wp-admin-bar-updates .ab-label' ),
$dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
$pluginsMenuItem = $( '#menu-plugins' );
count = $adminBarUpdateCount.text();
count = parseInt( count, 10 ) - 1;
if ( count < 0 || isNaN( count ) ) {
return;
}
$( '#wp-admin-bar-updates .ab-item' ).removeAttr( 'title' );
$adminBarUpdateCount.text( count );
$dashboardNavMenuUpdateCount.each( function( index, elem ) {
elem.className = elem.className.replace( /count-\d+/, 'count-' + count );
} );
$dashboardNavMenuUpdateCount.removeAttr( 'title' );
$dashboardNavMenuUpdateCount.find( '.update-count' ).text( count );
if ( 'plugin' === upgradeType ) {
pluginCount = $pluginsMenuItem.find( '.plugin-count' ).eq(0).text();
pluginCount = parseInt( pluginCount, 10 ) - 1;
if ( pluginCount < 0 || isNaN( pluginCount ) ) {
return;
}
$pluginsMenuItem.find( '.plugin-count' ).text( pluginCount );
$pluginsMenuItem.find( '.update-plugins' ).each( function( index, elem ) {
elem.className = elem.className.replace( /count-\d+/, 'count-' + pluginCount );
} );
if (pluginCount > 0 ) {
$( '.subsubsub .upgrade .count' ).text( '(' + pluginCount + ')' );
} else {
$( '.subsubsub .upgrade' ).remove();
}
}
};
| 0 |
JavaScript
|
CWE-352
|
Cross-Site Request Forgery (CSRF)
|
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
|
https://cwe.mitre.org/data/definitions/352.html
|
vulnerable
|
main.resubscribeStates = function () {
for (var pattern in main.subscribesStates) {
if (main.subscribesStates.hasOwnProperty(pattern) && main.subscribesStates[pattern]) {
console.debug('Re-Subscribe: ' + pattern);
main.socket.emit('subscribe', pattern);
}
}
};
| 0 |
JavaScript
|
CWE-22
|
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
|
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
|
https://cwe.mitre.org/data/definitions/22.html
|
vulnerable
|
q):mxscript("js/extensions.min.js",q))};EditorUi.prototype.generatePlantUmlImage=function(c,e,g,k){function m(x,A,z){c1=x>>2;c2=(x&3)<<4|A>>4;c3=(A&15)<<2|z>>6;c4=z&63;r="";r+=q(c1&63);r+=q(c2&63);r+=q(c3&63);return r+=q(c4&63)}function q(x){if(10>x)return String.fromCharCode(48+x);x-=10;if(26>x)return String.fromCharCode(65+x);x-=26;if(26>x)return String.fromCharCode(97+x);x-=26;return 0==x?"-":1==x?"_":"?"}var v=new XMLHttpRequest;v.open("GET",("txt"==e?PLANT_URL+"/txt/":"png"==e?PLANT_URL+"/png/":
PLANT_URL+"/svg/")+function(x){r="";for(i=0;i<x.length;i+=3)r=i+2==x.length?r+m(x.charCodeAt(i),x.charCodeAt(i+1),0):i+1==x.length?r+m(x.charCodeAt(i),0,0):r+m(x.charCodeAt(i),x.charCodeAt(i+1),x.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=e&&(v.responseType="blob");v.onload=function(x){if(200<=this.status&&300>this.status)if("txt"==e)g(this.response);else{var A=new FileReader;A.readAsDataURL(this.response);A.onloadend=function(z){var L=new Image;L.onload=
function(){try{var M=L.width,n=L.height;if(0==M&&0==n){var y=A.result,K=y.indexOf(","),B=decodeURIComponent(escape(atob(y.substring(K+1)))),F=mxUtils.parseXml(B).getElementsByTagName("svg");0<F.length&&(M=parseFloat(F[0].getAttribute("width")),n=parseFloat(F[0].getAttribute("height")))}g(A.result,M,n)}catch(G){k(G)}};L.src=A.result};A.onerror=function(z){k(z)}}else k(x)};v.onerror=function(x){k(x)};v.send()};EditorUi.prototype.insertAsPreText=function(c,e,g){var k=this.editor.graph,m=null;k.getModel().beginUpdate();
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
var deepKeys = module.exports.deepKeys = function deepKeys(object, options, prefix) {
options = options || {};
if (typeof prefix === "undefined") {
prefix = [];
}
var keys = [];
for (var k in object) {
if (!Object.hasOwnProperty.call(object, k)) {
continue;
}
if (!options.leavesOnly || typeof object[k] !== "object") {
keys.push(prefix.concat([k]));
}
if (typeof object[k] === "object" && object[k] !== null) {
keys = keys.concat(deepKeys(object[k], {leavesOnly: options.leavesOnly}, prefix.concat([k])));
}
}
if (options.asStrings) {
keys = keys.map(function(e) { return e.join("."); });
}
return keys;
};
| 0 |
JavaScript
|
NVD-CWE-Other
|
Other
|
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
|
https://nvd.nist.gov/vuln/categories
|
vulnerable
|
Editor.prototype.absoluteCssFonts=function(u){var E=null;if(null!=u){var J=u.split("url(");if(0<J.length){E=[J[0]];u=window.location.pathname;var T=null!=u?u.lastIndexOf("/"):-1;0<=T&&(u=u.substring(0,T+1));T=document.getElementsByTagName("base");var N=null;null!=T&&0<T.length&&(N=T[0].getAttribute("href"));for(var Q=1;Q<J.length;Q++)if(T=J[Q].indexOf(")"),0<T){var R=Editor.trimCssUrl(J[Q].substring(0,T));this.graph.isRelativeUrl(R)&&(R=null!=N?N+R:window.location.protocol+"//"+window.location.hostname+
("/"==R.charAt(0)?"":u)+R);E.push('url("'+R+'"'+J[Q].substring(T))}else E.push(J[Q])}else E=[u]}return null!=E?E.join(""):null};Editor.prototype.mapFontUrl=function(u,E,J){/^https?:\/\//.test(E)&&!this.isCorsEnabledForUrl(E)&&(E=PROXY_URL+"?url="+encodeURIComponent(E));J(u,E)};Editor.prototype.embedCssFonts=function(u,E){var J=u.split("url("),T=0;null==this.cachedFonts&&(this.cachedFonts={});var N=mxUtils.bind(this,function(){if(0==T){for(var ba=[J[0]],ea=1;ea<J.length;ea++){var Z=J[ea].indexOf(")");
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
asn1.fromDer = function(bytes, options) {
if(options === undefined) {
options = {
strict: true,
decodeBitStrings: true
};
}
if(typeof options === 'boolean') {
options = {
strict: options,
decodeBitStrings: true
};
}
if(!('strict' in options)) {
options.strict = true;
}
if(!('decodeBitStrings' in options)) {
options.decodeBitStrings = true;
}
// wrap in buffer if needed
if(typeof bytes === 'string') {
bytes = forge.util.createBuffer(bytes);
}
return _fromDer(bytes, bytes.length(), 0, options);
};
| 0 |
JavaScript
|
CWE-347
|
Improper Verification of Cryptographic Signature
|
The software does not verify, or incorrectly verifies, the cryptographic signature for data.
|
https://cwe.mitre.org/data/definitions/347.html
|
vulnerable
|
regExDate: function (str, p1, p2, offset, s) {
var date = str.substring(1).replace('"', '');
if (date.substring(0, 7) == "\\\/Date(") {
var d = date.match(/Date\((.*?)\)/)[1];
return "new Date(" + parseInt(d) + ")";
}
else { // ISO Date 2007-12-31T23:59:59Z
var matches = date.split(/[-,:,T,Z]/);
if (matches.length == 7) {
matches[1] = (parseInt(matches[1], 0) - 1).toString();
var isDate = true;
var s = "";
for (var i = 0; i < matches.length; i++) {
if (isNaN(parseInt(matches[i], 10))) {
isDate = false;
break;
}
if (i > 0) {
s += ",";
}
s += parseInt(matches[i], 10);
}
if (isDate) {
return "new Date(Date.UTC(" + s + "))";
}
}
}
return str;
},
| 0 |
JavaScript
|
CWE-502
|
Deserialization of Untrusted Data
|
The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
|
https://cwe.mitre.org/data/definitions/502.html
|
vulnerable
|
generate_mail_credentials = function() {
var div = $('.mail-infoblock').clone();
div.find('#mail_configuration').remove();
var pass=div.find('#v_password').text();
if (pass=="") div.find('#v_password').text(' ');
var output = div.text();
output=output.replace(/(?:\r\n|\r|\n|\t)/g, "|");
output=output.replace(/ /g, "");
output=output.replace(/\|\|/g, "|");
output=output.replace(/\|\|/g, "|");
output=output.replace(/\|\|/g, "|");
output=output.replace(/^\|+/g, "");
output=output.replace(/\|$/, "");
output=output.replace(/ $/, "");
output=output.replace(/:\|/g, ": ");
output=output.replace(/\|/g, "\n");
//console.log(output);
$('#v_credentials').val(output);
}
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
Number(L.value),[f[n]])}}finally{l.getModel().endUpdate()}});M.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",function(n){13==n.keyCode&&M.click()});t=document.createElement("div");t.style.marginTop="20px";t.style.textAlign="right";b.editor.cancelFirst?(t.appendChild(d),t.appendChild(M)):(t.appendChild(M),t.appendChild(d));u.appendChild(t);this.container=u},LibraryDialog=function(b,f,l,d,u,t){function D(F){for(F=document.elementFromPoint(F.clientX,F.clientY);null!=F&&F.parentNode!=
v;)F=F.parentNode;var G=null;if(null!=F){var N=v.firstChild;for(G=0;null!=N&&N!=F;)N=N.nextSibling,G++}return G}function c(F,G,N,J,E,H,S,U,Q){try{if(b.spinner.stop(),null==G||"image/"==G.substring(0,6))if(null==F&&null!=S||null==A[F]){var W=function(){O.innerHTML="";O.style.cursor="pointer";O.style.whiteSpace="nowrap";O.style.textOverflow="ellipsis";mxUtils.write(O,null!=R.title&&0<R.title.length?R.title:mxResources.get("untitled"));O.style.color=null==R.title||0==R.title.length?"#d0d0d0":""};v.style.backgroundImage=
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
S&&S(La)}};za.onerror=function(wa){null!=S&&S(wa)};za.src=ua}else L()}catch(wa){null!=S&&S(wa)}});Za.onerror=function(L){null!=S&&S(L)};Aa&&this.graph.addSvgShadow(Pa);this.graph.mathEnabled&&this.addMathCss(Pa);var z=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Pa,this.resolvedFontCss),Za.src=Editor.createSvgDataUri(mxUtils.getXml(Pa))}catch(L){null!=S&&S(L)}});this.embedExtFonts(mxUtils.bind(this,function(L){try{null!=L&&this.addFontCss(Pa,L),this.loadFonts(z)}catch(M){null!=
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
function sharingGroupPopulateOrganisations() {
$('input[id=SharingGroupOrganisations]').val(JSON.stringify(organisations));
$('.orgRow').remove();
var id = 0;
var html = '';
organisations.forEach(function(org) {
html = '<tr id="orgRow' + id + '" class="orgRow">';
html += '<td class="short">' + org.type + ' </td>';
html += '<td>' + org.name + ' </td>';
html += '<td>' + org.uuid + ' </td>';
html += '<td class="short" style="text-align:center;">';
if (org.removable == 1) {
html += '<input id="orgExtend' + id + '" type="checkbox" onClick="sharingGroupExtendOrg(' + id + ')" ';
if (org.extend) html+= 'checked';
html += '></input>';
} else {
html += '<span class="icon-ok"></span>'
}
html +='</td>';
html += '<td class="actions short">';
if (org.removable == 1) html += '<span class="icon-trash" onClick="sharingGroupRemoveOrganisation(' + id + ')"></span>';
html += ' </td></tr>';
$('#organisations_table tr:last').after(html);
id++;
});
}
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
function isFile(obj) {
return toString.call(obj) === '[object File]';
}
| 0 |
JavaScript
|
CWE-74
|
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
|
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/74.html
|
vulnerable
|
$scope.add = function() {
bootbox.prompt('Please enter the name for the new requisition', function(foreignSource) {
if (foreignSource) {
// Validate Requisition
if (foreignSource.match(/[/\\?:&*'"]/)) {
bootbox.alert('Cannot add the requisition ' + foreignSource + ' because the following characters are invalid:<br/>:, /, \\, ?, &, *, \', "');
return;
}
var r = $scope.requisitionsData.getRequisition(foreignSource);
if (r) {
bootbox.alert('Cannot add the requisition ' + foreignSource+ ' because there is already a requisition with that name');
return;
}
// Create Requisition
RequisitionsService.addRequisition(foreignSource).then(
function(r) { // success
growl.success('The requisition ' + r.foreignSource + ' has been created.');
},
$scope.errorHandler
);
}
});
};
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
"should return false": function (res) {
assert.isFalse(res);
},
| 1 |
JavaScript
|
NVD-CWE-Other
|
Other
|
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
|
https://nvd.nist.gov/vuln/categories
|
safe
|
embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},H=/\s*(?:;\s*|$)/,w=/#\((.+?)\)/g,K=CKEDITOR.dom.walker.bookmark(0,1),C=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){var c=a.attributes;if(c&&c.style){a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style));delete c.style}if(b){a=CKEDITOR.tools.clone(a);p(a.attributes,b);p(a.styles,b)}c=this.element=a.element?typeof a.element=="string"?a.element.toLowerCase():
a.element:"*";this.type=a.type||(t[c]?CKEDITOR.STYLE_BLOCK:J[c]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE);if(typeof this.element=="object")this.type=CKEDITOR.STYLE_OBJECT;this._={definition:a}};CKEDITOR.editor.prototype.applyStyle=function(a){a.checkApplicable(this.elementPath())&&z.call(a,this.getSelection())};CKEDITOR.editor.prototype.removeStyle=function(a){a.checkApplicable(this.elementPath())&&z.call(a,this.getSelection(),1)};CKEDITOR.style.prototype={apply:function(a){z.call(this,a.getSelection())},
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
var optionsHTML = renderChoices(choices, function render(choice) {
if (choice.isNested) {
return tag('optgroup', { label: choice.label }, renderChoices(choice.choices, render));
} else {
return tag('option', { value: choice.value, selected: !!isSelected(f.value, choice.value) }, choice.label);
}
});
var attrs = {
name: name,
id: f.id === false ? false : (f.id || true),
classes: w.classes
};
if (isMultiple) {
attrs.multiple = true;
}
return tag('select', [attrs, userAttrs, w.attrs || {}], optionsHTML);
};
return w;
};
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
module.exports.commit = function (files, message, newVer, tagName, callback) {
message = escapeQuotes(message.replace("%s", newVer));
files = files.map(escapeQuotes).join(" ");
var functionSeries = [
function (done) {
cp.exec(gitApp + " add " + files, gitExtra, done);
},
function (done) {
cp.exec([gitApp, "commit", "-m", message].join(" "), gitExtra, done);
},
function (done) {
cp.exec(
[gitApp, "tag", "-a", escapeQuotes(tagName), "-m", message].join(" "),
gitExtra,
done
);
},
];
contra.series(functionSeries, callback);
};
| 1 |
JavaScript
|
CWE-78
|
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
|
The software 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.
|
https://cwe.mitre.org/data/definitions/78.html
|
safe
|
$.each(postData, (index, value) => {
let input = $(document.createElement('input'));
input.attr('type', 'hidden');
input.attr('name', index);
input.val(value);
form.append(input);
});
| 0 |
JavaScript
|
CWE-352
|
Cross-Site Request Forgery (CSRF)
|
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
|
https://cwe.mitre.org/data/definitions/352.html
|
vulnerable
|
value: function(value, context) {
return function() {
return context
? { context: undefined, name: undefined, value: value }
: value;
};
},
| 1 |
JavaScript
|
CWE-74
|
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
|
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/74.html
|
safe
|
cssclass : function(dir) {
var cname = (fm.UA.Touch ? 'elfinder-touch ' : '')+(dir.phash ? '' : root)+' '+navdir+' '+fm.perms2class(dir);
dir.dirs && !dir.link && (cname += ' ' + collapsed);
opts.getClass && (cname += ' ' + opts.getClass(dir));
dir.csscls && (cname += ' ' + fm.escape(dir.csscls));
return cname;
},
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
1E3<=D&&null!=this.sidebarWindow&&"1"!=urlParams.sketch&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&(1E3<=D||"1"==urlParams.sketch)&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var O=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(C){C=O.apply(this,arguments);
| 0 |
JavaScript
|
CWE-20
|
Improper Input Validation
|
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
|
https://cwe.mitre.org/data/definitions/20.html
|
vulnerable
|
Format.prototype.init=function(){var a=this.editorUi,b=a.editor,f=b.graph;this.update=mxUtils.bind(this,function(d,g){this.refresh()});f.getSelectionModel().addListener(mxEvent.CHANGE,this.update);f.getModel().addListener(mxEvent.CHANGE,this.update);f.addListener(mxEvent.EDITING_STARTED,this.update);f.addListener(mxEvent.EDITING_STOPPED,this.update);f.getView().addListener("unitChanged",this.update);b.addListener("autosaveChanged",this.update);f.addListener(mxEvent.ROOT,this.update);a.addListener("styleChanged",
this.update);this.refresh()};Format.prototype.clear=function(){this.container.innerHTML="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]};Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null);this.pendingRefresh=window.setTimeout(mxUtils.bind(this,function(){this.immediateRefresh()}))};
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
document.createElement("tr");ja.className="gePropHeader";var Ba=document.createElement("th");Ba.className="gePropHeaderCell";var Ha=document.createElement("img");Ha.src=Sidebar.prototype.expandedImage;Ha.style.verticalAlign="middle";Ba.appendChild(Ha);mxUtils.write(Ba,mxResources.get("property"));ja.style.cursor="pointer";var ra=function(){var Aa=va.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){Ha.src=Sidebar.prototype.collapsedImage;var ta="none";for(var ka=u.childNodes.length-
1;0<=ka;ka--)try{var oa=u.childNodes[ka],sa=oa.nodeName.toUpperCase();"INPUT"!=sa&&"SELECT"!=sa||u.removeChild(oa)}catch(ya){}}else Ha.src=Sidebar.prototype.expandedImage,ta="";for(ka=0;ka<Aa.length;ka++)Aa[ka].style.display=ta};mxEvent.addListener(ja,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;ra()});ja.appendChild(Ba);Ba=document.createElement("th");Ba.className="gePropHeaderCell";Ba.innerHTML=mxResources.get("value");ja.appendChild(Ba);va.appendChild(ja);var Ca=
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
wp.updates.updateSuccess = function( response ) {
var $updateMessage, name, $pluginRow, newText;
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
$pluginRow = $( '[data-plugin="' + response.plugin + '"]' ).first();
$updateMessage = $pluginRow.next().find( '.update-message' );
$pluginRow.addClass( 'updated' ).removeClass( 'update' );
// Update the version number in the row.
newText = $pluginRow.find('.plugin-version-author-uri').html().replace( response.oldVersion, response.newVersion );
$pluginRow.find('.plugin-version-author-uri').html( newText );
// Add updated class to update message parent tr
$pluginRow.next().addClass( 'updated' );
} else if ( 'plugin-install' === pagenow ) {
$updateMessage = $( '.plugin-card-' + response.slug ).find( '.update-now' );
$updateMessage.addClass( 'button-disabled' );
name = $updateMessage.data( 'name' );
$updateMessage.attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', name ) );
}
$updateMessage.removeClass( 'updating-message' ).addClass( 'updated-message' );
$updateMessage.text( wp.updates.l10n.updated );
wp.a11y.speak( wp.updates.l10n.updatedMsg );
wp.updates.decrementCount( 'plugin' );
wp.updates.updateDoneSuccessfully = true;
/*
* The lock can be released since the update was successful,
* and any other updates can commence.
*/
wp.updates.updateLock = false;
$(document).trigger( 'wp-plugin-update-success', response );
wp.updates.queueChecker();
};
| 0 |
JavaScript
|
CWE-352
|
Cross-Site Request Forgery (CSRF)
|
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
|
https://cwe.mitre.org/data/definitions/352.html
|
vulnerable
|
c)},onAttributeName:function(a,c){return this.attributeNameRules.execOnName(a,c)},onText:function(a,c){return this.textRules.exec(a,c)},onComment:function(a,c,d){return this.commentRules.exec(a,c,d)},onRoot:function(a,c){return this.rootRules.exec(a,c)},onElement:function(a,c){for(var d=[this.elementsRules["^"],this.elementsRules[c.name],this.elementsRules.$],e,h=0;h<3;h++)if(e=d[h]){e=e.exec(a,c,this);if(e===false)return null;if(e&&e!=c)return this.onNode(a,e);if(c.parent&&!c.name)break}return c},
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
r;r=0;l.isEmpty?i(l):d=l}};e.onTagClose=function(a){for(var e=h.length-1;0<=e;e--)if(a==h[e].name){h.splice(e,1);return}for(var b=[],c=[],g=d;g.type&&g.name!=a;)g._.isBlockLike||c.unshift(g),b.push(g),g=g.parent;if(g.type){for(e=0;e<b.length;e++)a=b[e],i(a,a.parent);d=g;i(g,g.parent);g==d&&(d=d.parent);h=h.concat(c)}};e.onText=function(a){var e=CKEDITOR.dtd[d.name];if(!e||e["#"])c(),b(),a.replace(/(\r\n|[\r\n])|[^\r\n]*/g,function(a,e){if(void 0!==e&&e.length)f++;else if(a.length){var b=0;a.replace(p,
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
d.addHours=function(a,c){return d.addMinutes(a,60*c)};d.addMinutes=function(a,c){return d.addSeconds(a,60*c)};d.addSeconds=function(a,c){return d.addMilliseconds(a,1E3*c)};d.addMilliseconds=function(a,c){return new Date(a.getTime()+c)};d.subtract=function(a,c){var b=a.getTime()-c.getTime();return{toMilliseconds:function(){return b},toSeconds:function(){return b/1E3},toMinutes:function(){return b/6E4},toHours:function(){return b/36E5},toDays:function(){return b/864E5}}};d.isLeapYear=function(a){return!(a%
| 0 |
JavaScript
|
CWE-400
|
Uncontrolled Resource Consumption
|
The software 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.
|
https://cwe.mitre.org/data/definitions/400.html
|
vulnerable
|
b,c)))return d;return null},A=function(a,b,c,e,d){if(c){for(var g=0,f;f=a[g];g++){if(f.id==c)return a.splice(g,0,b),b;if(e&&f[e]&&(f=A(f[e],b,c,e,!0)))return f}if(d)return null}a.push(b);return b},B=function(a,b,c){for(var e=0,d;d=a[e];e++){if(d.id==b)return a.splice(e,1);if(c&&d[c]&&(d=B(d[c],b,c)))return d}return null},L=function(a,b){this.dialog=a;for(var c=b.contents,e=0,d;d=c[e];e++)c[e]=d&&new I(a,d);CKEDITOR.tools.extend(this,b)};L.prototype={getContents:function(a){return z(this.contents,
a)},getButton:function(a){return z(this.buttons,a)},addContents:function(a,b){return A(this.contents,a,b)},addButton:function(a,b){return A(this.buttons,a,b)},removeContents:function(a){B(this.contents,a)},removeButton:function(a){B(this.buttons,a)}};I.prototype={get:function(a){return z(this.elements,a,"children")},add:function(a,b){return A(this.elements,a,b,"children")},remove:function(a){B(this.elements,a,"children")}};var F,w={},q,s={},M=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
setViewTitle: function(date, view, data)
{
switch (view) {
case 'day':
return this.setTitle(date.toString('D'));
case 'week':
var dates = this.viewDates(date, view);
return this.setTitle(dates[0].toString(Kronolith.conf.date_format) + ' - ' + dates[1].toString(Kronolith.conf.date_format));
case 'month':
return this.setTitle(date.toString('MMMM yyyy'));
case 'year':
return this.setTitle(date.toString('yyyy'));
case 'agenda':
var dates = this.viewDates(date, view);
return this.setTitle(Kronolith.text.agenda + ' ' + dates[0].toString(Kronolith.conf.date_format) + ' - ' + dates[1].toString(Kronolith.conf.date_format));
case 'search':
return this.setTitle(Kronolith.text.searching.interpolate({ term: data })).escapeHTML();
}
},
| 1 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
safe
|
PostgreSQL.prototype.buildExpression = function(columnName, operator,
operatorValue, propertyDefinition) {
switch (operator) {
case 'like':
return new ParameterizedSQL(columnName + "::TEXT LIKE ? ESCAPE E'\\\\'",
[operatorValue]);
case 'ilike':
return new ParameterizedSQL(columnName + "::TEXT ILIKE ? ESCAPE E'\\\\'",
[operatorValue]);
case 'nlike':
return new ParameterizedSQL(columnName + "::TEXT NOT LIKE ? ESCAPE E'\\\\'",
[operatorValue]);
case 'nilike':
return new ParameterizedSQL(columnName + "::TEXT NOT ILIKE ? ESCAPE E'\\\\'",
[operatorValue]);
case 'regexp':
if (operatorValue.global)
g.warn('{{PostgreSQL}} regex syntax does not respect the {{`g`}} flag');
if (operatorValue.multiline)
g.warn('{{PostgreSQL}} regex syntax does not respect the {{`m`}} flag');
const regexOperator = operatorValue.ignoreCase ? ' ~* ?' : ' ~ ?';
return new ParameterizedSQL(columnName + regexOperator,
[operatorValue.source]);
case 'contains':
return new ParameterizedSQL(columnName + ' @> array[' + operatorValue.map((v) => `'${v}'`) + ']::'
+ propertyDefinition.postgresql.dataType);
case 'match':
return new ParameterizedSQL(`to_tsvector(${columnName}) @@ to_tsquery('${operatorValue}')`);
default:
// invoke the base implementation of `buildExpression`
return this.invokeSuper('buildExpression', columnName, operator,
operatorValue, propertyDefinition);
}
};
| 0 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
vulnerable
|
l.isRemoteFileFormat(B,d.name)?l.isOffline()?l.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):l.parseFileData(B,mxUtils.bind(this,function(I){4==I.readyState&&(200<=I.status&&299>=I.status?g(I.responseText):k())}),d.name):k()}):A||k()}},function(q){k(q)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?p():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",p))};EditorUi.prototype.importFile=function(d,g,k,l,p,q,x,y,A,B,I,O){B=null!=
B?B:!0;var t=!1,z=null,L=mxUtils.bind(this,function(C){var D=null;null!=C&&"<mxlibrary"==C.substring(0,10)?this.loadLibrary(new LocalLibrary(this,C,x)):D=this.importXml(C,k,l,B,null,null!=O?mxEvent.isControlDown(O):null);null!=y&&y(D)});"image"==g.substring(0,5)?(A=!1,"image/png"==g.substring(0,9)&&(g=I?null:this.extractGraphModelFromPng(d),null!=g&&0<g.length&&(z=this.importXml(g,k,l,B,null,null!=O?mxEvent.isControlDown(O):null),A=!0)),A||(g=this.editor.graph,A=d.indexOf(";"),0<A&&(d=d.substring(0,
A)+d.substring(d.indexOf(",",A+1))),B&&g.isGridEnabled()&&(k=g.snap(k),l=g.snap(l)),z=[g.insertVertex(null,null,"",k,l,p,q,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+d+";")])):/(\.*<graphml )/.test(d)?(t=!0,this.importGraphML(d,L)):null!=A&&null!=x&&(/(\.v(dx|sdx?))($|\?)/i.test(x)||/(\.vs(x|sx?))($|\?)/i.test(x))?(t=!0,this.importVisio(A,L)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,x)?this.isOffline()?
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
validate: function(validator, $field, options) {
var value = $field.val();
if (value === '') {
return true;
}
options = $.extend({}, { ipv4: true, ipv6: true }, options);
var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.) {3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
ipv6Regex = /^\s*((([0-9A-Fa-f]{1,4}:) {7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:) {6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3})|:))|(([0-9A-Fa-f]{1,4}:) {5}(((:[0-9A-Fa-f]{1,4}) {1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3})|:))|(([0-9A-Fa-f]{1,4}:) {4}(((:[0-9A-Fa-f]{1,4}) {1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3}))|:))|(([0-9A-Fa-f]{1,4}:) {3}(((:[0-9A-Fa-f]{1,4}) {1,4})|((:[0-9A-Fa-f]{1,4}) {0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3}))|:))|(([0-9A-Fa-f]{1,4}:) {2}(((:[0-9A-Fa-f]{1,4}) {1,5})|((:[0-9A-Fa-f]{1,4}) {0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3}))|:))|(([0-9A-Fa-f]{1,4}:) {1}(((:[0-9A-Fa-f]{1,4}) {1,6})|((:[0-9A-Fa-f]{1,4}) {0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3}))|:))|(:(((:[0-9A-Fa-f]{1,4}) {1,7})|((:[0-9A-Fa-f]{1,4}) {0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)) {3}))|:)))(%.+)?\s*$/,
| 1 |
JavaScript
|
CWE-89
|
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
|
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
|
https://cwe.mitre.org/data/definitions/89.html
|
safe
|
handler: function ({log, command} = {}) {
const [, protocol, ip, port] = _.chain(command).get('arg', '').split('|').value();
const family = FAMILY[protocol];
if (!family) return this.reply(504, 'Unknown network protocol');
this.connector = new ActiveConnector(this);
return this.connector.setupConnection(ip, port, family)
.then(() => this.reply(200))
.catch((err) => {
log.error(err);
return this.reply(err.code || 425, err.message);
});
},
| 1 |
JavaScript
|
CWE-918
|
Server-Side Request Forgery (SSRF)
|
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
|
https://cwe.mitre.org/data/definitions/918.html
|
safe
|
function returnable(stopped)
{
return {
data: data,
errors: errors,
meta: {
delimiter: delim,
linebreak: newline,
aborted: aborted,
truncated: !!stopped,
cursor: lastCursor + (baseIndex || 0)
}
};
}
/** Executes the user's step function and resets data & errors. */
function doStep()
{
step(returnable());
data = [];
errors = [];
}
/** Gets the delimiter character, which is not inside the quoted field */
function getNextUnquotedDelimiter(nextDelim, quoteSearch, newLine) {
var result = {
nextDelim: undefined,
quoteSearch: undefined
};
// get the next closing quote character
var nextQuoteSearch = input.indexOf(quoteChar, quoteSearch + 1);
// if next delimiter is part of a field enclosed in quotes
if (nextDelim > quoteSearch && nextDelim < nextQuoteSearch && (nextQuoteSearch < newLine || newLine === -1)) {
// get the next delimiter character after this one
var nextNextDelim = input.indexOf(delim, nextQuoteSearch);
// if there is no next delimiter, return default result
if (nextNextDelim === -1) {
return result;
}
// find the next opening quote char position
if (nextNextDelim > nextQuoteSearch) {
nextQuoteSearch = input.indexOf(quoteChar, nextQuoteSearch + 1);
}
// try to get the next delimiter position
result = getNextUnquotedDelimiter(nextNextDelim, nextQuoteSearch, newLine);
} else {
result = {
nextDelim: nextDelim,
quoteSearch: quoteSearch
};
}
return result;
}
};
| 1 |
JavaScript
|
CWE-1236
|
Improper Neutralization of Formula Elements in a CSV File
|
The software saves user-provided information into a Comma-Separated Value (CSV) file, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as a command when the file is opened by spreadsheet software.
|
https://cwe.mitre.org/data/definitions/1236.html
|
safe
|
m=P.name;v="";O(null,!0)})));k.appendChild(F)})(D[G],G)}100==D.length&&(k.appendChild(A),B=function(){k.scrollTop>=k.scrollHeight-k.offsetHeight&&C()},mxEvent.addListener(k,"scroll",B))}),y)});t()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,e,f){DrawioFile.call(this,b,e);this.meta=f;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
| 0 |
JavaScript
|
CWE-79
|
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
|
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
|
https://cwe.mitre.org/data/definitions/79.html
|
vulnerable
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.