IBM DB2 Shared Memory Insecure Permissions Vulnerability
IBM DB2 creates a shared memory segment with world-readable and world-writable permissions, allowing any local user to read or modify it. An attacker can overwrite the segment to cause memory corruption in db2trc, potentially leading to arbitrary code execution as the db2inst1 user.
An exploitable shared memory permissions vulnerability exists in the functionality of IBM DB2 10.5.0.7. An attacker can access the shared memory without any specific permissions to trigger this vulnerability.
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
Root cause
The shared memory segment was created with permissions 667, allowing any local user to read and write it.
Impact
An attacker could cause memory corruption in db2trc, potentially leading to arbitrary code execution as the db2inst1 OS user, but only if the attacker is in a DB2 admin group or can persuade the db2inst1 user to run db2trc info.
What the attacker needed
Local access to the system; DB2 instance running; attacker in DB2 admin group or can persuade db2inst1 user
How it was found
- As the db2inst1 OS user, enable tracing with db2trc on.
- As another OS user, write to the shared memory using smaSHeM.
- As the db2inst1 OS user, request trace info with db2trc info.
- Observe the segmentation fault and corrupted register value.
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.
Shared memory is a way for programs to share data quickly. DB2 set up a shared memory area that any user on the computer could read and write to. By writing junk into it, an attacker can crash or possibly take over a DB2 program that runs with higher privileges.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.