Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/workflows/src/cookie-reflection/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function run({ request, response }, sdk) {
description: `The response from ${request.getUrl()} contains the value "${cookie_val}" which is also the value of the cookie "${cookie_name}"`,
request: request,
reporter: "CookieValueReflectedInResponse",
dedupeKey: `cookie_reflect_${request.getUrl()}_${cookie_name}_${cookie_val}`,
dedupeKey: `cookie_reflect_${request.getHost()}${request.getPath()()}_${cookie_name}_${cookie_val}`,
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ export async function run({ request, response }, sdk) {
if (body.startsWith("{") || body.startsWith("[")) {
// Regex to ignore application/json application/manifest+json
if (!contentTypeHeader[0].match(/^application\/(\w*\+)?json/)) {
const description = `The content of response from ${request.getHost()}${request.getPath()} is probably JSON but the content type is not application/json`;
await sdk.findings.create({
title: "JSON Response Without JSON Content-Type",
description: description,
request: request,
reporter: "JSON Response Without JSON Content-Type",
dedupeKey: description,
});
if (!contentTypeHeader[0].match(/^text\/(javascript|css)/)) {
let description = `The content of response from ${request.getHost()}${request.getPath()} is probably JSON but the content type is not application/json`;
await sdk.findings.create({
title: "JSON Response Without JSON Content-Type",
description: description,
request: request,
reporter: "JSON Response Without JSON Content-Type",
dedupeKey: description,
});
}
}
}
}
Expand Down