In short
- rAthena published four security advisories in September and October 2025. The worst, CVE-2025-58447, is a heap overflow in the login server rated 9.8 out of 10 that needs no account.
- rAthena has no version numbers, so you check by commit: git merge-base --is-ancestor with each fix commit tells you whether your checkout has it. A build from after 12 October 2025 has all four.
- The stock configuration ships the inter-server login s1 and p1, the database login ragnarok and ragnarok, and plain-text account passwords. Change the first two before the server is listed.
- Open TCP 6900, 6121 and 5121 to players, 8888 only if your client uses the web server, and nothing else. The database answers on localhost only.
- The ddos settings in packet_athena.conf count connections from one address inside the emulator. They help against one noisy address and do nothing against a flood that fills the port.
On this page
On 9 September 2025 rAthena published three security advisories on the same day, and a fourth followed in October. One of them lets anyone who can reach the login port crash the login server, with no account and no client, and the reporter says it may allow running code on the server. Port 6900 has to be open for anyone to play, so a firewall cannot help with that one. Only an update can.
The easiest ways into an rAthena server were never secret: published flaws in old builds, and default passwords that ship in the configuration. This guide goes through both, then the ports, the built-in ddos settings and what they cannot do. The same checklist, with a firewall ruleset and kernel settings you can copy, is in a public repository on GitHub.20
The 2025 advisories, and whether you are patched
rAthena's GitHub repository lists four advisories for 2025.1 The login server flaw, CVE-2025-58447, is a heap-based buffer overflow that a remote attacker can trigger with one crafted login packet. The advisory shows the server crashing and states that code execution is possible.2 The NVD record carries a CVSS 3.1 score of 9.8, critical, with no privileges and no user interaction required.7
| CVE | What is affected | Rating | Fixed in |
|---|---|---|---|
| CVE-2025-58447 | Login server, heap overflow before any login2 | Critical, 9.8 | 2f5248b |
| CVE-2025-58448 | Party booking: an SQL injection through the WorldName parameter,3 fixed in the web server's party booking code4 | Critical, 9.1 | 0d89ae0 |
| CVE-2025-58750 | Character server: a missing bounds check when moving a character slot, reading and writing out of bounds5 | High, 8.2 | 0cc348b |
| CVE-2025-62170 | RODEX mail: a use after free that lets a player crash the map server6 | High, 7.5 | af2f3ba |
Ratings are the CVSS 3.1 base scores published with each advisory.
Two of the four are rated critical, and the drawing at the top of this guide puts all four on the same scale. The login server flaw is the one to fix first, because port 6900 is the one port every player, and every stranger, can reach.
Check by commit
rAthena does not number its releases: you run whatever commit you cloned. Git answers the question directly. git merge-base --is-ancestor A B exits with status 0 when commit A is an ancestor of B, and is the documented way to ask exactly that.8 Run it in your rAthena folder for each fix:
for c in 2f5248b 0d89ae0 0cc348b af2f3ba; do git merge-base --is-ancestor $c HEAD && echo "$c present" || echo "$c MISSING"; doneEvery line should say present. The newest fix, af2f3ba, was published on 12 October 2025,6 so a checkout from after that date has all four. If your server came as a zip file or a fork without git history, you cannot check this way; the honest answer is to move your changes onto a fresh clone.
Updating safely depends on one habit: keeping every change in conf/import/, which rAthena reads after the main conf files and which an update never overwrites.17 The setup guide walks through a full update.
The defaults everyone knows
The source is public, so its defaults are public too. Three of them matter.
The inter-server login, s1 and p1
The character and map servers authenticate to each other with userid: s1 and passwd: p1, and main.sql creates account 1 with that pair.101116 rAthena's own wiki calls changing them one of the most important steps in securing a server, and says they must match in the char conf, the map conf and the login table.17 Put the new pair in conf/import/char_conf.txt and conf/import/map_conf.txt, then update the row:
sudo mysql ragnarok -e "UPDATE login SET userid = 'your-own-id', user_pass = 'a-long-random-one' WHERE account_id = 1;"The database login, ragnarok and ragnarok
Every database connection in inter_athena.conf ships as user ragnarok, password ragnarok, on 127.0.0.1 port 3306.12 The wiki adds that the database user should never be root.17 Create a user of your own for localhost only, with rights on the rAthena databases and nothing else, and set it in conf/import/inter_conf.txt.
Account passwords in plain text
The login conf ships use_MD5_passwords: no, so players' passwords sit in the login table as typed, and the same comment warns that MD5 storage does not work with clients that use password encryption.9 Either way, treat a database dump as a list of passwords: keep backups encrypted and off any shared drive, and never paste the login table into a support thread.
- Inter-server login as shipped
- s1 / p1
- Database user and password as shipped
- ragnarok
- Firewall rules 3306 should have
- 0
Which ports face the internet
Players need three ports: 6900 for login, 6121 for the character server and 5121 for the map.91011 The web server listens on 8888,14 and the login conf turns on web tokens because newer clients fetch data over HTTP.9 If your client never uses it, leave 8888 closed: the party booking flaw above sat in the web server's code, and a port nobody needs is one more thing to patch.4
A firewall that drops everything else is the simplest way to be sure. With ufw, allow SSH first, then name the protocol on every rule, because a rule without one opens UDP as well.19 Then check what is really listening. ss lists sockets, and with -l, -n, -t and -p it shows listening TCP sockets, numerically, with the process that owns each:18
sudo ufw allow OpenSSHsudo ufw allow 6900/tcpsudo ufw allow 6121/tcpsudo ufw allow 5121/tcpsudo ufw enablesudo ss -lntp | grep -E ':(6900|6121|5121|8888|3306) 'The game ports should show 0.0.0.0 or the public address. Port 3306 should show 127.0.0.1. If it shows 0.0.0.0, the database is listening on every interface, and only the firewall stands between it and the internet; set it to listen on localhost in MariaDB's configuration and restart it. For the reasoning behind default deny, see game server ports and firewalls.
SSH is the one door that is neither a game port nor closed, and it guards everything else: whoever logs in there owns the database, the conf files and the build. Use keys instead of passwords, keep root logins off, and add a rate limit or a ban tool for repeated failures. Securing a new Linux server walks through each of those in the order that matters on a fresh machine.
What packet_athena.conf really does
packet_athena.conf holds rAthena's address rules and what it calls DDoS protection. The comment is plain about the logic: if ddos_count connection requests arrive within ddos_interval milliseconds, rAthena assumes an attack.13 In the code the flag comes around the 6th or 7th fast connection, and the login, char and map servers each count on their own.
| Setting | As shipped | What it does |
|---|---|---|
enable_ip_rules | yes | Checks addresses on connect, which also turns on the counting below |
order | deny,allow | Deny rules first, then allow rules; allowed if nothing matches |
ddos_interval | 3000 | The window between attempts, in milliseconds |
ddos_count | 5 | Attempts inside the window before the address is treated as an attack |
ddos_autoreset | 600000 | Milliseconds until the restriction lifts: 10 minutes |
allow: | none | Accepts a range even when it is flagged |
That makes it useful against one address hammering the login server, and useless against a volumetric flood. The counting happens after a packet has crossed the network, been accepted by the kernel and handed to rAthena. A flood that fills the server's network port does its damage before any of that. It also counts per address, so traffic spread across many addresses, each below five connections in three seconds, passes untouched.
The proxy trap
If you put a proxy in front of rAthena, every player arrives from the proxy's address. At opening, a handful of players joining a second or two apart look like one address flooding, and the proxy is refused for ten minutes: everyone is locked out at once. The fix is an allow: line for the proxy's range, which rAthena accepts "even if flagged as DDoS".13 Put it in conf/import/packet_conf.txt, the import file the conf names for local changes.13
Login failure bans
The login server bans an address that fails too often, and it is on as shipped: ipban_dynamic_pass_failure_ban: yes, counting failures over 5 minutes, banning after 7 and for 5 minutes.9 It depends on the login log: the conf notes that dynamic failure bans need log_login, which ships as yes.9 Leave both on. If players behind one shared address (a school, a café, one mobile network) start getting banned together, raise the limit rather than turning the feature off.
The web server on 8888
rAthena's web server answers HTTP requests from the client on web_port: 8888. Its allowed_origin_cors setting ships empty, and the comment above it is a warning: only configure origins you trust, because the setting allows cross-origin requests to the web API.14 Leave it empty unless a site of your own really needs it. If the client you ship never talks to the web server, do not open the port at all, and make sure the server is built from a commit after 0d89ae0.
Packet obfuscation
rAthena supports the obfuscated packet format of clients from 2011-08-17 onwards, and it is on by default for those versions. The default packet version is 20211103, so a stock build has it on.15Custom keys are defined as PACKET_OBFUSCATION_KEY1 to KEY3 in src/custom/defines_pre.hpp, and the client has to use the same ones; a warning setting reports clients without the client-side encryption.15 Obfuscation makes casual packet tools harder to use against your server. It is not a security boundary, and it does nothing about any of the advisories above.
On opening day, and after
The checklist, in the order that matters: patch, change the defaults, close everything but the game ports, and only then post the address. Back up the database every day to somewhere off the server, and prove a restore works before you need one; server backups covers how.
Telling the two kinds of trouble apart
When players start dropping, the first question is where the trouble is, because the fixes are in different places.
| What you see | Where it is | Where the fix lies |
|---|---|---|
| The console fills with connection requests from a few addresses, and the server's network graph looks normal | At the emulator | rAthena's own rules: the ddos settings, deny lines, the login bans |
| The login log shows the same address failing again and again | At the login server | The failure ban, and a deny line for a range that keeps coming back |
| The network graph is pinned at the port's speed and the console is quiet | At the network port | In front of the server: nothing inside rAthena can see this traffic |
| The login server process has exited, and it restarts and dies again | Possibly a crash bug | Check the build against the advisories before anything else |
Staying ahead of the next advisory
The four 2025 advisories will not be the last. The advisories page on GitHub is where rAthena publishes them, with the fix commit for each,1 so check it before every update and after any crash you cannot explain. Keep your own changes small and in conf/import/ and your custom scripts in their own folder, and updating stays a ten-minute job rather than a merge you put off for a year. A server that is easy to update is a server that gets updated.
The full checklist, the nftables ruleset and the kernel settings are on GitHub at Clouduxe/rathena-server-hardening, written to work on any host. Corrections are welcome there as issues or pull requests.
Questions
Is my rAthena server vulnerable to CVE-2025-58447?
It is if your build is older than commit 2f5248b, from September 2025. In your rAthena folder, git merge-base --is-ancestor 2f5248b HEAD exits with 0 when the fix is in your checkout; anything else means update.
How do I update rAthena without losing my changes?
Keep every setting in conf/import/, which rAthena reads after the main files and an update never overwrites. Then stop the servers, git pull, rebuild with the same configure options, run any new scripts in sql-files/upgrades, and start again, after taking a database dump.
Should MariaDB be reachable from the internet?
No. rAthena connects to the database on 127.0.0.1 by default, and nothing outside the server needs it. Give the database user a localhost host, add no firewall rule for 3306, and check with ss that it listens on 127.0.0.1 only.
What does PACKET_OBFUSCATION do?
It is rAthena's support for the obfuscated packet format of clients from 2011-08-17 onwards. It is on by default for those packet versions, and your own keys go in src/custom/defines_pre.hpp. The client has to use the same keys.
Do the ddos settings in packet_athena.conf protect my server from DDoS?
Only from one address opening connections too fast. They run inside rAthena, so a flood that fills the network port is decided before they ever see a packet. Keep them on, and put a network filter in front.
Sources
- Security advisoriesrAthena on GitHub
- Heap-based buffer overflow in login server (GHSA-4p33-6xqr-cm6x)rAthena on GitHub
- SQL Injection in PartyBooking component (GHSA-x99j-36m7-4vv7)rAthena on GitHub
- Commit 0d89ae0: Fixed SQL escapingrAthena on GitHub
- Missing bound check in chclif_parse_moveCharSlot (GHSA-pjh7-jgr8-4ff6)rAthena on GitHub
- Use after free in RODEX (GHSA-9mj9-8vgv-r92j)rAthena on GitHub
- CVE-2025-58447NIST National Vulnerability Database
- git-merge-baseGit documentation
- conf/login_athena.confrAthena on GitHub
- conf/char_athena.confrAthena on GitHub
- conf/map_athena.confrAthena on GitHub
- conf/inter_athena.confrAthena on GitHub
- conf/packet_athena.confrAthena on GitHub
- conf/web_athena.confrAthena on GitHub
- src/config/packets.hpprAthena on GitHub
- sql-files/main.sqlrAthena on GitHub
- ConnectingrAthena wiki
- ss(8), Debian bookworm manpagesDebian
- ufw(8), Debian bookworm manpagesDebian
- rAthena server hardening guideClouduxe on GitHub