GHSA-XX95-62H6-H7V3

Vulnerability from github – Published: 2024-12-26 20:20 – Updated: 2024-12-27 00:32
VLAI
Summary
lgsl Stored Cross-Site Scripting vulnerability
Details

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

  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

{
  "Animals": "1",
  "EconomyDesc": "<img src=x onerror=prompt(1)>"
}
  1. Access the corresponding server info page at /s?=. Upon refreshing & crawling our server, it should execute our javascript.
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "tltneon/lgsl"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "7.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-56361"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-26T20:20:12Z",
    "nvd_published_at": "2024-12-26T22:15:19Z",
    "severity": "HIGH"
  },
  "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[\u0027e\u0027] as $field =\u003e $value) {\n        $value = preg_replace(\u0027/((https*:\\/\\/|https*:\\/\\/www\\.|www\\.)[\\w\\d\\.\\-\\/=$?\u200b]*)/i\u0027, \"\u003ca href=\u0027$1\u0027 target=\u0027_blank\u0027\u003e$1\u003c/a\u003e\", html_entity_decode($value));\n        $output .= \"\n        \u003ctr\u003e\u003ctd\u003e {$field} \u003c/td\u003e\u003ctd\u003e {$value} \u003c/td\u003e\u003c/tr\u003e\";\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\": \"\u003cimg src=x onerror=prompt(1)\u003e\"\n}\n```\n3. Access the corresponding server info page at `/s?=`. Upon refreshing \u0026 crawling our server, it should execute our javascript.\n\n",
  "id": "GHSA-xx95-62h6-h7v3",
  "modified": "2024-12-27T00:32:07Z",
  "published": "2024-12-26T20:20:12Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "lgsl Stored Cross-Site Scripting vulnerability"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.