Summary
WeGIA versions 3.6.6 and below contain a reflected cross-site scripting (XSS) vulnerability in the novo_memorandoo.php endpoint, where user-controlled data is echoed into HTML without encoding.
By crafting a malicious link that injects JavaScript via the sccs GET parameter, an attacker can execute arbitrary code in the victim's browser when they visit the link.
Affected context
The vulnerability exists in the WeGIA web interface for managing memorandums, specifically in /html/memorando/novo_memorandoo.php.
It is exposed when the application uses the msg and sccs GET parameters to display dynamic success messages and directly concatenates sccs into an HTML alert <div> without escaping.
Risk is present whenever users can be induced to click links or follow redirects to this endpoint containing untrusted content in the sccs parameter.
Exploit preconditions
- Attack surface: HTTP GET requests to /html/memorando/novo_memorandoo.php
- Required access: Ability to cause a victim to load a crafted URL (e.g., via email, chat, or embedded links); no prior authentication may be required beyond what the application normally uses
- Trigger point: The server-side logic checks if $_GET['msg'] == 'success' and then reflects $_GET['sccs'] inside an HTML alert <div> in the response
- Why exploitation is possible: The sccs parameter is treated as trusted content and injected into the HTML response without output encoding or sanitization, allowing attacker-supplied JavaScript to run in the victim's browser
Why this happens
This issue stems from directly embedding untrusted GET parameter values into an HTML response without proper output encoding.
The novo_memorandoo.php script uses $_GET['sccs'] to build a success message inside an HTML <div> when $_GET['msg'] equals 'success', but does not apply context-appropriate escaping before concatenation.
This aligns with CWE-79, where improper neutralization of input in the browser context allows attackers to inject script content into web pages viewed by other users.
Potential impact
- Execution of arbitrary JavaScript in the context of the affected WeGIA application
- Theft of session identifiers, CSRF tokens, or other sensitive data accessible to the page
- Unauthorized actions performed on behalf of the victim via script-driven requests
- Defacement of application content or injection of misleading UI elements
- Potential pivoting to other attacks, such as credential harvesting or delivering browser-based malware
General mitigation guidance
Effective mitigation focuses on robust output encoding and careful handling of user-supplied data in HTML templates:
- Apply context-aware escaping (e.g., HTML entity encoding) to any data derived from request parameters before inserting it into the DOM.
- Use a templating system or framework helpers that automatically encode variables, reducing the chance of direct string concatenation.
- Restrict which fields can contain HTML, and default to treating all user input as plain text.
- Validate and constrain the shape and length of display parameters like sccs to expected formats (e.g., fixed messages or enumerated codes).
- Avoid constructing HTML strings manually; instead, map simple status codes to predefined, server-side message templates.
How teams detect issues like this
Organizations can identify similar vulnerabilities by:
- Static analysis rules that flag direct echoing or concatenation of $_GET/$_POST/$_REQUEST variables into HTML output without encoding.
- Code review checklists that specifically examine alert, notification, and status-message rendering for unescaped parameters.
- Security-focused linting or SAST tools configured to detect potential CWE-79 patterns in PHP code.
- Automated testing with fuzzing or XSS payload dictionaries against endpoints that reflect request parameters in the response.

