Skip to content
Memory corruption Advisory Advanced CVE-2022-39377

GHSL-2022-074: Arithmetic overflow in sysstat - CVE-2022-39377

On 32-bit systems, the allocate_structures function multiplies three size values without checking for overflow, so a crafted activity data file can cause an undersized buffer to be allocated. This may lead to a variety of exploit primitives, including remote code execution.

Kwstubbs Follow

Originally disclosed on GitHub Security Lab

On 32 bit systems, an arithmetic overflow present in allocatestructures can be triggered when displaying activity data files and may lead to a variety of exploit primitives due to an incorrectly sized buffer.

Kwstubbs, on GitHub Security Lab

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 code multiplies three size values to compute an allocation size without checking whether the multiplication overflows on 32-bit systems.

Impact

This issue may lead to Remote Code Execution (RCE).

What the attacker needed

32-bit system; crafted activity data file

The fix

The issue was fixed by a patch published on 2022-10-24 and later refactored.

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.

When a program needs memory, it calculates how much to ask for by multiplying numbers together. On older 32-bit systems, that multiplication can wrap around to a small number, so the program gets a tiny buffer but then writes more data into it than fits. That memory corruption can let an attacker run their own code.

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 Kwstubbs

View all

43 more disclosed reports, best first.

More from GitHub Security Lab

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.