Skip to content

Commit 09b65fc

Browse files
Merge pull request #8 from shiftleft-chuck/ReIntroduce_XSS
Update ImageLookup.js
2 parents 9f3ae5e + b526616 commit 09b65fc

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/Controllers/ImageLookup.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,22 @@ class ImageLookup {
77
/* Can read any file in the server by passing the filename (image) in the query params */
88
/* ex: http GET http://localhost:8089/api/v1/image-lookup image=="package.json" */
99
const fileContent = fs.readFileSync(req.query.image).toString();
10-
string sanitizedString = sanitizeString(fileContent)
11-
logger.debug(sanitizedString);
12-
// logger.debug(fileContent);
10+
11+
// **************************************************
12+
// ************************************************** Vulnerable Code Block *****
13+
14+
logger.debug(fileContent);
15+
16+
// **************************************************
17+
18+
// ************************************************** Remediated Code Block *****
19+
20+
// string sanitizedStr = sanitizeString(fileContent)
21+
// fileContent = sanitizedStr;
22+
// logger.debug(sanitizedStr);
23+
24+
// **************************************************
25+
1326
res.send(fileContent);
1427
}
1528

0 commit comments

Comments
 (0)