/

CVE-2026-33136

Severity:

CRITICAL RISK

(9.3)

XSS in WeGIA Memorando Module listar_memorandos_ativos.php

CVE-2026-33136

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution / Account Compromise

Severity:

CRITICAL RISK

(9.3)

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

WeGIA versions 3.6.6 and below contain a reflected Cross-Site Scripting (XSS) vulnerability in the listar_memorandos_ativos.php endpoint, where untrusted data from the sccd query parameter is echoed directly into an HTML alert message.

An attacker can craft a malicious link that injects arbitrary JavaScript or HTML, which executes in the victim's browser when they visit the URL, potentially leading to session theft, account impersonation, or other client-side attacks.

Affected context

The vulnerability occurs in WeGIA's Memorando module within the listar_memorandos_ativos.php script, specifically when handling dynamic success messages passed via query string parameters.

When the msg parameter equals success, the application concatenates the sccd GET parameter directly into an HTML <div> alert without output encoding or sanitization.

This behavior is present in WeGIA versions 3.6.6 and below and manifests when user-controlled data is reflected in server-generated HTML responses.

Exploit preconditions

  • Attack surface: HTTP GET request to /html/memorando/listar_memorandos_ativos.php
  • Required access: The ability to convince a user to visit a crafted URL (e.g., via email, chat, or embedded links); no authenticated session is strictly required for the browser to process the malicious script, though impact increases with authenticated users.
  • Trigger point: Server-side rendering of an HTML page when:
  • The msg GET parameter equals "success"
  • The sccd GET parameter contains attacker-controlled JavaScript or HTML
  • Why exploitation is possible: The application directly reflects the sccd parameter into an HTML alert <div> without applying context-appropriate output encoding or validation, allowing injected script to be interpreted and executed by the browser.

Why this happens

This issue is rooted in improper neutralization of user-controlled input before it is included in the HTML response, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The listar_memorandos_ativos.php script assumes that the sccd query parameter is safe and concatenates it into an HTML structure when msg == "success".

Because no HTML or JavaScript output encoding is applied, the browser interprets any embedded script or markup as part of the page, enabling arbitrary client-side execution.

Conceptually, this reflects a broader bug class where server-generated views treat query parameters as trusted display content rather than untrusted input requiring encoding.

Potential impact

  • Theft of session identifiers or authentication tokens from affected users' browsers
  • Execution of arbitrary JavaScript in the context of the WeGIA application
  • Forced actions on behalf of authenticated users (e.g., changing data, sending internal memorandos), if combined with application functionality
  • Defacement or manipulation of visible content within the Memorando interface
  • Pivoting to more advanced browser-based attacks such as keylogging or credential harvesting

General mitigation guidance

Mitigation focuses on robust output encoding and strict handling of untrusted input in server-rendered views:

  • Apply context-appropriate output encoding to all dynamic values rendered into HTML (e.g., HTML entity encoding for text nodes, attribute encoding within attributes, and JavaScript string encoding where applicable).
  • Treat all query parameters (including sccd and msg) as untrusted user input and validate them against a strict allowlist of expected characters and formats.
  • Prefer structured server-side status handling (e.g., enumerated codes or IDs) instead of directly reflecting arbitrary messages supplied via the query string.
  • Centralize output encoding logic in reusable view helpers or templating functions so that all dynamic content is encoded by default.
  • Implement a security-conscious template engine configuration that discourages raw output and defaults to safe-escaped variables.

How teams detect issues like this

Detection can combine automated and manual review techniques:

  • Static analysis: Configure rules that flag direct use of $_GET, $_POST, or $_REQUEST values concatenated into HTML strings or echoed without passing through an encoding or sanitization layer.
  • Code review: Examine view scripts such as listar_memorandos_ativos.php and other Memorando module endpoints for patterns like echo $_GET[...] or string interpolation mixing HTML and raw query parameters.
  • Security testing: Use automated scanners or manual penetration testing to crawl URLs with reflected parameters, injecting harmless test payloads to identify unencoded reflections.
  • Policy enforcement: Introduce coding standards that require all user-derived data to be passed through standardized encoding helpers in the presentation layer and enforce these via pre-commit hooks or CI checks.

Sources

SourceLink
github.comgithub.com/LabRedesCefetRJ/WeGIA/releases/tag/3.6.7
github.comgithub.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-xjqp-5q3h-2cxh

Frequently asked

questions

The vulnerability is remotely exploitable via crafted URLs. Any user who can be induced to click a malicious link or load a compromised page containing that link can be affected, especially if they are logged into WeGIA at the time.

Exploitation of the XSS itself does not strictly require attacker authentication, but the impact is significantly higher when the victim is authenticated, as the injected script then runs with the victim's session context.

The safest fix is to ensure that all dynamic content derived from request parameters—particularly sccd and msg—is validated and contextually output-encoded before inclusion in HTML, ideally through centralized template helpers that escape by default.

Prevention involves consistently treating all external input as untrusted, applying strict validation and encoding, adopting templates or frameworks that auto-escape output, and enforcing secure coding standards backed by automated checks and regular security-focused code reviews.

Find out what's already
exploitable in your codebase.