CWE-610: Externally Controlled Reference to a Resource in Another Sphere
Official CWE-610 CWE context with Glexia analysis, remediation guidance, related CVEs, and ATT&CK context.
Glexia's Take
CWE-610: Externally Controlled Reference to a Resource in Another Sphere
Externally Controlled Reference to a Resource in Another Sphere represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Confidentiality,Integrity: Read Application Data,Modify Application Data: An adversary could read or modify data, depending on how the resource is intended to be used.
- Access Control: Gain Privileges or Assume Identity: An adversary that can supply a reference to an unintended resource can potentially access a resource that they do not have privileges for, thus bypassing existing access control mechanisms.
Developer Pattern
CWE-610 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Confidence
high confidence from CWE-610, 4.20.
Official CWE Definition
CWE-610: Externally Controlled Reference to a Resource in Another Sphere
The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- The following code is a Java servlet that will receive a GET request with a url parameter in the request to redirect the browser to the address specified in the url parameter. The servlet will retrieve the url parameter value from the request and send a response to redirect the browser to the url address. The problem with this Java servlet code is that an attacker could use the RedirectServlet as part of an e-mail phishing scam to redirect users to a malicious site. An attacker could send an HTML formatted e-mail directing the user to log into their account by including in the e-mail the following link:,The user may assume that the link is safe since the URL starts with their trusted bank, bank.example.com. However, the user will then be redirected to the attacker's web site (attacker.example.net) which the attacker may have made to appear very similar to bank.example.com. The user may then unwittingly enter credentials into the attacker's web page and compromise their bank account. A Java servlet should never redirect a user to a URL without verifying that the redirect address is a trusted site.
Remediation
- Use safe APIs
- Centralize the control
- Add regression tests
- Review logs and telemetry for attempted abuse
Detection
- Code review
- SAST
- DAST
- Focused regression tests
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
- CWE-1021: Improper Restriction of Rendered UI Layers or Frames
- CWE-15: External Control of System or Configuration Setting
- CWE-384: Session Fixation
- CWE-384: Session Fixation
- CWE-386: Symbolic Name not Mapping to Correct Object
- CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')
- CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
- CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
- CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
- CWE-664: Improper Control of a Resource Through its Lifetime
- CWE-611: Improper Restriction of XML External Entity Reference
- CWE-611: Improper Restriction of XML External Entity Reference
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.