You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
can produce Express "Failed to decode param" errors in some situations that didn't have this outcome in CVE Services 1.1.1. This might be a realistic risk for older browsers such as Internet Explorer, in which XSS might be achievable by an attacker who does not have the ability to embed an XSS payload inside a CVE Record.
For example, inserting a '%' character after a valid route has this behavior in recent dev versions:
% curl https://cveawg-test.mitre.org/api/cve/%abc
{"error":"INVALID_JSON_SYNTAX","message":"Failed to decode param '%abc'"}
whereas there was no reflected content in CVE Services 1.1.1:
% curl https://cveawg.mitre.org/api/cve/%abc
{"error":"SERVICE_NOT_AVAILABLE","message":"This service appears to not be available."}
The behavior is better demonstrated by testing locally, which removes the complication of an AWS-maintained Web Application Firewall that, in general, may be able to block some but not all attacks.
% curl http://localhost:3000/api/cve/%\<SCRIPT\>alert\(document.domain\)\<.html
{"error":"INVALID_JSON_SYNTAX","message":"Failed to decode param '%<SCRIPT>alert(document.domain)<.html'"}
The response has various headers that may make exploitation impractical in most web browsers:
However, https://www.adico.me/post/json-based-xss-exploitation states that Internet Explorer (possibly version 9 and earlier) ignores the application/json Content-Type in some situations involving URLs with .html at the end, and behaves as if the Content-Type were text/html.
If a fix for this is desired, one possibility is to change src/middleware/middleware.js so that
cve-services/src/middleware/middleware.js
Lines 284 to 287 in 8a76dc9
can produce Express "Failed to decode param" errors in some situations that didn't have this outcome in CVE Services 1.1.1. This might be a realistic risk for older browsers such as Internet Explorer, in which XSS might be achievable by an attacker who does not have the ability to embed an XSS payload inside a CVE Record.
For example, inserting a '%' character after a valid route has this behavior in recent dev versions:
whereas there was no reflected content in CVE Services 1.1.1:
The behavior is better demonstrated by testing locally, which removes the complication of an AWS-maintained Web Application Firewall that, in general, may be able to block some but not all attacks.
The response has various headers that may make exploitation impractical in most web browsers:
However, https://www.adico.me/post/json-based-xss-exploitation states that Internet Explorer (possibly version 9 and earlier) ignores the application/json Content-Type in some situations involving URLs with .html at the end, and behaves as if the Content-Type were text/html.
If a fix for this is desired, one possibility is to change src/middleware/middleware.js so that
is replaced by
With this change, the request/response would be:
The text was updated successfully, but these errors were encountered: