Skip to content

Commit

Permalink
Make GitHub ribbon color customizable via parameter gitHubRibbon
Browse files Browse the repository at this point in the history
(possible leverage point for #217)
  • Loading branch information
bkimminich committed Dec 30, 2017
1 parent adb9d9c commit e7c8735
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/fileUpload.js
Expand Up @@ -17,7 +17,11 @@ exports = module.exports = function fileUpload () {
utils.solve(challenges.deprecatedInterfaceChallenge)
}
if (file.buffer) {
const xmlDoc = libxml.parseXml(file.buffer.toString(), { noblanks: true, noent: true, nocdata: true })
const data = file.buffer.toString()
if (utils.contains(data, '/dev/random')) { // circuit breaker to prevent common DoS attack
next(new Error('Blocked illegal activity by ' + req.connection.remoteAddress))
}
const xmlDoc = libxml.parseXml(data, { noblanks: true, noent: true, nocdata: true })
const xmlString = xmlDoc.toString()
if (utils.notSolved(challenges.xxeFileDisclosureChallenge) && (matchesSystemIniFile(xmlString) || matchesEtcPasswdFile(xmlString))) {
utils.solve(challenges.xxeFileDisclosureChallenge)
Expand Down

0 comments on commit e7c8735

Please sign in to comment.