Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS14eDk1LTYyaDYtaDd2M84ABCtp
lgsl Stored Cross-Site Scripting vulnerability
Summary
A stored cross-site scripting (XSS) vulnerability was identified in lgsl. The issue arises from improper sanitation of user input. Everyone who accesses this page will be affected by this attack.
Details
The function lgsl_query_40
in lgsl_protocol.php
has implemented an HTTP crawler. This function makes a request to the registered game server, and upon crawling the malicious /info
endpoint with our payload, will render our javascript on the info page. This information is being displayed via lgsl_details.php
Affected Code:
foreach ($server['e'] as $field => $value) {
$value = preg_replace('/((https*:\/\/|https*:\/\/www\.|www\.)[\w\d\.\-\/=$?]*)/i', "<a href='$1' target='_blank'>$1</a>", html_entity_decode($value));
$output .= "
<tr><td> {$field} </td><td> {$value} </td></tr>";
}
PoC
-
Create a game server with type
eco
and set the target host and port accordingly to your ttack server. I have crafted this json payload that is being parsed according to the schema and being served on/info
-
Serve the following JSON payload at
/info
on your handler
{
"Animals": "1",
"EconomyDesc": "<img src=x onerror=prompt(1)>"
}
- Access the corresponding server info page at
/s?=
. Upon refreshing & crawling our server, it should execute our javascript.
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS14eDk1LTYyaDYtaDd2M84ABCtp
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 13 days ago
Updated: 13 days ago
EPSS Percentage: 0.00043
EPSS Percentile: 0.10932
Identifiers: GHSA-xx95-62h6-h7v3, CVE-2024-56361
References:
- https://github.com/tltneon/lgsl/security/advisories/GHSA-xx95-62h6-h7v3
- https://github.com/tltneon/lgsl/commit/3fbd3bb581b636f7fd3ea0592c5f8df87d3a2843
- https://github.com/advisories/GHSA-xx95-62h6-h7v3
Blast Radius: 1.0
Affected Packages
packagist:tltneon/lgsl
Dependent packages: 0Dependent repositories: 0
Downloads: 245 total
Affected Version Ranges: < 7.0.0
Fixed in: 7.0.0
All affected versions: 5.10.0, 5.10.1, 5.10.2, 5.10.3, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.2.0, 6.2.1
All unaffected versions: 7.0.0, 7.0.0