Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Permissive Cross-domain Security Policy with Untrusted Domains
This vulnerability occurs when a web application's cross-domain security policy, like a Content Security Policy (CSP), explicitly allows communication with untrusted or overly permissive external…
What is CWE-942?
Real-world CVEs caused by CWE-942
-
Product has a Silverlight cross-domain policy that does not restrict access to another application, which allows remote attackers to bypass the Same Origin Policy.
-
The default Flash Cross Domain policies in a product allows remote attackers to access user files.
-
Chain: Adobe Flash Player does not sufficiently restrict the interpretation and usage of cross-domain policy files, which makes it easier for remote attackers to conduct cross-domain and cross-site scripting (XSS) attacks.
-
Chain: Adobe Flash Player and earlier does not properly interpret policy files, which allows remote attackers to bypass a non-root domain policy.
-
Chain: Adobe Flash Player does not properly handle unspecified encodings during the parsing of a cross-domain policy file, which allows remote web servers to bypass intended access restrictions via unknown vectors.
Angreiferpfad Schritt für Schritt
- 1
These cross-domain policy files mean to allow Flash and Silverlight applications hosted on other domains to access its data:
- 2
Flash crossdomain.xml :
- 3
Silverlight clientaccesspolicy.xml :
- 4
These entries are far too permissive, allowing any Flash or Silverlight application to send requests. A malicious application hosted on any other web site will be able to send requests on behalf of any user tricked into executing it.
Vulnerable XML
Flash crossdomain.xml :
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="*.example.com"/>
<allow-access-from domain="*"/>
</cross-domain-policy> Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
const safe = validateAndEscape(input);
return executeWithGuards(safe);
} How to prevent CWE-942
- Architecture and Design / Operation Define a restrictive Content Security Policy [REF-1486] or cross-domain policy file.
- Architecture and Design / Operation Avoid using wildcards in the CSP / cross-domain policy file. Any domain matching the wildcard expression will be implicitly trusted, and can perform two-way interaction with the target server.
- Architecture and Design / Operation For Flash, modify crossdomain.xml to use meta-policy options such as 'master-only' or 'none' to reduce the possibility of an attacker planting extraneous cross-domain policy files on a server.
How to detect CWE-942
Plexicus erkennt CWE-942 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.
Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.
Frequently asked questions
Was ist CWE-942?
This vulnerability occurs when a web application's cross-domain security policy, like a Content Security Policy (CSP), explicitly allows communication with untrusted or overly permissive external domains.
Wie gravierend ist CWE-942?
MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.
Welche Sprachen oder Plattformen sind von CWE-942 betroffen?
MITRE lists the following affected platforms: Web Based.
Wie kann ich CWE-942 verhindern?
Define a restrictive Content Security Policy [REF-1486] or cross-domain policy file. Avoid using wildcards in the CSP / cross-domain policy file. Any domain matching the wildcard expression will be implicitly trusted, and can perform two-way interaction with the target server.
Wie erkennt und behebt Plexicus CWE-942?
Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-942 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.
Wo erfahre ich mehr über CWE-942?
MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/942.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.
Weaknesses related to CWE-942
Incorrect Authorization
This vulnerability occurs when an application checks if a user is allowed to perform an action or access data, but the check is flawed or…
Internal Asset Exposed to Unsafe Debug Access Level or State
This vulnerability occurs when a system's debug or test interface supports multiple access levels, but an internal asset is incorrectly…
Incorrect Behavior Order: Authorization Before Parsing and Canonicalization
This vulnerability occurs when a web server checks access permissions before fully processing and normalizing a URL, potentially allowing…
Authorization Bypass Through User-Controlled Key
This vulnerability occurs when an application's authorization system fails to verify that a user is allowed to access specific data before…
Use of Non-Canonical URL Paths for Authorization Decisions
This vulnerability occurs when an application's authorization logic relies on specific URL paths but fails to enforce a single,…
Guessable CAPTCHA
This vulnerability occurs when a CAPTCHA challenge is too easy for automated bots to solve, either by guessing or using pattern…
Exposure of Resource to Wrong Sphere
This vulnerability occurs when an application unintentionally makes a resource accessible to users or systems that should not have…
Further reading
- MITRE — offizielle CWE-942 https://cwe.mitre.org/data/definitions/942.html
- Content Security Policy Cheat Sheet https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html
- Setting a crossdomain.xml file for HTTP streaming https://web.archive.org/web/20121124184922/http://www.adobe.com/devnet/adobe-media-server/articles/cross-domain-xml-for-streaming.html
- Cross-domain policy for Flash movies http://kb2.adobe.com/cps/142/tn_14213.html
- HTTP Communication and Security with Silverlight https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc838250(v=vs.95)?redirectedfrom=MSDN
- Network Security Access Restrictions in Silverlight https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc645032(v=vs.95)
- Analyzing the Crossdomain Policies of Flash Applications http://cseweb.ucsd.edu/~hovav/dist/crossdomain.pdf
Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.
Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.