/

CVE-2026-58205

Severity:

HIGH RISK

(8.1)

Reflected XSS (CWE-79) in GRR maj.php Installation Files

CVE-2026-58205

Deferred

Vulnerability type

Category:

Reflected Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-Side Code Execution and Session Compromise

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.php endpoint remains accessible
  • Installation-related files have not been removed or otherwise restricted
  • The forcemaj parameter 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.php endpoint remains accessible
  • Installation-related files have not been removed or otherwise restricted
  • The forcemaj parameter 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.php endpoint
  • 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 forcemaj value
  • 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.php endpoint
  • 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 forcemaj value
  • 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 appropriate SameSite attributes
  • 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 appropriate SameSite attributes
  • 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 forcemaj parameter
  • 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 forcemaj parameter
  • 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.

Sources

SourceLink
github.comgithub.com/JeromeDevome/GRR/commit/4ef77f91818215c1f8e0f06023d89257dfd61c68
github.comgithub.com/JeromeDevome/GRR/security/advisories/GHSA-r6x2-w38j-vvq2
github.comgithub.com/JeromeDevome/GRR/tree/v4.5.0

Frequently asked

questions

Yes. An attacker can generally exploit the issue remotely by distributing a crafted URL, although successful exploitation depends on a victim opening or visiting that URL.

The attacker may not need an authenticated account. The key conditions are an accessible vulnerable endpoint and a victim whose browser processes the malicious link.

Encode untrusted values according to their output context, validate constrained parameters, and remove or restrict installation files and maintenance endpoints.

Use secure templating defaults, enforce output-encoding standards in code review and automated checks, restrict exposed deployment artifacts, and configure session cookies with appropriate security attributes.

Yes. An attacker can generally exploit the issue remotely by distributing a crafted URL, although successful exploitation depends on a victim opening or visiting that URL.

The attacker may not need an authenticated account. The key conditions are an accessible vulnerable endpoint and a victim whose browser processes the malicious link.

Encode untrusted values according to their output context, validate constrained parameters, and remove or restrict installation files and maintenance endpoints.

Use secure templating defaults, enforce output-encoding standards in code review and automated checks, restrict exposed deployment artifacts, and configure session cookies with appropriate security attributes.

Find out what's already
exploitable in your codebase.