sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

1.8.0 Server webpage breaks if players have certain special characters.

Open Xbye opened this issue 1 year ago β€’ 8 comments

What are the steps to reproduce this issue?

  1. Change your name to: π–Šπ–“π–†π–“π–™π–†π–™π–”
  2. Join a L4D2 server that is listed on your webpanel.
  3. Go to your server page where your server is listed.

What happens?

The SourceBans++ Webpanel is not able to retrieve information from the server. It is stuck "Querying Server Data" forever.

A popup comes up saying: AJAX Call Failed! Error: the XML response that was returned from the server is invalid. Received: Community Server #62/4]]>]]>bdp_bunker04Community Server #6

What were you expecting to happen?

Not an error, pop-up, and the server to query data. Server is fine. It is responsive to query requests from things not Sourcebans++. Players are playing just fine.

Any logs, error output, etc.?

Any other comments?

Please walk me through how to provide any logs if necessary. Steps to reproduce this issue is very easy.

What versions of software are you using?

Operating System: Ubuntu 24.04 LTS SourceBans++ Version: 1.8.0 PHP Version: 8.3 MySQL Version: mysql Ver 15.1 Distrib 10.11.8-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper Link to your project: N/A? Link to a phpinfo() output: N/A?

Xbye avatar Jun 21 '24 05:06 Xbye

I can't repro it on CS: S because these kind of chars is not correctly supported and just turn into a square box and I don't have L4D2 env to test.

I believe this kind of issue can also happen in any plugin who uses SQL/Ajax. I suggest you to use a global fix to directly rename invalid name. This is what I use personally https://github.com/srcdslab/sm-plugin-NameFilter/

Otherwise, in a perfect fix on sbpp side, we will need support specials chars with ajax.

Rushaway avatar Jun 21 '24 07:06 Rushaway

I can't repro it on CS: S because these kind of chars is not correctly supported and just turn into a square box and I don't have L4D2 env to test.

I believe this kind of issue can also happen in any plugin who uses SQL/Ajax. I suggest you to use a global fix to directly rename invalid name. This is what I use personally https://github.com/srcdslab/sm-plugin-NameFilter/

Otherwise, in a perfect fix on sbpp side, we will need support specials chars with ajax.

Hello.

Left4Dead 2 does not support this charset either, and their names turn to squares in L4D2 as well. The only issue seems to be the server Webpanel. I went ahead and banned myself (using this name). The MySQL database took it just fine, and the ban Webpanel handled it as well.

As for the plugin. I would like to use that plugin as a last resort if this can't be fixed. Because a huge amount of the Left4Dead 2 playerbase uses special characters, but this is the first time I've had the server webpanel break from them. I would prefer not to disrupt my player's games by renaming probably dozens of people per day, since I have over a dozen servers open to the public that are constantly full.

(IP is from a VPN) image

By default, the DB (I generated through install) has a DEFAULT_COLLATION_NAME of utf8mb4_general_ci. I had another person who runs a L4D2 server to ban themselves with this name, and their database represented it better since they seem to be using utf8mb4_unicode_ci. I'll try changing my DB to that so that the bans render, but I don't think MySQL is responsible for the server webpage.

EDIT: Seems it's the SB++ plugin that is feeding a garbaged name into the database. Banning from the Webpanel seems to do everything just fine:

image

Xbye avatar Jun 21 '24 13:06 Xbye

@Hackmastr Maybe we should switch to utf8mb4_unicode_ci. The differences in terms of performance are very slight compared to utf8mb4_general_ci

Rushaway avatar Jun 23 '24 08:06 Rushaway

I found another name by a user that breaks the Sourcebans webpanel. Unlike π–Šπ–“π–†π–“π–™π–†π–™π–” which breaks the entire server query, the name /Mr.Kryakin\-❀xlebo_ytkaAHAHA seems to break interaction with the user on the Sourcebans webpanel.

image

You can see in this screenshot, it seems the \ is getting removed, and possibly not being properly escaped? Every other user on the server I could interact with.

Xbye avatar Jun 23 '24 16:06 Xbye

Do you have your dep correctly updates (file + sv side)? This commit was important. https://github.com/sbpp/sourcebans-pp/commit/2b017e87bf32b7ace57591bb7bfd9bcbd5f53b11

Rushaway avatar Jun 24 '24 09:06 Rushaway

Do you have your dep correctly updates (file + sv side)? This commit was important. 2b017e8

Hello. I downloaded everything from the "release" section of the repo. Using "Latest" for the plugin, and the "webpanel only" under the 1.7 release.

I went ahead and looked up what was inside my sourcebans/composer.json and compared it to that commit.

    "smarty/smarty": "~v4.3.0",

I guess I might be some versions behind since the commit shows:

    "smarty/smarty": "~v5.3.0",

I am unfortunately unsure how to update the Sourcebans webpanel. The "updater" folder in the github is from 10 months ago, with the updater.php being 2 years ago. I guess I would need to learn how to pull the entire repo and isolate the web section?

Xbye avatar Jun 24 '24 17:06 Xbye

I did a full reinstall of SB++ using the latest branch version. With composer madness and everything. Website currently says:

SourceBans++ 1.8.0 | Git: 1411

So the webpanel is running on the latest version. Plugins should also be the latest version as well.

Both of these names: π–Šπ–“π–†π–“π–™π–†π–™π–” /Mr.Kryakin\-❀xlebo_ytkaAHAHA are still causing the same issues as before I updated.

Xbye avatar Jun 24 '24 18:06 Xbye

Found another name that breaks Sourcemod webpanel interaction:

image

In I'm a goose, if you try to view profile it says the player isn't on the server. This is wrong. I believe Sourcebans is not escaping the '. Similarly to the name in the previous post where it is not escaping the \.

Xbye avatar Jul 03 '24 17:07 Xbye