Update RequestForgeryBad.js

This commit is contained in:
Matt Rothenberg
2022-12-02 14:17:37 +01:00
committed by GitHub
parent 7d674e7cdc
commit 95f994a82b

View File

@@ -1,7 +1,7 @@
import http from 'http';
const server = http.createServer(function(req, res) {
const target = new URL(req.url).searchParams.get("target");
const target = new URL(req.url, "http://example.com").searchParams.get("target");
// BAD: `target` is controlled by the attacker
http.get('https://' + target + ".example.com/data/", res => {