Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

Today, multiple servers within the Metin2 community were targeted by attacks leveraging a zero-day exploit found in the game’s source code. Below is a guide to help you patch SQL injection vulnerabilities in both the Messenger and Guild systems.

Steps to Secure Your Code

Step 1: Update MessengerManager

Open the messenger_manager.cpp file and locate the MessengerManager::RemoveFromList function.

Replace it with the following implementation:

 
This is the hidden content, please

Step 2: Modify Guild Creation Logic

Next, navigate to the guild_manager.cpp file and find the CGuildManager::CreateGuild function.

Search for the lines that include:

 
This is the hidden content, please

or

 
This is the hidden content, please

Above this line, insert the following code to handle escaping the guild name properly:

 
This is the hidden content, please

Step 3: Update SQL Queries

Additionally, replace:

 
This is the hidden content, please

with:

 
This is the hidden content, please

Doing this enhances security by ensuring that user input is properly sanitized before being used in SQL queries.

Code Modernization

Make sure to transition from using std::auto_ptr to std::unique_ptr if you're targeting C++11 standards or higher, as auto_ptr is deprecated.

Conclusion

Implementing these changes will significantly increase the security of your Messenger and Guild systems against SQL injection attacks. Protecting your server from such vulnerabilities is crucial for maintaining a secure gaming environment.

Link to comment
Share on other sites


  • 100% changed the title to Fix SQL Injection Vulnerabilities in Messenger & Guild Module

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...