CVE-2024-56361: Tltneon/lgsl Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-xx95-62h6-h7v3
CWE-79
Published
Advisory Summary

CVE-2024-56361 is a HIGH cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Tltneon/lgsl libraries in the Packagist ecosystem. The issue involves lgsl stored cross-site scripting vulnerability. Remediation is available by upgrading affected packages to version 7.0.0.

CVE-2024-56361 at a Glance

CVE Identifier CVE-2024-56361
GHSA Identifier GHSA-xx95-62h6-h7v3
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Tltneon/lgsl
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2024-56361

To remediate this vulnerability, upgrade all affected Tltneon/lgsl dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tltneon/lgsl fixed: 7.0.0
Upgrade tltneon/lgsl to 7.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for tltneon/lgsl

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-56361, inspect your project dependencies for Tltneon/lgsl:

inspect dependencies for tltneon/lgsl

Analyze the terminal output to locate any version of Tltneon/lgsl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Tltneon/lgsl, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```php 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 1. 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` 2. Serve the following JSON payload at `/info` on your handler ```json { "Animals": "1", "EconomyDesc": "<img src=x onerror=prompt(1)>" } ``` 3. Access the corresponding server info page at `/s?=`. Upon refreshing & crawling our server, it should execute our javascript.

CVE-2024-56361 Affected Tltneon/lgsl Versions

1 component(s)
Fixed Versions:
7.0.0
Product / Package Ecosystem Affected Versions Fixed Version
tltneon/lgsl
Packagist
< 7.0.0
7.0.0

References

Frequently Asked Questions

What is CVE-2024-56361?
CVE-2024-56361 is a security vulnerability in Tltneon/lgsl involving lgsl Stored Cross-Site Scripting vulnerability under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Tltneon/lgsl versions are affected?
Affected versions include releases prior to 7.0.0 across affected packages: tltneon/lgsl.
What version fixes CVE-2024-56361?
Upgrading to 7.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tltneon/lgsl affected?
Yes, tltneon/lgsl is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
What CWE is associated with CVE-2024-56361?
CVE-2024-56361 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2024-56361?
Run the dependency tree command: 'inspect dependencies for tltneon/lgsl'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xx95-62h6-h7v3",
  "modified" : "2024-12-27T00:32:07Z",
  "published" : "2024-12-26T20:20:12Z",
  "aliases" : [ "CVE-2024-56361" ],
  "summary" : "lgsl Stored Cross-Site Scripting vulnerability",
  "details" : "### Summary\n\nA 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.\n\n### Details\n\nThe 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`\n\n#### Affected Code:\n```php\n      foreach ($server['e'] as $field => $value) {\n        $value = preg_replace('/((https*:\\/\\/|https*:\\/\\/www\\.|www\\.)[\\w\\d\\.\\-\\/=$?​]*)/i', \"<a href='$1' target='_blank'>$1</a>\", html_entity_decode($value));\n        $output .= \"\n        <tr><td> {$field} </td><td> {$value} </td></tr>\";\n      }\n```\n### PoC\n\n1. 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` \n\n2. Serve the following JSON payload at `/info` on your handler\n```json\n{\n  \"Animals\": \"1\",\n  \"EconomyDesc\": \"<img src=x onerror=prompt(1)>\"\n}\n```\n3. Access the corresponding server info page at `/s?=`. Upon refreshing & crawling our server, it should execute our javascript.\n\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "tltneon/lgsl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tltneon/lgsl/security/advisories/GHSA-xx95-62h6-h7v3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tltneon/lgsl/commit/3fbd3bb581b636f7fd3ea0592c5f8df87d3a2843"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tltneon/lgsl"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-26T20:20:12Z",
    "nvd_published_at" : "2024-12-26T22:15:19Z"
  }
}