Summary
The soundcloud-rpc desktop client trusted attacker-controlled SoundCloud track metadata and rendered it as raw HTML inside privileged Electron views with Node.js integration enabled.
A crafted track title containing an HTML payload could execute in the Electron renderer, pivot into the main process via IPC, and ultimately lead to local command execution on the user's machine when a malicious track is viewed.
Affected context
The vulnerability occurs in the soundcloud-rpc Electron application, which exposes a preload API (window.soundcloudAPI.sendTrackUpdate) to the remote SoundCloud page and then forwards track metadata into the main process via IPC.
The affected flows are those where:
- Metadata (such as track titles) is pulled directly from SoundCloud,
- That metadata is treated as trusted inside the app, and
- It is rendered as raw HTML inside Electron renderer views that have Node.js integration or other elevated capabilities enabled.
In such contexts, untrusted metadata from remote web content effectively gains access to a privileged desktop environment.
Exploit preconditions
- Attack surface: Remote, via SoundCloud track metadata (e.g., track titles) consumed by the client.
- Required access: Ability to publish or control track metadata that the user's soundcloud-rpc client will load (e.g., as a track owner, or via a compromised/abused account).
- User interaction: The victim must run the vulnerable soundcloud-rpc client and cause it to load or display the malicious track (browsing, playing, or otherwise viewing it through the app).
- Trigger point: Rendering of the attacker-supplied track metadata as raw HTML in a privileged Electron renderer with Node.js integration enabled.
- Why exploitation is possible: The application:
- Exposes a preload API into untrusted remote content,
- Treats remote metadata as implicitly trusted,
- Forwards it via IPC into the main process, and
- Renders it without sanitization or escaping in a context where script execution can reach local system APIs.
Why this happens
The root cause is a combination of input validation, output encoding, and privilege boundary failures:
- Unvalidated input (CWE-20): Track metadata from remote SoundCloud pages is accepted without verifying that it conforms to safe, expected formats.
- Cross-Site Scripting / HTML injection (CWE-79): This untrusted metadata is rendered as raw HTML, allowing embedded script-like payloads to execute in the renderer.
- Code injection in a privileged environment (CWE-94): Because the renderer has Node.js integration and access to IPC channels tied to the main process, injected JavaScript can escalate into arbitrary command execution on the local machine.
- Missing authorization controls on privileged actions (CWE-862): The IPC pathways and privileged APIs do not robustly limit which data sources may trigger sensitive operations, allowing untrusted web content to drive high-privilege behaviors.
Abstractly, this is an instance of treating remote, user-controllable content as trusted inside a desktop runtime, collapsing the intended separation between web content and local system capabilities.
Potential impact
- Execution of arbitrary system commands under the user's account.
- Installation of malware or backdoors on the victim's machine.
- Exfiltration of local files accessible to the Electron app or the user.
- Theft of application secrets, tokens, or cookies exposed to the renderer.
- Further compromise of other applications or services via persistent access.
- Use of the victim's host as a foothold for lateral movement in a network.
General mitigation guidance
Effective mitigation centers on restoring strict boundaries between untrusted web content and privileged desktop capabilities:
- Treat all remote metadata as untrusted: Enforce strict input validation for any data received from SoundCloud, limiting fields like titles to a safe character set and structure.
- Render as text, not HTML: Default to text-based rendering for metadata. Avoid using APIs that interpret content as HTML; where markup is truly required, use a vetted, allowlist-based sanitizer.
- Disable Node.js integration in web-facing views: Use
contextIsolation,sandbox, andnodeIntegration: falsein windows that display any remote or remotely-derived content. - Harden IPC boundaries: Design IPC channels so only trusted, internal code can invoke sensitive operations. Enforce explicit, schema-checked messages and reject unsafe payloads by default.
- Apply least privilege to preload scripts: Keep preload APIs as minimal as possible, exposing only non-sensitive functionality, and avoid passing raw untrusted data directly into privileged layers.
- Secure-by-default templates: Structure the Electron app so that any new UI components that display external data default to escaped output and isolated contexts.
How teams detect issues like this
Detection typically involves a combination of code-level and behavioral analysis:
- Static analysis and linting:
- Rules that flag
innerHTMLor equivalent raw HTML sinks receiving untrusted inputs. - Checks for
nodeIntegration: true, disabledcontextIsolation, or preload scripts attached to windows loading remote content. - Identification of IPC handlers that accept arbitrary data and invoke shell or filesystem APIs.
- Code review practices:
- Trace data flows from remote sources (e.g., SoundCloud responses) to renderer sinks, ensuring that all paths enforce validation and encoding.
- Review preload scripts to ensure they do not expose sensitive or overly generic IPC interfaces into web content.
- Examine main-process handlers for strict schema validation and explicit authorization decisions.
- Policy and tooling enforcement:
- Establish project policies that prohibit Node.js integration in any window showing remote or mixed content.
- Use automated scanners or SAST tools with Electron-specific rules to highlight dangerous configurations and data flows.
- Integrate security gates into CI/CD that fail builds when unsafe Electron patterns or unescaped HTML rendering of external data are detected.

