GHSL-2023-116: Denial of Service (DoS) in MySQL - CVE-2023-22057
A use-after-free in MySQL's session GTID tracking allows an authenticated user to crash the server by toggling a session variable, resetting the connection, and committing a write transaction. This results in a denial of service.
Originally disclosed on GitHub Security Lab
A segfault can be triggered by switching sessiontrackgtids on and off and then either resetting the session or switching users, resulting in a loss of service.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
This issue may lead to Denial of Service (DoS).
What the attacker needed
Authenticated MySQL session; ability to set session variables; ability to reset connection; write access to any table
The fix
The fix was made public as part of Oracle’s Critical Patch Update release for July.
How it was found
- Set session_track_gtids to OWN_GTID or ALL.
- Set session_track_gtids to OFF.
- Reset the connection using COM_CHANGE_USER or COM_RESET_CONNECTION.
- Set session_track_gtids to OWN_GTID or ALL again.
- Commit a write transaction to trigger the crash.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A use-after-free is a bug where a program keeps a pointer to memory after it has been freed, and later uses it. In MySQL, a session setting can leave such a dangling pointer, and when the session is reset and a write happens, the server crashes. An attacker with a normal database account can cause this crash, disrupting service.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.