Skip to content
Memory corruption Advisory Advanced CVE-2017-1105

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.

Tim Brown Follow

Originally disclosed on Cisco Talos

Medium 5.1 View original

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.

Tim Brown, on Cisco Talos

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

  1. As the db2inst1 OS user, enable tracing with db2trc on.
  2. As another OS user, write to the shared memory using smaSHeM.
  3. As the db2inst1 OS user, request trace info with db2trc info.
  4. 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.

More by Tim Brown

View all

5 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.