CVE-2026-129142 in paicoding
Summary
by MITRE • 11/13/2026
paicoding commit 766c48b through commit 903adce contains a stored cross-site scripting vulnerability in payment notifications, where NotifyMsgListener inserts the payer's display name unescaped and notify-system-item.html renders it via th:utext. Authenticated attackers can set a malicious display name and start a pending payment on a paid article, executing script in the author's browser when the author views notifications.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/13/2026
The vulnerability identified within paicoding versions spanning commit 766c48b to 903adce represents a critical stored cross-site scripting flaw located specifically within the payment notification subsystem. This security defect arises from improper neutralization of user input during the rendering process, allowing malicious scripts to be injected into web pages viewed by other users. The core technical failure occurs in the NotifyMsgListener component, which is responsible for processing incoming payment notifications and generating corresponding alert messages for content authors. When a payer initiates a transaction on an article that has already been paid or completed, their display name is captured as part of the notification payload. Crucially, this value is inserted into the database without any sanitization or encoding checks, effectively storing untrusted data directly in the application's persistent storage layer.
The exploitation chain begins when an authenticated attacker creates a user account and sets a malicious script payload within their profile display name field. Since the registration process typically does not enforce strict output validation on this specific attribute, the crafted string is accepted by the server and persisted without modification. Subsequently, the attacker initiates a pending payment transaction targeting an article owned by another user who has already received payment or completed the purchase cycle. This action triggers the NotifyMsgListener to generate a new notification entry for the author of that article. The system then retrieves this stored payload from the database to display it in the author's dashboard, leading directly to the rendering phase where the vulnerability is realized.
The critical technical flaw manifests during the frontend rendering process via the notify-system-item.html template file. This template utilizes Thymeleaf’s th:utext directive to render the notification message content. Unlike standard text output directives that automatically escape HTML entities such as angle brackets and quotes, th:utext explicitly instructs the engine to treat the input string as raw HTML or unescaped text. Consequently, when the author views their notifications page, the browser interprets the stored script payload not as inert data but as executable code. This results in the immediate execution of arbitrary JavaScript within the context of the victim’s session and domain. The use of th:utext is a common source of vulnerabilities when developers assume that backend sanitization has sufficiently neutralized all threats, failing to recognize that any bypass or missing check at the storage layer will result in direct code injection upon retrieval.
From an operational impact perspective, this stored cross-site scripting vulnerability poses significant risks to both individual users and the platform as a whole. Because the payload is stored server-side, it does not require complex social engineering techniques such as phishing links; instead, it activates simply by the victim viewing their notification list, which is a routine administrative action for content creators. Successful exploitation allows attackers to perform actions on behalf of the authenticated author, including but not limited to stealing session cookies or authentication tokens, hijacking user sessions, performing unauthorized transactions, defacing content, or redirecting users to malicious external sites. The persistence of the payload means that every time a new admin views notifications for affected articles, they may also be compromised, potentially escalating privileges if administrative interfaces are accessible through the same domain context.
This vulnerability aligns closely with CWE-79, which classifies Improper Neutralization of Input During Web Page Generation known as Cross-site Scripting. Specifically, it falls under the sub-category of Stored XSS where malicious scripts are permanently stored in target servers such as databases or message queues. In terms of offensive security frameworks, this attack vector maps to MITRE ATT&CK technique T1059.007, which covers JavaScript execution within web browsers. The lack of input validation at the point of entry combined with unsafe output encoding constitutes a classic violation of secure coding principles regarding data handling and rendering contexts.
To mitigate this vulnerability, immediate remediation steps must focus on enforcing strict output encoding regardless of prior sanitization efforts. Developers should replace the th:utext directive in notify-system-item.html with standard text output methods that automatically escape HTML special characters, ensuring that any script tags or event handlers are rendered as plain text rather than executable code. Additionally, input validation should be implemented at the point of entry for all user-supplied fields, including display names, using a whitelist approach to allow only alphanumeric characters and safe punctuation while rejecting potentially dangerous symbols such as angle brackets, quotes, and ampersands. Implementing Content Security Policy headers can also provide an additional layer of defense by restricting the sources from which scripts can be loaded or executed, thereby limiting the impact even if some injection attempts succeed in bypassing initial filters.