Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-82 (Web页面IMG标签属性中脚本转义处理不恰当) — Vulnerability Class 7

7 vulnerabilities classified as CWE-82 (Web页面IMG标签属性中脚本转义处理不恰当). AI Chinese analysis included.

CWE-82 represents a critical input validation weakness where web applications fail to properly sanitize scripting elements within HTML IMG tag attributes, such as the src parameter. This vulnerability allows attackers to inject malicious JavaScript code directly into image source URLs, which the browser interprets as executable commands rather than static resources. When a victim loads the compromised page, the embedded script automatically executes in their context, leading to cross-site scripting attacks that can steal session cookies, deface websites, or redirect users to phishing sites. To mitigate this risk, developers must implement rigorous input validation and output encoding strategies. Specifically, they should escape special characters like quotes and angle brackets within attribute values and employ Content Security Policy headers to restrict script execution sources, ensuring that only trusted content runs within the application environment.

MITRE CWE Description
The web application does not neutralize or incorrectly neutralizes scripting elements within attributes of HTML IMG tags, such as the src attribute. Attackers can embed XSS exploits into the values for IMG attributes (e.g. SRC) that is streamed and then executed in a victim's browser. Note that when the page is loaded into a user's browsers, the exploit will automatically execute.
Common Consequences (1)
Confidentiality, Integrity, AvailabilityRead Application Data, Execute Unauthorized Code or Commands
Mitigations (2)
ImplementationUse and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are i…
ImplementationTo help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is n…
Effectiveness: Defense in Depth

Vulnerabilities classified as CWE-82 (Web页面IMG标签属性中脚本转义处理不恰当) represent 7 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.