NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Composer (PHP)

CVE-2024-56361: lgsl Stored Cross-Site Scripting vulnerability

highGHSA-xx95-62h6-h7v3

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 lgslquery40 in lgslprotocol.php has implemented an HTTP crawler.

Published Dec 26, 2024 · Updated Dec 27, 2024

Affected packages

tltneon/lgsl

Ecosystem
Composer (PHP)
Affected
< 7.0.0
Fixed in
7.0.0
Check
composer show tltneon/lgsl

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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', "$1", 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
  1. Serve the following JSON payload at /info on your handler
{
  "Animals": "1",
  "EconomyDesc": ""
}
  1. Access the corresponding server info page at /s?=. Upon refreshing & crawling our server, it should execute our javascript.

Credited to onsali.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Composer (PHP) vulnerabilities

All Composer (PHP) entries