code
stringlengths 14
2.05k
| label
int64 0
1
| programming_language
stringclasses 7
values | cwe_id
stringlengths 6
14
| cwe_name
stringlengths 5
98
⌀ | description
stringlengths 36
379
⌀ | url
stringlengths 36
48
⌀ | label_name
stringclasses 2
values |
---|---|---|---|---|---|---|---|
WebCryptography.prototype.decryptString = function (key, ciphertext) {
return __awaiter(this, void 0, void 0, function () {
var abCiphertext, abIv, abPayload, abPlaintext;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
abCiphertext = WebCryptography.encoder.encode(ciphertext).buffer;
abIv = abCiphertext.slice(0, 16);
abPayload = abCiphertext.slice(16);
return [4 /*yield*/, crypto.subtle.decrypt({ name: 'AES-CBC', iv: abIv }, key, abPayload)];
case 1:
abPlaintext = _a.sent();
return [2 /*return*/, WebCryptography.decoder.decode(abPlaintext)];
}
});
});
}; | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
WebCryptography.prototype.encryptFile = function (key, file, File) {
return __awaiter(this, void 0, void 0, function () {
var bKey, abPlaindata, abCipherdata;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (file.data.byteLength <= 0)
throw new Error('encryption error. empty content');
return [4 /*yield*/, this.getKey(key)];
case 1:
bKey = _a.sent();
return [4 /*yield*/, file.data.arrayBuffer()];
case 2:
abPlaindata = _a.sent();
return [4 /*yield*/, this.encryptArrayBuffer(bKey, abPlaindata)];
case 3:
abCipherdata = _a.sent();
return [2 /*return*/, File.create({
name: file.name,
mimeType: 'application/octet-stream',
data: abCipherdata,
})];
}
});
});
}; | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
WebCryptography.prototype.getKey = function (key) {
return __awaiter(this, void 0, void 0, function () {
var digest, hashHex, abKey;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, crypto.subtle.digest('SHA-256', WebCryptography.encoder.encode(key))];
case 1:
digest = _a.sent();
hashHex = Array.from(new Uint8Array(digest))
.map(function (b) { return b.toString(16).padStart(2, '0'); })
.join('');
abKey = WebCryptography.encoder.encode(hashHex.slice(0, 32)).buffer;
return [2 /*return*/, crypto.subtle.importKey('raw', abKey, 'AES-CBC', true, ['encrypt', 'decrypt'])];
}
});
});
}; | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
}; | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
function PubNubFile(_a) {
var stream = _a.stream, data = _a.data, encoding = _a.encoding, name = _a.name, mimeType = _a.mimeType;
if (stream instanceof stream_1.Readable) {
this.data = stream;
if (stream instanceof fs_1.default.ReadStream) {
// $FlowFixMe: incomplete flow node definitions
this.name = (0, path_1.basename)(stream.path);
this.contentLength = fs_1.default.statSync(stream.path).size;
}
}
else if (data instanceof Buffer) {
this.data = Buffer.from(data);
}
else if (typeof data === 'string') {
// $FlowFixMe: incomplete flow node definitions
this.data = Buffer.from(data, encoding !== null && encoding !== void 0 ? encoding : 'utf8');
}
if (name) {
this.name = (0, path_1.basename)(name);
}
if (mimeType) {
this.mimeType = mimeType;
}
if (this.data === undefined) {
throw new Error("Couldn't construct a file out of supplied options.");
}
if (this.name === undefined) {
throw new Error("Couldn't guess filename out of the options. Please provide one.");
}
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
cryptors: [new nodeCryptoModule_1.AesCbcCryptor({ cipherKey: cryptoConfiguration.cipherKey })],
});
}; | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
default: new nodeCryptoModule_1.LegacyCryptor({
cipherKey: cryptoConfiguration.cipherKey,
useRandomIVs: cryptoConfiguration.useRandomIVs,
}),
cryptors: [new nodeCryptoModule_1.AesCbcCryptor({ cipherKey: cryptoConfiguration.cipherKey })],
});
};
if (!('ssl' in setup)) {
setup.ssl = true;
}
_this = _super.call(this, setup) || this;
return _this;
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
setup.initCryptoModule = function (cryptoConfiguration) {
return new nodeCryptoModule_1.CryptoModule({
default: new nodeCryptoModule_1.LegacyCryptor({
cipherKey: cryptoConfiguration.cipherKey,
useRandomIVs: cryptoConfiguration.useRandomIVs,
}),
cryptors: [new nodeCryptoModule_1.AesCbcCryptor({ cipherKey: cryptoConfiguration.cipherKey })],
});
};
if (!('ssl' in setup)) {
setup.ssl = true;
}
_this = _super.call(this, setup) || this;
return _this;
}
return class_1;
}(pubnub_common_1.default)), | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
cryptors: [new webCryptoModule_1.AesCbcCryptor({ cipherKey: cryptoConfiguration.cipherKey })],
});
}; | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
default: new webCryptoModule_1.LegacyCryptor({
cipherKey: cryptoConfiguration.cipherKey,
useRandomIVs: cryptoConfiguration.useRandomIVs,
}),
cryptors: [new webCryptoModule_1.AesCbcCryptor({ cipherKey: cryptoConfiguration.cipherKey })],
});
};
_this = _super.call(this, setup) || this;
if (listenToBrowserNetworkEvents) {
// mount network events.
window.addEventListener('offline', function () {
_this.networkDownDetected();
});
window.addEventListener('online', function () {
_this.networkUpDetected();
});
}
return _this;
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
setup.initCryptoModule = function (cryptoConfiguration) {
return new webCryptoModule_1.CryptoModule({
default: new webCryptoModule_1.LegacyCryptor({
cipherKey: cryptoConfiguration.cipherKey,
useRandomIVs: cryptoConfiguration.useRandomIVs,
}),
cryptors: [new webCryptoModule_1.AesCbcCryptor({ cipherKey: cryptoConfiguration.cipherKey })],
});
};
_this = _super.call(this, setup) || this;
if (listenToBrowserNetworkEvents) {
// mount network events.
window.addEventListener('offline', function () {
_this.networkDownDetected();
});
window.addEventListener('online', function () {
_this.networkUpDetected();
});
}
return _this;
}
default_1.CryptoModule = webCryptoModule_1.CryptoModule;
return default_1;
}(pubnub_common_1.default)); | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
export function encode(input: ArrayBuffer): string {
let base64 = '';
const encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const bytes = new Uint8Array(input);
const byteLength = bytes.byteLength;
const byteRemainder = byteLength % 3;
const mainLength = byteLength - byteRemainder;
let a, b, c, d;
let chunk;
// Main loop deals with bytes in chunks of 3
for (let i = 0; i < mainLength; i = i + 3) {
// Combine the three bytes into a single integer
chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
// Use bitmasks to extract 6-bit segments from the triplet
a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12
c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6
d = chunk & 63; // 63 = 2^6 - 1
// Convert the raw binary segments to the appropriate ASCII encoding
base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
}
// Deal with the remaining bytes and padding
if (byteRemainder == 1) {
chunk = bytes[mainLength];
a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
// Set the 4 least significant bits to zero
b = (chunk & 3) << 4; // 3 = 2^2 - 1
base64 += encodings[a] + encodings[b] + '==';
} else if (byteRemainder == 2) {
chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1];
a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4
// Set the 2 least significant bits to zero
c = (chunk & 15) << 2; // 15 = 2^4 - 1
base64 += encodings[a] + encodings[b] + encodings[c] + '=';
}
return base64;
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
constructor({
subscribeEndpoint,
leaveEndpoint,
heartbeatEndpoint,
setStateEndpoint,
timeEndpoint,
getFileUrl,
config,
crypto,
listenerManager,
cryptoModule,
}) {
this._listenerManager = listenerManager;
this._config = config;
this._leaveEndpoint = leaveEndpoint;
this._heartbeatEndpoint = heartbeatEndpoint;
this._setStateEndpoint = setStateEndpoint;
this._subscribeEndpoint = subscribeEndpoint;
this._getFileUrl = getFileUrl;
this._crypto = crypto;
this._cryptoModule = cryptoModule;
this._channels = {};
this._presenceChannels = {};
this._heartbeatChannels = {};
this._heartbeatChannelGroups = {};
this._channelGroups = {};
this._presenceChannelGroups = {};
this._pendingChannelSubscriptions = [];
this._pendingChannelGroupSubscriptions = [];
this._currentTimetoken = 0;
this._lastTimetoken = 0;
this._storedTimetoken = null;
this._subscriptionStatusAnnounced = false;
this._isOnline = true;
this._reconnectionManager = new ReconnectionManager({ timeEndpoint });
this._dedupingManager = new DedupingManager({ config });
if (this._cryptoModule) this._decoder = new TextDecoder();
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
url: this._getFileUrl({
id: msgPayload.file.id,
name: msgPayload.file.name,
channel,
}),
};
this._listenerManager.announceFile(announce);
} else {
const announce = {};
announce.channel = null;
announce.subscription = null;
// deprecated -->
announce.actualChannel = subscriptionMatch != null ? channel : null;
announce.subscribedChannel = subscriptionMatch != null ? subscriptionMatch : channel;
// <-- deprecated
announce.channel = channel;
announce.subscription = subscriptionMatch;
announce.timetoken = publishMetaData.publishTimetoken;
announce.publisher = message.issuingClientId;
if (message.userMetadata) {
announce.userMetadata = message.userMetadata;
}
if (this._cryptoModule) {
let decryptedPayload;
try {
const decryptedData = this._cryptoModule.decrypt(message.payload);
decryptedPayload =
decryptedData instanceof ArrayBuffer ? JSON.parse(this._decoder.decode(decryptedData)) : decryptedData;
} catch (e) {
decryptedPayload = null;
// eslint-disable-next-line
if (console && console.log) {
console.log('decryption error', e.message); //eslint-disable-line
}
}
if (decryptedPayload != null) {
announce.message = decryptedPayload;
} else {
announce.message = message.payload;
}
} else {
announce.message = message.payload;
}
this._listenerManager.announceMessage(announce);
}
}); | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
function stringToArrayBuffer(str) {
var buf = new ArrayBuffer(str.length * 2);
var bufView = new Uint16Array(buf);
for (var i = 0, strLen = str.length; i < strLen; i++) {
bufView[i] = str.charCodeAt(i);
}
return buf;
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
getFilePath(filename) {
return getFilePath(filename);
} | 1 | JavaScript | CWE-331 | Insufficient Entropy | The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. | https://cwe.mitre.org/data/definitions/331.html | safe |
get defaultInstance() {
return defaultInstance;
} | 1 | JavaScript | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | safe |
function start(args, returnPromise) {
let command = crpath;
if (!fs.existsSync(command)) {
console.log('Could not find chromedriver in default path: ', command);
console.log('Falling back to use global chromedriver bin');
command = process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver';
}
const cp = require('child_process').spawn(command, args);
cp.stdout.pipe(process.stdout);
cp.stderr.pipe(process.stderr);
defaultInstance = cp;
if (!returnPromise)
return cp;
const port = getPortFromArgs(args);
const pollInterval = 100;
const timeout = 10000;
return tcpPortUsed.waitUntilUsed(port, pollInterval, timeout)
.then(function () {
return cp;
});
} | 1 | JavaScript | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | safe |
function getPortFromArgs(args) {
let port = 9515;
if (!args)
return port;
const portRegexp = /--port=(\d*)/;
const portArg = args.find(function (arg) {
return portRegexp.test(arg);
});
if (portArg)
port = parseInt(portRegexp.exec(portArg)[1]);
return port;
} | 1 | JavaScript | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | safe |
function stop() {
if (defaultInstance != null)
defaultInstance.kill();
defaultInstance = null;
} | 1 | JavaScript | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | safe |
async function writeUpdate(newVersion, shouldCommit) {
const helper = fs.readFileSync('./lib/chromedriver.js', 'utf8');
const versionExport = 'const version';
const regex = new RegExp(`^.*${versionExport}.*$`, 'gm');
const updated = helper.replace(regex, `${versionExport} = '${newVersion}';`);
const currentMajor = semver.major(currentVersionInPackageJson);
const newMajor = semver.major(semver.coerce(newVersion));
const version = currentMajor !== newMajor ? `${newMajor}.0.0` : semver.inc(currentVersionInPackageJson, 'patch');
execSync(`npm version ${version} --git-tag-version=false`);
fs.writeFileSync('./lib/chromedriver.js', updated, 'utf8');
if (!shouldCommit) return;
execSync('git add :/');
execSync(`git commit -m "Bump version to ${version}"`);
execSync(`git tag -s ${version} -m ${version}`);
} | 1 | JavaScript | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | safe |
'X-Pimcore-Csrf-Token': $newCustomerButton.data('token')
},
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
window.top.pimcore.helpers.openObject(objectId, 'object');
} else {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
}
}
});
}); | 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 |
registerNewCustomerAction: function () {
var $newCustomerButton = $('#add-new-customer');
var isPimcoreAvailable = ('undefined' !== typeof window.top.pimcore);
if(!isPimcoreAvailable) $newCustomerButton.hide();
$newCustomerButton.on('click', function (e) {
if (!isPimcoreAvailable) {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
return false;
}
$.ajax({
method : 'POST',
url: '/admin/customermanagementframework/customers/new',
headers: {
'X-Pimcore-Csrf-Token': $newCustomerButton.data('token')
},
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
window.top.pimcore.helpers.openObject(objectId, 'object');
} else {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
}
}
});
});
}
});
})(jQuery); | 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 |
'X-Pimcore-Csrf-Token': $newCustomerButton.data('token')
},
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
window.top.pimcore.helpers.openObject(objectId, 'object');
} else {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
}
}
});
}); | 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 |
registerNewCustomerAction: function () {
var $newCustomerButton = $('#add-new-customer');
var isPimcoreAvailable = ('undefined' !== typeof window.top.pimcore);
if(!isPimcoreAvailable) $newCustomerButton.hide();
$newCustomerButton.on('click', function (e) {
if (!isPimcoreAvailable) {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
return false;
}
$.ajax({
method : 'POST',
url: '/admin/customermanagementframework/customers/new',
headers: {
'X-Pimcore-Csrf-Token': $newCustomerButton.data('token')
},
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
window.top.pimcore.helpers.openObject(objectId, 'object');
} else {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
}
}
});
});
}
});
})(jQuery); | 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 |
const url = (location, omitQuery = false) => {
const query = Query.parse(location.search)
const next = query.n || appRoot
if (omitQuery) {
return next.split('?')[0]
}
// Only allow relative redirects to prevent open redirects.
if (!next.startsWith('/') || next.startsWith('//')) {
return appRoot
}
return next
} | 1 | 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 | safe |
function buildAttributesMap(attrStr, jPath) {
if (!this.options.ignoreAttributes && typeof attrStr === 'string') {
// attrStr = attrStr.replace(/\r?\n/g, ' ');
//attrStr = attrStr || attrStr.trim();
const matches = util.getAllMatches(attrStr, attrsRegx);
const len = matches.length; //don't make it inline
const attrs = {};
for (let i = 0; i < len; i++) {
const attrName = this.resolveNameSpace(matches[i][1]);
let oldVal = matches[i][4];
let aName = this.options.attributeNamePrefix + attrName;
if (attrName.length) {
if (this.options.transformAttributeName) {
aName = this.options.transformAttributeName(aName);
}
if(aName === "__proto__") aName = "#__proto__";
if (oldVal !== undefined) {
if (this.options.trimValues) {
oldVal = oldVal.trim();
}
oldVal = this.replaceEntitiesValue(oldVal);
const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
if(newVal === null || newVal === undefined){
//don't parse
attrs[aName] = oldVal;
}else if(typeof newVal !== typeof oldVal || newVal !== oldVal){
//overwrite
attrs[aName] = newVal;
}else{
//parse
attrs[aName] = parseValue(
oldVal,
this.options.parseAttributeValue,
this.options.numberParseOptions
);
}
} else if (this.options.allowBooleanAttributes) {
attrs[aName] = true;
}
}
}
if (!Object.keys(attrs).length) {
return;
}
if (this.options.attributesGroupName) {
const attrCollection = {};
attrCollection[this.options.attributesGroupName] = attrs;
return attrCollection;
}
return attrs;
}
} | 1 | JavaScript | CWE-1321 | Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') | The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. | https://cwe.mitre.org/data/definitions/1321.html | safe |
add(key,val){
// this.child.push( {name : key, val: val, isCdata: isCdata });
if(key === "__proto__") key = "#__proto__";
this.child.push( {[key]: val });
} | 1 | JavaScript | CWE-1321 | Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') | The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. | https://cwe.mitre.org/data/definitions/1321.html | safe |
addChild(node) {
if(node.tagname === "__proto__") node.tagname = "#__proto__";
if(node[":@"] && Object.keys(node[":@"]).length > 0){
this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] });
}else{
this.child.push( { [node.tagname]: node.child });
}
}; | 1 | JavaScript | CWE-1321 | Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') | The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. | https://cwe.mitre.org/data/definitions/1321.html | safe |
function isEntity(xmlData, i){
if(xmlData[i+1] === '!' &&
xmlData[i+2] === 'E' &&
xmlData[i+3] === 'N' &&
xmlData[i+4] === 'T' &&
xmlData[i+5] === 'I' &&
xmlData[i+6] === 'T' &&
xmlData[i+7] === 'Y') return true
return false
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
function isElement(xmlData, i){
if(xmlData[i+1] === '!' &&
xmlData[i+2] === 'E' &&
xmlData[i+3] === 'L' &&
xmlData[i+4] === 'E' &&
xmlData[i+5] === 'M' &&
xmlData[i+6] === 'E' &&
xmlData[i+7] === 'N' &&
xmlData[i+8] === 'T') return true
return false
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
function isNotation(xmlData, i){
if(xmlData[i+1] === '!' &&
xmlData[i+2] === 'N' &&
xmlData[i+3] === 'O' &&
xmlData[i+4] === 'T' &&
xmlData[i+5] === 'A' &&
xmlData[i+6] === 'T' &&
xmlData[i+7] === 'I' &&
xmlData[i+8] === 'O' &&
xmlData[i+9] === 'N') return true
return false
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
regx : RegExp( `&${entityName};`,"g"),
val: val
};
}
else if( hasBody && isElement(xmlData, i)) i += 8;//Not supported
else if( hasBody && isAttlist(xmlData, i)) i += 8;//Not supported
else if( hasBody && isNotation(xmlData, i)) i += 9;//Not supported
else if( isComment) comment = true;
else throw new Error("Invalid DOCTYPE");
angleBracketsCount++;
exp = "";
} else if (xmlData[i] === '>') { //Read tag content
if(comment){
if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){
comment = false;
angleBracketsCount--;
}
}else{
angleBracketsCount--;
}
if (angleBracketsCount === 0) {
break;
}
}else if( xmlData[i] === '['){
hasBody = true;
}else{
exp += xmlData[i];
}
}
if(angleBracketsCount !== 0){
throw new Error(`Unclosed DOCTYPE`);
}
}else{
throw new Error(`Invalid Tag instead of DOCTYPE`);
}
return {entities, i};
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
function readEntityExp(xmlData,i){
//External entities are not supported
// <!ENTITY ext SYSTEM "http://normal-website.com" >
//Parameter entities are not supported
// <!ENTITY entityname "&anotherElement;">
//Internal entities are supported
// <!ENTITY entityname "replacement text">
//read EntityName
let entityName = "";
for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) {
// if(xmlData[i] === " ") continue;
// else
entityName += xmlData[i];
}
entityName = entityName.trim();
if(entityName.indexOf(" ") !== -1) throw new Error("External entites are not supported");
//read Entity Value
const startChar = xmlData[i++];
let val = ""
for (; i < xmlData.length && xmlData[i] !== startChar ; i++) {
val += xmlData[i];
}
return [entityName, val, i];
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
function isAttlist(xmlData, i){
if(xmlData[i+1] === '!' &&
xmlData[i+2] === 'A' &&
xmlData[i+3] === 'T' &&
xmlData[i+4] === 'T' &&
xmlData[i+5] === 'L' &&
xmlData[i+6] === 'I' &&
xmlData[i+7] === 'S' &&
xmlData[i+8] === 'T') return true
return false
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
function isComment(xmlData, i){
if(xmlData[i+1] === '!' &&
xmlData[i+2] === '-' &&
xmlData[i+3] === '-') return true
return false
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
function validateEntityName(name){
for (let i = 0; i < specialChar.length; i++) {
const ch = specialChar[i];
if(name.indexOf(ch) !== -1) throw new Error(`Invalid character ${ch} in entity name`);
}
return name;
} | 1 | JavaScript | CWE-1333 | Inefficient Regular Expression Complexity | The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. | https://cwe.mitre.org/data/definitions/1333.html | safe |
!function(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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(){var t;t=jQuery,Craft.QuickPostWidget=Garnish.Base.extend({params:null,initFields:null,formHtml:null,$widget:null,$form:null,$spinner:null,$errorList:null,loading:!1,init:function(i,r,e,n){this.params=r,this.initFields=e,this.formHtml=n,this.$widget=t("#widget"+i),this.initForm(this.$widget.find("form:first"))},initForm:function(t){this.$form=t,this.$spinner=this.$form.find(".spinner"),this.initFields();var i=this.$form.find("> .buttons > .btngroup > .menubtn"),r=i.data("menubtn").menu.$container.find("> ul > li > a");i.menubtn(),this.addListener(this.$form,"submit","handleFormSubmit"),this.addListener(r,"click","saveAndContinueEditing")},handleFormSubmit:function(t){t.preventDefault(),this.save(this.onSave.bind(this))},saveAndContinueEditing:function(){this.save(this.gotoEntry.bind(this))},save:function(i){var r=this;if(!this.loading){this.loading=!0,this.$spinner.removeClass("hidden");var e=Garnish.getPostData(this.$form),n=t.extend({enabled:1},e,this.params);Craft.postActionRequest("entries/save-entry",n,(function(e,n){if(r.loading=!1,r.$spinner.addClass("hidden"),r.$errorList&&r.$errorList.children().remove(),"success"===n)if(e.success)Craft.cp.displayNotice(Craft.t("app","Entry saved.")),i(e);else if(Craft.cp.displayError(Craft.t("app","Couldn’t save entry.")),e.errors)for(var s in r.$errorList||(r.$errorList=t('<ul class="errors"/>').insertAfter(r.$form)),e.errors)if(e.errors.hasOwnProperty(s))for(var a=0;a<e.errors[s].length;a++){var o=e.errors[s][a];t("<li/>",{text:o}).appendTo(r.$errorList)}}))}},onSave:function(i){var r=t(this.formHtml);if(this.$form.replaceWith(r),Craft.initUiElements(r),this.initForm(r),void 0!==Craft.RecentEntriesWidget)for(var e=0;e<Craft.RecentEntriesWidget.instances.length;e++){var n=Craft.RecentEntriesWidget.instances[e];n.params.sectionId&&n.params.sectionId!=this.params.sectionId||n.addEntry({url:i.cpEditUrl,title:i.title,dateCreated:i.dateCreated,username:i.authorUsername})}},gotoEntry:function(t){Craft.redirectTo(t.cpEditUrl)}})}(); | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 |
save: function (callback) {
if (this.loading) {
return;
}
this.loading = true;
this.$spinner.removeClass('hidden');
var formData = Garnish.getPostData(this.$form),
data = $.extend({enabled: 1}, formData, this.params);
Craft.postActionRequest(
'entries/save-entry',
data,
(response, textStatus) => {
this.loading = false;
this.$spinner.addClass('hidden');
if (this.$errorList) {
this.$errorList.children().remove();
}
if (textStatus === 'success') {
if (response.success) {
Craft.cp.displayNotice(Craft.t('app', 'Entry saved.'));
callback(response);
} else {
Craft.cp.displayError(Craft.t('app', 'Couldn’t save entry.'));
if (response.errors) {
if (!this.$errorList) {
this.$errorList = $('<ul class="errors"/>').insertAfter(
this.$form
);
}
for (var attribute in response.errors) {
if (!response.errors.hasOwnProperty(attribute)) {
continue;
}
for (var i = 0; i < response.errors[attribute].length; i++) {
var error = response.errors[attribute][i];
$('<li/>', {
text: error,
}).appendTo(this.$errorList);
}
}
}
}
}
}
);
}, | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 |
label: Craft.escapeHtml(o.label),
value: o.attr,
};
}), | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 |
options: this.elementIndex.getSortOptions(this.$source).map((o) => {
return {
label: Craft.escapeHtml(o.label),
value: o.attr,
};
}),
}) | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 |
label: Craft.escapeHtml(o.label),
value: o.attr,
};
}), | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 |
options: this.sourceData.sortOptions.map((o) => {
return {
label: Craft.escapeHtml(o.label),
value: o.attr,
};
}),
value: this.sourceData.defaultSort[0],
}) | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 |
dir: path.join(__dirname, './coverage'),
subdir: '.',
reporters: [
{type: 'lcov'},
],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--disable-gpu'],
},
},
singleRun: false,
});
}; | 1 | JavaScript | CWE-200 | Exposure of Sensitive Information to an Unauthorized Actor | The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. | https://cwe.mitre.org/data/definitions/200.html | safe |
function renderRestrictedPipeline(node) {
var gui = '';
gui += '<h3 title="' + node.name + '" class="restricted">' + node.name + '</h3>';
if (node.message) {
gui += '<div class="message restricted"><span>' + _.escape(node.message) + '</span></div>';
}
gui += '<div class="actions restricted">';
gui += '<button class="pin" title="Keep dependencies highlighted" /></div>';
return gui;
} | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 renderWarning(node) {
var gui = '';
if (node.message) {
gui += '<div class="warning"><span>' + _.escape(node.message) + '</span></div>';
}
return gui;
} | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 renderDeletedPipeline(node) {
var gui = '';
gui += '<h3 title="' + node.name + '" class="deleted">' + node.name + '</h3>';
if (node.message) {
gui += '<div class="message deleted"><span>' + _.escape(node.message) + '</span></div>';
}
gui += '<div class="actions deleted"><button class="pin" title="Keep dependencies highlighted" /></div>';
return gui;
} | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 renderScmInstance(instance) {
return '<li class="instance">'
+ '<div title="' + instance.revision + '" class="revision"><span>Revision: </span>' + '<a href="' + instance.locator + '">' + instance.revision + '</a>' + ' </div>'
+ '<div class="usercomment wraptext">' + parseComment(instance.comment) + '</div>'
+ '<div class="author">'
+ '<p>' + _.escape(instance.user) + ' </p>'
+ '<p>' + _.escape(instance.modified_time) + '</p>'
+ '</div>'
+ '</li>';
} | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 parseComment(comment) {
if (/"TYPE":"PACKAGE_MATERIAL"/.test(comment)) {
var comment_markup = "";
var comment_map = JSON.parse(comment);
var package_comment = comment_map['COMMENT'];
var trackback_url = comment_map['TRACKBACK_URL'];
if (typeof package_comment !== "undefined" || package_comment != null) {
comment_markup = _.escape(package_comment) + "<br/>";
}
if (typeof trackback_url !== "undefined" || trackback_url != null) {
return comment_markup + "Trackback: " + "<a href=" + _.escape(trackback_url) + ">" + _.escape(trackback_url) + "</a>";
}
return comment_markup + "Trackback: " + "Not Provided";
}
return _.escape(comment);
} | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 parseCommentForTooltip(comment) {
if (/"TYPE":"PACKAGE_MATERIAL"/.test(comment)) {
var comment_tooltip = "";
var comment_map = JSON.parse(comment);
var package_comment = comment_map['COMMENT'];
var trackback_url = comment_map['TRACKBACK_URL'];
if (typeof package_comment !== "undefined" || package_comment != null) {
comment_tooltip = _.escape(package_comment) + "\n";
}
if (typeof trackback_url !== "undefined" || trackback_url != null) {
return comment_tooltip + "Trackback: " + _.escape(trackback_url);
}
return comment_tooltip + "Trackback: " + "Not Provided";
}
return _.escape(comment);
} | 1 | JavaScript | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product 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 is_content_type(request, ...types) {
const type = request.headers.get('content-type')?.split(';', 1)[0].trim() ?? '';
return types.includes(type.toLowerCase());
} | 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 |
const newWrapped = (error, sst) => {
const sandboxSst = ensureThis(sst);
if (localArrayIsArray(sst)) {
if (sst === sandboxSst) {
for (let i=0; i < sst.length; i++) {
const cs = sst[i];
if (typeof cs === 'object' && localReflectGetPrototypeOf(cs) === OriginalCallSite.prototype) {
sst[i] = new CallSite(cs);
}
}
} else {
sst = [];
for (let i=0; i < sandboxSst.length; i++) {
const cs = sandboxSst[i];
localReflectDefineProperty(sst, i, {
__proto__: null,
value: new CallSite(cs),
enumerable: true,
configurable: true,
writable: true
});
}
}
} else {
sst = sandboxSst;
}
return value(error, sst);
};
localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [value, newWrapped]);
localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [newWrapped, newWrapped]);
currentPrepareStackTrace = newWrapped;
} | 1 | JavaScript | CWE-913 | Improper Control of Dynamically-Managed Code Resources | The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | https://cwe.mitre.org/data/definitions/913.html | safe |
value: new CallSite(cs),
enumerable: true,
configurable: true,
writable: true
});
}
}
} else {
sst = sandboxSst;
}
return value(error, sst);
}; | 1 | JavaScript | CWE-913 | Improper Control of Dynamically-Managed Code Resources | The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | https://cwe.mitre.org/data/definitions/913.html | safe |
coder: () => ')'
});
} else if (nodeType === 'Identifier') {
if (node.name === INTERNAL_STATE_NAME) {
if (internStateValiable === undefined || internStateValiable.start > node.start) {
internStateValiable = node;
}
} else if (node.name.startsWith(tmpname)) {
tmpname = node.name + '_UNIQUE';
}
} else if (nodeType === 'ImportExpression') {
insertions.push({
__proto__: null,
pos: node.start,
order: TO_RIGHT,
coder: () => INTERNAL_STATE_NAME + '.'
});
}
});
if (internStateValiable) {
throw makeNiceSyntaxError('Use of internal vm2 state variable', code, filename, internStateValiable.start, {
__proto__: null,
start: internStateValiable.start,
end: internStateValiable.end
});
}
if (insertions.length === 0) return {__proto__: null, code, hasAsync};
insertions.sort((a, b) => (a.pos == b.pos ? a.order - b.order : a.pos - b.pos));
let ncode = '';
let curr = 0;
for (let i = 0; i < insertions.length; i++) {
const change = insertions[i];
ncode += code.substring(curr, change.pos) + change.coder();
curr = change.pos;
}
ncode += code.substring(curr);
return {__proto__: null, code: ncode, hasAsync};
} | 1 | JavaScript | CWE-913 | Improper Control of Dynamically-Managed Code Resources | The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | https://cwe.mitre.org/data/definitions/913.html | safe |
coder: () => `catch(${tmpname}){try{throw(${tmpname}=${INTERNAL_STATE_NAME}.handleException(${tmpname}));}`
}); | 1 | JavaScript | CWE-913 | Improper Control of Dynamically-Managed Code Resources | The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | https://cwe.mitre.org/data/definitions/913.html | safe |
coder: () => `${name}=${INTERNAL_STATE_NAME}.handleException(${name});`
}); | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
args[1] = function wrapper(error) {
error = ensureThis(error);
return localReflectApply(onRejected, this, [error]);
}; | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
apply(target, thiz, args) {
if (args.length > 1) {
const onRejected = args[1];
if (typeof onRejected === 'function') {
args[1] = function wrapper(error) {
error = ensureThis(error);
return localReflectApply(onRejected, this, [error]);
};
}
}
return localReflectApply(target, thiz, args);
} | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
function wrapProxyHandler(args) {
if (args.length < 2) return args;
const handler = args[1];
args[1] = new LocalProxy({__proto__: null, handler}, proxyHandlerHandler);
return args;
} | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
construct(target, args, newTarget) {
return localReflectConstruct(target, makeSafeHandlerArgs(args), newTarget);
} | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
get(target, name, receiver) {
const value = target.handler[name];
if (typeof value !== 'function') return value;
return new LocalProxy(value, makeSafeArgs);
} | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
function makeSafeHandlerArgs(args) {
const sArgs = ensureThis(args);
if (sArgs === args) return args;
const a = [];
for (let i=0; i < sArgs.length; i++) {
localReflectDefineProperty(a, i, {
__proto__: null,
value: sArgs[i],
enumerable: true,
configurable: true,
writable: true
});
}
return a;
} | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
apply(target, thiz, args) {
return localReflectApply(target, thiz, makeSafeHandlerArgs(args));
}, | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
value: bridge.from(sandboxGlobal),
enumerable: true
},
_runScript: {__proto__: null, value: runScript},
_makeReadonly: {__proto__: null, value: makeReadonly},
_makeProtected: {__proto__: null, value: makeProtected},
_addProtoMapping: {__proto__: null, value: addProtoMapping},
_addProtoMappingFactory: {__proto__: null, value: addProtoMappingFactory},
_compiler: {__proto__: null, value: resolvedCompiler},
_allowAsync: {__proto__: null, value: allowAsync}
});
this.readonly(inspect);
// prepare global sandbox
if (sandbox) {
this.setGlobals(sandbox);
}
} | 1 | JavaScript | NVD-CWE-noinfo | null | null | null | safe |
const readFiles = function(files) {
fs.readFile(files[0], Tesseract.outputEncoding, function(err, data) {
if (err) {
callback(err, null);
return;
}
var index = Tesseract.tmpFiles.indexOf(output);
if (~index) Tesseract.tmpFiles.splice(index, 1);
fs.unlinkSync(files[0]);
callback(null, data, extra);
});
}; | 1 | JavaScript | CWE-77 | Improper Neutralization of Special Elements used in a Command ('Command Injection') | The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/77.html | safe |
EditorUi.prototype.setScrollbars=function(a){var b=this.editor.graph,f=b.container.style.overflow;b.scrollbars=a;this.editor.updateGraphComponents();f!=b.container.style.overflow&&(b.container.scrollTop=0,b.container.scrollLeft=0,b.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
2-l.y)/q.height*2));this.state.style.arrowSize=Math.max(0,Math.min(c,(q.x+q.width-l.x)/q.width))})]}},gb=function(c){return function(h){return[Ra(h,["size"],function(q){var l=Math.max(0,Math.min(.5*q.height,parseFloat(mxUtils.getValue(this.state.style,"size",c))));return new mxPoint(q.x,q.y+l)},function(q,l){this.state.style.size=Math.max(0,l.y-q.y)},!0)]}},Wa=function(c,h,q){return function(l){var p=[Ra(l,["size"],function(v){var w=Math.max(0,Math.min(v.width,Math.min(v.height,parseFloat(mxUtils.getValue(this.state.style, | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Sidebar.prototype.createDragSource=function(a,b,f,e,g){function d(Z,oa){var va=mxUtils.createImage(Z.src);va.style.width=Z.width+"px";va.style.height=Z.height+"px";null!=oa&&va.setAttribute("title",oa);mxUtils.setOpacity(va,Z==this.refreshTarget?30:20);va.style.position="absolute";va.style.cursor="crosshair";return va}function k(Z,oa,va,Ja){null!=Ja.parentNode&&(mxUtils.contains(va,Z,oa)?(mxUtils.setOpacity(Ja,100),L=Ja):mxUtils.setOpacity(Ja,Ja==fa?30:20));return va}for(var n=this.editorUi,u=n.editor.graph, | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
1<b.vertices.length);this.menus.get("align").setEnabled(b.unlocked&&0<b.cells.length);this.updatePasteActionStates()};EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(a){return null!=this.graph.getCellStyle(a).childLayout};this.layoutManager.getLayout=function(a,b){var f=this.graph.model.getParent(a);if(!this.graph.isCellCollapsed(a)&&(b!=mxEvent.BEGIN_UPDATE||this.hasLayout(f,b))){a=this.graph.getCellStyle(a);if("stackLayout"==a.childLayout)return b=new mxStackLayout(this.graph,!0),b.resizeParentMax="1"==mxUtils.getValue(a,"resizeParentMax", | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Graph.prototype.convertValueToString=function(a){var b=this.model.getValue(a);if(null!=b&&"object"==typeof b){var f=null;if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){b=a.getAttribute("placeholder");for(var e=a;null==f&&null!=e;)null!=e.value&&"object"==typeof e.value&&(f=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e)}else f=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(f=b.getAttribute("label_"+Graph.diagramLanguage)),
null==f&&(f=b.getAttribute("label")||"");return f||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
function(t){var z=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*z+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(t,z){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(z.getEvent)};mxGraphView.prototype.formatUnitText=function(t){return t?b(t,this.unit):t};mxGraphHandler.prototype.updateHint=function(t){if(null!=this.pBounds&&(null!=this.shape|| | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
EditorUi.prototype.executeLayout=function(a,b,f){var e=this.editor.graph;if(e.isEnabled()){e.getModel().beginUpdate();try{a()}catch(g){throw g;}finally{this.allowAnimation&&b&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("Camino"))?(a=new mxMorphing(e),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){e.getModel().endUpdate();null!=f&&f()})),a.startAnimation()):(e.getModel().endUpdate(),null!=f&&f())}}}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
TableLayout.prototype.layoutRow=function(a,b,f,e){var g=this.graph.getModel(),d=g.getChildCells(a,!0);a=this.graph.getActualStartSize(a,!0);var k=a.x,n=0;null!=b&&(b=b.slice(),b.splice(0,0,a.x));for(var u=0;u<d.length;u++){var m=this.graph.getCellGeometry(d[u]);null!=m&&(m=m.clone(),m.y=a.y,m.height=f-a.y-a.height,null!=b?(m.x=b[u],m.width=b[u+1]-m.x,u==d.length-1&&u<b.length-2&&(m.width=e-m.x-a.x-a.width)):(m.x=k,k+=m.width,u==d.length-1?m.width=e-a.x-a.width-n:n+=m.width),m.alternateBounds=new mxRectangle(0,
0,m.width,m.height),g.setGeometry(d[u],m))}return n}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,f=b.editor.graph,e=b.getSelectionState();a.style.paddingTop="4px";a.style.paddingBottom="0px";var g=document.createElement("table");g.style.width="210px";g.style.fontWeight="bold";g.style.tableLayout="fixed";var d=document.createElement("tbody"),k=document.createElement("tr");k.style.padding="0px";var n=document.createElement("td");n.style.padding="0px";n.style.width="50%";n.setAttribute("valign","top");var u=n.cloneNode(!0);u.style.paddingLeft=
"8px";k.appendChild(n);k.appendChild(u);d.appendChild(k);g.appendChild(d);a.appendChild(g);var m=n,r=0,x=mxUtils.bind(this,function(C,F,K){C=this.createCellOption(C,F,K);C.style.width="100%";m.appendChild(C);m=m==n?u:n;r++}),A=mxUtils.bind(this,function(C,F,K){e=b.getSelectionState();n.innerHTML="";u.innerHTML="";m=n;e.rounded&&x(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);e.swimlane&&x(mxResources.get("divider"),"swimlaneLine",1);e.containsImage||x(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,
0);e.glass&&x(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);x(mxResources.get("sketch"),"sketch",0)});f.getModel().addListener(mxEvent.CHANGE,A);this.listeners.push({destroy:function(){f.getModel().removeListener(A)}});A();return a};StyleFormatPanel.prototype.addStyleOps=function(a){a.style.paddingTop="10px";a.style.paddingBottom="10px";this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,f){BaseFormatPanel.call(this,a,b,f);this.init()}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);null!=this.tooltip&&(this.tooltip.style.display="none",this.currentElt=null);this.tooltipMouseDown=null};Sidebar.prototype.addDataEntry=function(a,b,f,e,g){return this.addEntry(a,mxUtils.bind(this,function(){return this.createVertexTemplateFromData(g,b,f,e)}))}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
EditorUi.prototype.showImageDialog=function(a,b,f,e){e=this.editor.graph.cellEditor;var g=e.saveSelection(),d=mxUtils.prompt(a,b);e.restoreSelection(g);if(null!=d&&0<d.length){var k=new Image;k.onload=function(){f(d,k.width,k.height)};k.onerror=function(){f(null);mxUtils.alert(mxResources.get("fileNotFound"))};k.src=d}else f(null)};EditorUi.prototype.showLinkDialog=function(a,b,f){a=new LinkDialog(this,a,b,f);this.showDialog(a.container,420,90,!0,!0);a.init()}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Sidebar.prototype.removePalette=function(a){var b=this.palettes[a];if(null!=b){this.palettes[a]=null;for(a=0;a<b.length;a++)this.container.removeChild(b[a]);return!0}return!1}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
q,p));q=p}return h};mxCellRenderer.registerShape("tableLine",a);mxUtils.extend(b,mxSwimlane);b.prototype.getLabelBounds=function(c){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};b.prototype.paintVertexShape=function(c,h,q,l,p){var v=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,w=this.isHorizontal(),J=this.getTitleSize();0==J||this.outline?Da.prototype.paintVertexShape.apply(this,
arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),c.translate(-h,-q));v||this.outline||!(w&&J<p||!w&&J<l)||this.paintForeground(c,h,q,l,p)};b.prototype.paintForeground=function(c,h,q,l,p){if(null!=this.state){var v=this.flipH,w=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var J=v;v=w;w=J}c.rotate(-this.getShapeRotation(),v,w,h+l/2,q+p/2);s=this.scale;h=this.bounds.x/s;q=this.bounds.y/s;l=this.bounds.width/s;p=this.bounds.height/ | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Menus.prototype.styleChange=function(a,b,f,e,g,d,k,n,u){var m=this.createStyleChangeFunction(f,e);a=a.addItem(b,null,mxUtils.bind(this,function(){var r=this.editorUi.editor.graph;null!=k&&r.cellEditor.isContentEditing()?k():m(n)}),d,g);u&&this.showIconOnly(a);return a}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
function Action(a,b,f,e,g){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=f?f:!0;this.iconCls=e;this.shortcut=g;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Menus.prototype.menuCreated=function(a,b,f){null!=b&&(f=null!=f?f:"geItem",a.addListener("stateChanged",function(){(b.enabled=a.enabled)?(b.className=f,8==document.documentMode&&(b.style.color="")):(b.className=f+" mxDisabled",8==document.documentMode&&(b.style.color="#c3c3c3"))}))};function Menubar(a,b){this.editorUi=a;this.container=b}Menubar.prototype.hideMenu=function(){this.editorUi.hideCurrentMenu()}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
d));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.getCurrentCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.getCurrentCellStyle(a);return null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
A.message)}};EditorUi.prototype.openDatabase=function(d,g){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var l=k.open("database",2);l.onupgradeneeded=function(p){try{var q=l.result;1>p.oldVersion&&q.createObjectStore("objects",{keyPath:"key"});2>p.oldVersion&&(q.createObjectStore("files",{keyPath:"title"}),q.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(x){null!=g&&g(x)}};l.onsuccess= | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Sidebar.prototype.createThumb=function(a,b,f,e,g,d,k){this.graph.labelsVisible=null==d||d;d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;this.graph.view.scaleAndTranslate(1,0,0);this.graph.addCells(a);a=this.graph.getGraphBounds();var n=Math.floor(100*Math.min((b-2*this.thumbBorder)/a.width,(f-2*this.thumbBorder)/a.height))/100;this.graph.view.scaleAndTranslate(n,Math.floor((b-a.width*n)/2/n-a.x),Math.floor((f-a.height*n)/2/n-a.y));this.graph.dialect!=mxConstants.DIALECT_SVG|| | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
DiagramFormatPanel.prototype.addGridOption=function(a){function b(u){var m=f.isFloatUnit()?parseFloat(d.value):parseInt(d.value);m=f.fromUnit(Math.max(f.inUnit(1),isNaN(m)?f.inUnit(10):m));m!=g.getGridSize()&&(mxGraph.prototype.gridSize=m,g.setGridSize(m));d.value=f.inUnit(m)+" "+f.getUnit();mxEvent.consume(u)}var f=this,e=this.editorUi,g=e.editor.graph,d=document.createElement("input");d.style.position="absolute";d.style.textAlign="right";d.style.width="48px";d.style.marginTop="-2px";d.style.height=
"21px";d.style.border="1px solid rgb(160, 160, 160)";d.style.borderRadius="4px";d.style.boxSizing="border-box";d.value=this.inUnit(g.getGridSize())+" "+this.getUnit();var k=this.createStepper(d,b,this.getUnitStep(),null,null,null,this.isFloatUnit());d.style.display=g.isGridEnabled()?"":"none";k.style.display=d.style.display;mxEvent.addListener(d,"keydown",function(u){13==u.keyCode?(g.container.focus(),mxEvent.consume(u)):27==u.keyCode&&(d.value=g.getGridSize(),g.container.focus(),mxEvent.consume(u))});
mxEvent.addListener(d,"blur",b);mxEvent.addListener(d,"change",b);d.style.right="78px";k.style.marginTop="-17px";k.style.right="66px";var n=this.createColorOption(mxResources.get("grid"),function(){var u=g.view.gridColor;return g.isGridEnabled()?u:null},function(u){var m=g.isGridEnabled();u==mxConstants.NONE?g.setGridEnabled(!1):(g.setGridEnabled(!0),e.setGridColor(u));d.style.display=g.isGridEnabled()?"":"none";k.style.display=d.style.display;m!=g.isGridEnabled()&&(g.defaultGridEnabled=g.isGridEnabled(),
e.fireEvent(new mxEventObject("gridEnabledChanged")))},Editor.isDarkMode()?g.view.defaultDarkGridColor:g.view.defaultGridColor,{install:function(u){this.listener=function(){u(g.isGridEnabled()?g.view.gridColor:null)};e.addListener("gridColorChanged",this.listener);e.addListener("gridEnabledChanged",this.listener)},destroy:function(){e.removeListener(this.listener)}});n.appendChild(d);n.appendChild(k);a.appendChild(n)}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
"da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(d,g,k,l,p,q,x,y){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(d,g,k,l,p,q,x,y)};EditorUi.prototype.loadFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(d)};EditorUi.prototype.createSvgDataUri=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(d)};EditorUi.prototype.embedCssFonts=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts"); | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
function ja(){mxRhombus.call(this)}function ta(){mxEllipse.call(this)}function Ba(){mxEllipse.call(this)}function Da(){mxEllipse.call(this)}function Ma(){mxEllipse.call(this)}function La(){mxActor.call(this)}function Ia(){mxActor.call(this)}function Ea(){mxActor.call(this)}function Fa(c,h,q,l){mxShape.call(this);this.bounds=c;this.fill=h;this.stroke=q;this.strokewidth=null!=l?l:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Oa(){mxConnector.call(this)} | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus())}),0)))};EditorUi.prototype.ctrlEnter=function(){var a=this.editor.graph;if(a.isEnabled())try{for(var b=a.getSelectionCells(),f=new mxDictionary,e=[],g=0;g<b.length;g++){var d=a.isTableCell(b[g])?a.model.getParent(b[g]):b[g];null==d||f.get(d)||(f.put(d,!0),e.push(d))}a.setSelectionCells(a.duplicateCells(e,!1))}catch(k){this.handleError(k)}}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
"keys",f,"values",e,"cells",r))}finally{u.getModel().endUpdate()}}),d,g))};Menus.prototype.showIconOnly=function(a){var b=a.getElementsByTagName("td");for(i=0;i<b.length;i++)"mxPopupMenuItem"==b[i].getAttribute("class")&&(b[i].style.display="none");return a}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Graph.prototype.getFlowAnimationStyleCss=function(a){return"."+a+" {\nanimation: "+a+" 0.5s linear;\nanimation-iteration-count: infinite;\n}\n@keyframes "+a+" {\nto {\nstroke-dashoffset: "+-16*this.view.scale+";\n}\n}"};Graph.prototype.stringToBytes=function(a){return Graph.stringToBytes(a)};Graph.prototype.bytesToString=function(a){return Graph.bytesToString(a)};Graph.prototype.compressNode=function(a){return Graph.compressNode(a)};Graph.prototype.compress=function(a,b){return Graph.compress(a,b)}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
"keys",[b],"values",[A],"cells",C))}finally{r.getModel().endUpdate()}}},{install:function(A){this.listener=function(){A(mxUtils.getValue(x,b,f)!=g)};r.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){r.getModel().removeListener(this.listener)}})}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
EditorUi.prototype.getCellsForShapePicker=function(a,b){b=mxUtils.bind(this,function(f,e,g,d){return this.editor.graph.createVertex(null,null,d||"",0,0,e||120,g||60,f,!1)});return[null!=a?this.editor.graph.cloneCell(a):b("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",40,20,"Text"),b("whiteSpace=wrap;html=1;"),b("ellipse;whiteSpace=wrap;html=1;"),b("rhombus;whiteSpace=wrap;html=1;",80,80),b("rounded=1;whiteSpace=wrap;html=1;"),b("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),
b("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),b("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),b("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),b("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),b("triangle;whiteSpace=wrap;html=1;",60,80),b("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),b("shape=tape;whiteSpace=wrap;html=1;",120,100),b("ellipse;shape=cloud;whiteSpace=wrap;html=1;",
120,80),b("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),b("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",40,40)]};EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,a||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
F()};TextFormatPanel=function(a,b,f){BaseFormatPanel.call(this,a,b,f);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.style.borderBottom="none";this.addFont(this.container)}; | 1 | JavaScript | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | safe |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.