Summary
A stored cross-site scripting vulnerability in AVideo's YPTWallet plugin allows attacker-controlled CryptoWallet values to be saved without HTML escaping. When an administrator views pending withdrawal requests, the stored markup may execute in the administrator's browser and perform same-origin actions using that session.
Affected context
The issue occurs in AVideo deployments using the YPTWallet plugin and its pending withdrawal request workflow. It becomes risky when an attacker can submit or otherwise influence CryptoWallet data, the value is stored in wallet_log.information without context-appropriate output encoding, and an administrator later views the affected records in pendingRequests.php.
Exploit preconditions
- Attack surface: YPTWallet input handling and the administrator-facing pending withdrawal request page
- Required access: Ability to submit or influence a withdrawal request or its CryptoWallet value
- Trigger point: An administrator viewing the affected pending request
- Why exploitation is possible: User-controlled data is stored and rendered as markup without HTML escaping, allowing script-capable content to execute in the administrator's same-origin browser context
Why this happens
The vulnerability results from treating base64 encoding as a substitute for output encoding. Base64 changes the representation of input but does not make data safe for an HTML rendering context; decoding or rendering the value without context-appropriate escaping allows attacker-controlled markup to execute. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.
Potential impact
- An attacker could perform unauthorized same-origin requests using an administrator's active session
- Administrative settings or workflow actions could be modified
- Sensitive information accessible to the administrator's session may be exposed
- Withdrawal processing or other plugin-managed operations could be manipulated
- Additional users could be targeted if the stored content is displayed to other privileged viewers
General mitigation guidance
Mitigation generally focuses on treating all submitted values as untrusted and applying output encoding at the point of rendering.
Common defensive patterns include:
- HTML-escape CryptoWallet and related values for their specific output context
- Prefer text-only rendering and avoid inserting untrusted values as HTML
- Apply allowlist-based validation for wallet identifiers where the business format permits it
- Use framework-supported templating with automatic contextual escaping
- Enforce a restrictive Content Security Policy as defense in depth
- Limit administrative session privileges and require suitable authorization checks for sensitive actions
- Avoid relying on base64 encoding as a security control
How teams detect issues like this
Detection can include static analysis for user-controlled data flowing into HTML output without contextual encoding, especially values written to database fields and later rendered in administrative templates. Code review should examine storage-to-display paths, template escaping behavior, and uses of direct HTML insertion or response construction. Dynamic testing can submit benign markup markers and verify that administrative pages render them as text rather than interpreting them. Policy enforcement may require automatic output encoding, trusted templating primitives, and security checks for stored data flows; automated code review tools can help identify these patterns.

