Summary
GeoNetwork error pages can reflect attacker-controlled request content into an AngularJS application without adequately preventing template evaluation. If a victim opens a crafted link that triggers the affected error page, the reflected content may execute JavaScript in the victim's authenticated browser session.
GeoNetwork error pages can reflect attacker-controlled request content into an AngularJS application without adequately preventing template evaluation. If a victim opens a crafted link that triggers the affected error page, the reflected content may execute JavaScript in the victim's authenticated browser session.
Affected context
The issue occurs in GeoNetwork error handling for requests to nonexistent or unauthorized service URLs. It becomes risky when request content is inserted into an AngularJS page where it can be interpreted as a template expression rather than rendered as inert text. The described affected release lines are fixed in versions 4.2.15 and 4.4.10.
The issue occurs in GeoNetwork error handling for requests to nonexistent or unauthorized service URLs. It becomes risky when request content is inserted into an AngularJS page where it can be interpreted as a template expression rather than rendered as inert text. The described affected release lines are fixed in versions 4.2.15 and 4.4.10.
Exploit preconditions
- Attack surface: GeoNetwork pages that handle nonexistent or unauthorized service URLs
- Required access: An attacker can send a crafted link to a victim; the victim must open it. The attacker does not necessarily need an account, though deployment access controls may affect reachability.
- Trigger point: The victim's browser renders the error page produced by the crafted request.
- Why exploitation is possible: Attacker-controlled content is reflected into an AngularJS context without adequate neutralization, allowing template evaluation. Known AngularJS sandbox-escape techniques may then enable JavaScript execution.
- Attack surface: GeoNetwork pages that handle nonexistent or unauthorized service URLs
- Required access: An attacker can send a crafted link to a victim; the victim must open it. The attacker does not necessarily need an account, though deployment access controls may affect reachability.
- Trigger point: The victim's browser renders the error page produced by the crafted request.
- Why exploitation is possible: Attacker-controlled content is reflected into an AngularJS context without adequate neutralization, allowing template evaluation. Known AngularJS sandbox-escape techniques may then enable JavaScript execution.
Why this happens
The application treats request-derived content as safe for insertion into an AngularJS page, where it can be evaluated as a template expression. This is a client-side template injection pattern associated with CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine. Because the evaluated content can execute script in the victim's browser, the issue also relates to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
The application treats request-derived content as safe for insertion into an AngularJS page, where it can be evaluated as a template expression. This is a client-side template injection pattern associated with CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine. Because the evaluated content can execute script in the victim's browser, the issue also relates to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Potential impact
- JavaScript may execute in a victim's authenticated browser session.
- An attacker could disclose information accessible to the victim.
- Actions could be performed with the victim's application privileges.
- Administrator sessions may be at risk if administrators open crafted links.
- JavaScript may execute in a victim's authenticated browser session.
- An attacker could disclose information accessible to the victim.
- Actions could be performed with the victim's application privileges.
- Administrator sessions may be at risk if administrators open crafted links.
General mitigation guidance
Common defensive patterns focus on keeping untrusted request data out of executable template contexts:
- Render request-derived values as inert text using context-appropriate output encoding.
- Avoid compiling or evaluating templates that contain user-controlled content; use fixed templates with safely bound data instead.
- Reduce trust in URL and request parameters, and validate data against expected formats before use.
- Apply restrictive browser policies, such as a carefully configured Content Security Policy, as defense in depth rather than as a substitute for safe rendering.
- Limit application privileges so a compromised browser session has less authority.
Common defensive patterns focus on keeping untrusted request data out of executable template contexts:
- Render request-derived values as inert text using context-appropriate output encoding.
- Avoid compiling or evaluating templates that contain user-controlled content; use fixed templates with safely bound data instead.
- Reduce trust in URL and request parameters, and validate data against expected formats before use.
- Apply restrictive browser policies, such as a carefully configured Content Security Policy, as defense in depth rather than as a substitute for safe rendering.
- Limit application privileges so a compromised browser session has less authority.
How teams detect issues like this
- Use static analysis to identify request-derived data flowing into AngularJS template compilation, HTML rendering, or other evaluation-sensitive sinks.
- Review error-page templates and client-side bindings for dynamic template construction and missing context-aware encoding.
- Test error handling for reflected request content and verify that it is rendered as inert text.
- Enforce code-review or CI policies that prohibit compiling templates from untrusted data and require safe output handling.
- Automated security review tools may help identify risky source-to-sink flows.
- Use static analysis to identify request-derived data flowing into AngularJS template compilation, HTML rendering, or other evaluation-sensitive sinks.
- Review error-page templates and client-side bindings for dynamic template construction and missing context-aware encoding.
- Test error handling for reflected request content and verify that it is rendered as inert text.
- Enforce code-review or CI policies that prohibit compiling templates from untrusted data and require safe output handling.
- Automated security review tools may help identify risky source-to-sink flows.

