Open armorcodegithubpreprod[bot] opened 5 months ago
Finding [47833785|https://preprod.armorcode.ai/#/findings/257/1167/47833785], [47833784|https://preprod.armorcode.ai/#/findings/257/1167/47833784] are Mitigated
by SYSTEM via ArmorCode Platform
Finding [47833785|https://preprod.armorcode.ai/#/findings/257/1167/47833785] , [47833784|https://preprod.armorcode.ai/#/findings/257/1167/47833784] status changed to Confirmed
Note:
by SYSTEM via ArmorCode Platform
Findings for SCA, Medium, [TheRedHatter/javagoof:todolist-web-struts/pom.xml]:Cross-site Scripting (XSS)
Component Details
Overview
org.apache.struts:struts2-core
Cross-site Scripting (XSS) vulnerability in the URLDecoder function in JRE before 1.8, as used in Apache Struts 2.x before 2.3.28, when using a single byte page encoding, allows remote attackers to inject arbitrary web script or HTML via multi-byte characters in a url-encoded parameter.Details
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
ֿInjecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML,
<
can be coded as<
; and>
can be coded as>
; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses<
and>
as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
Types of attacks
There are a few methods by which XSS can be manipulated:
Affected environments
The following environments are susceptible to an XSS attack:
How to prevent
This section describes the top best practices designed to specifically protect your code:
?
,&
,/
,<
,>
and spaces to their respective HTML or URL encoded equivalents.References
Component Details
Overview
org.apache.struts.xwork:xwork-core
Apache Struts 2.x before 2.3.25 does not sanitize text in the Locale object constructed by I18NInterceptor, which might allow remote attackers to conduct cross-site scripting (XSS) attacks via unspecified vectors involving language display.Details
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
ֿInjecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML,
<
can be coded as<
; and>
can be coded as>
; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses<
and>
as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
Types of attacks
There are a few methods by which XSS can be manipulated:
Affected environments
The following environments are susceptible to an XSS attack:
How to prevent
This section describes the top best practices designed to specifically protect your code:
?
,&
,/
,<
,>
and spaces to their respective HTML or URL encoded equivalents.References