Summary
GRR contains a reflected cross-site scripting vulnerability in maj.php when the forcemaj parameter is reflected without adequate escaping.
An attacker can craft a malicious URL that executes JavaScript in a victim's browser when opened, potentially enabling phishing, redirection, cookie theft, or session hijacking.
GRR contains a reflected cross-site scripting vulnerability in maj.php when the forcemaj parameter is reflected without adequate escaping.
An attacker can craft a malicious URL that executes JavaScript in a victim's browser when opened, potentially enabling phishing, redirection, cookie theft, or session hijacking.
Affected context
The issue occurs in GRR deployments where:
- The
maj.phpendpoint remains accessible - Installation-related files have not been removed or otherwise restricted
- The
forcemajparameter is reflected into an HTTP response without context-appropriate output encoding - Authentication cookies are accessible to client-side scripts, such as when they are not marked
HttpOnly
Exploitation generally requires a victim to access an attacker-controlled URL or follow a malicious link.
The issue occurs in GRR deployments where:
- The
maj.phpendpoint remains accessible - Installation-related files have not been removed or otherwise restricted
- The
forcemajparameter is reflected into an HTTP response without context-appropriate output encoding - Authentication cookies are accessible to client-side scripts, such as when they are not marked
HttpOnly
Exploitation generally requires a victim to access an attacker-controlled URL or follow a malicious link.
Exploit preconditions
- Attack surface: The web-accessible
maj.phpendpoint - Required access: No authenticated application access may be necessary; the attacker needs to deliver a crafted URL to a victim
- Trigger point: The victim's browser processes the response containing the reflected
forcemajvalue - Why exploitation is possible: The parameter is included in the response without adequate escaping, allowing browser-interpreted script content to execute in the victim's security context
- Attack surface: The web-accessible
maj.phpendpoint - Required access: No authenticated application access may be necessary; the attacker needs to deliver a crafted URL to a victim
- Trigger point: The victim's browser processes the response containing the reflected
forcemajvalue - Why exploitation is possible: The parameter is included in the response without adequate escaping, allowing browser-interpreted script content to execute in the victim's security context
Why this happens
The underlying flaw is improper neutralization of user-controlled input in web output, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
The application reflects the forcemaj parameter without applying encoding appropriate to its output context. When installation files remain exposed, the vulnerable endpoint may be reachable by an attacker, and the browser can interpret injected markup or script as trusted page content.
The underlying flaw is improper neutralization of user-controlled input in web output, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
The application reflects the forcemaj parameter without applying encoding appropriate to its output context. When installation files remain exposed, the vulnerable endpoint may be reachable by an attacker, and the browser can interpret injected markup or script as trusted page content.
Potential impact
- An attacker may execute JavaScript in a victim's browser under the application's origin
- Users could be redirected to phishing or malicious websites
- Authentication or application data could be exposed through client-side actions
- Session hijacking may occur when sensitive cookies are accessible to scripts
- The vulnerability could facilitate account compromise or unauthorized actions
- An attacker may execute JavaScript in a victim's browser under the application's origin
- Users could be redirected to phishing or malicious websites
- Authentication or application data could be exposed through client-side actions
- Session hijacking may occur when sensitive cookies are accessible to scripts
- The vulnerability could facilitate account compromise or unauthorized actions
General mitigation guidance
Mitigation generally focuses on eliminating reflected script execution and reducing exposure of administrative or installation functionality.
Common defensive patterns include:
- Apply context-aware output encoding to every reflected parameter
- Prefer allowlisted validation for parameters that should contain constrained values
- Remove installation files after deployment or restrict them from web access
- Configure authentication cookies with
HttpOnly,Secure, and appropriateSameSiteattributes - Use a restrictive Content Security Policy as a defense-in-depth control
- Limit application permissions and session scope so browser-side compromise has less impact
- Avoid exposing maintenance endpoints unnecessarily and enforce authorization where appropriate
Mitigation generally focuses on eliminating reflected script execution and reducing exposure of administrative or installation functionality.
Common defensive patterns include:
- Apply context-aware output encoding to every reflected parameter
- Prefer allowlisted validation for parameters that should contain constrained values
- Remove installation files after deployment or restrict them from web access
- Configure authentication cookies with
HttpOnly,Secure, and appropriateSameSiteattributes - Use a restrictive Content Security Policy as a defense-in-depth control
- Limit application permissions and session scope so browser-side compromise has less impact
- Avoid exposing maintenance endpoints unnecessarily and enforce authorization where appropriate
How teams detect issues like this
Organizations can look for this vulnerability through:
- Static analysis rules identifying direct reflection of request parameters into HTML, JavaScript, URL, or attribute contexts
- Code review checks for missing context-aware encoding and unsafe template construction
- Dynamic testing that supplies harmless marker characters and verifies correct encoding in responses
- Web application firewall or gateway policies monitoring suspicious input in the
forcemajparameter - Deployment checks that identify accessible installation or maintenance files
- Cookie-configuration audits confirming that authentication cookies use appropriate security attributes
Automated application-security scanners and code-review tools can help identify common reflected XSS patterns, but findings should be validated against the actual response context.
Organizations can look for this vulnerability through:
- Static analysis rules identifying direct reflection of request parameters into HTML, JavaScript, URL, or attribute contexts
- Code review checks for missing context-aware encoding and unsafe template construction
- Dynamic testing that supplies harmless marker characters and verifies correct encoding in responses
- Web application firewall or gateway policies monitoring suspicious input in the
forcemajparameter - Deployment checks that identify accessible installation or maintenance files
- Cookie-configuration audits confirming that authentication cookies use appropriate security attributes
Automated application-security scanners and code-review tools can help identify common reflected XSS patterns, but findings should be validated against the actual response context.

