Skip to content
Memory corruption Write-up Advanced

CVE-2026–33147: Stack Buffer Overflow in GMT Leads to Potential

A stack-based buffer overflow in GMT's gmt_remote_dataset_id function occurs because user input is copied with strcpy without bounds checking. An attacker could crash the application and potentially achieve remote code execution depending on the environment.

Redpoc Follow

Published on medium.com

A stack-based buffer overflow in GMT (gmtremotedatasetid) can be triggered via PyGMT by supplying an oversized input. This results in memory corruption and may lead to Remote Code Execution (RCE) depending on the environment.

Redpoc, on medium.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The function gmt_remote_dataset_id uses strcpy to copy user-controlled input into a fixed-size stack buffer without any length validation.

Impact

The vulnerability causes application crashes and memory corruption, and may lead to remote code execution depending on the environment.

What the attacker needed

Application uses PyGMT; attacker can supply input to GMT modules

The fix

The vulnerability was fixed by replacing strcpy with strncpy and ensuring null termination.

How it was found

  1. Import the Session class from pygmt.clib.
  2. Create a Session object.
  3. Build a payload consisting of a long padding string followed by fake return addresses.
  4. Call lib.call_module with the 'which' module and the payload as an argument.
  5. Observe a segmentation fault and AddressSanitizer stack-buffer-overflow report.

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 write-up has not been written yet. The Original tab links to the source.

A buffer overflow happens when a program writes more data into a fixed-size memory area than it can hold, corrupting nearby memory. Here, a function in a C library copies user input without checking its length, so a very long string can overwrite the stack and crash the program or possibly 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 Redpoc

View all

2 more disclosed reports, best first.

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.