Skip to content

HTTP API: DOM - XSS on JSONP callback

High
winlinvip published GHSA-gv9r-qcjc-5hj7 Mar 28, 2024

Package

No package listed

Affected versions

<5.0.210,<6.0.121

Patched versions

5.0.210,6.0.121

Description

We - The Zalo Security Lab team - have identified a potential security vulnerability in SRS.

If you are NOT the correct point of contact for this report, please let us know at [email protected]!

Summary

SRS's /api/v1/vhosts/vid-<id>?callback=<payload> endpoint didn't filter the callback function name which led to injecting malicious javascript payloads and executing XSS ( Cross-Site Scripting).

image

Details

When accessing http://localhost:1985/console/en_index.html?x#/vhosts/vid-<id> the website will automatically call the callback API endpoint and create a script for it.
image

However, the callback function is modifiable which leads to injecting malicious javascript payloads into the callback. Therefore, the attacker can modify the URL into
http://localhost:1985/console/en_index.html?x#/vhosts/vid-xsedfv%3Fcallback=confirm(document.domain)%252f%252f the XSS will be execute.

image
image

PoC

image

Impact

This issue may lead to Cross-Site Scripting.
If the server uses the older version than v5.0.157, v5.0-b1, v6.0.48 this flaw can be used for the earlier Command Injection vulnerability.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

CVE ID

CVE-2024-29882

Weaknesses

No CWEs

Credits