We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ae0c7e commit a453405Copy full SHA for a453405
javascript/ql/src/Security/CWE-918/examples/RequestForgeryBad.js
@@ -1,8 +1,7 @@
1
import http from 'http';
2
-import url from 'url';
3
4
-var server = http.createServer(function(req, res) {
5
- var target = url.parse(req.url, true).query.target;
+const server = http.createServer(function(req, res) {
+ const target = new URL(req.url).searchParams.get("target");
6
7
// BAD: `target` is controlled by the attacker
8
http.get('https://' + target + ".example.com/data/", res => {
0 commit comments