Secret Message
Steven_The_GuyT (202)

I got an email this week, containing a secret message! I wasn't able to decipher it, but has anyone else been able? Don't tell us how to(no spoiling), just tell us if you did!

You are viewing a single comment. View All
IzanLarumbe (28)

@IzanLarumbe `
// Find the security vulnerability and exploit

let express = require('express');
let fs = require('fs');
let app = express();

let password = process.env.PASSWORD;

if ( !/^[a-z]{8,20}$/.test(password) ) {
console.log("Plese setup your password");
process.exit(1);
}

app.use((req, res, next) => {
let start = process.hrtime()[1];
res.respond = (data) => {
res.contentType('text/plain;charset=utf8');
res.header('X-ProcessingTime', process.hrtime()[1] - start);
res.end(data);
};
next()
});

app.get('/', (req, res) => {
fs.readFile('index.js', "utf8", (err, data) => {
res.respond(data);
});
});

app.get('/info', (req, res) => {
if ( req.query.password == password ) {
res.respond(process.env.INFO);
} else {
res.respond("Password Incorrect");
}
});

app.listen(3000, () => {
console.log('server started');
})`