Intel

AIKIDO-2024-10357

postgrex is vulnerable to Code Injection

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Oct 23, 2024
October 23, 2024

80

CVE Score

High

Code Injection

Are you affected? Scan for Free

TL;DR

Affected versions of the package are vulnerable to code injection due to improper handling of byte lengths in the PostgreSQL binary protocol. Clients that fail to check the length of bytes before encoding the 4-length bytes allow attackers to send data greater than 2^32, causing an overflow. This overflow enables the smuggling of an additional message, potentially leading to code execution or other malicious behavior.

How do I fix this?

Upgrade the postgrex library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Package

Versions

0.7.0 - 0.19.1

Fixed in 0.19.2

Background info

postgrex is vulnerable to Code Injection in versions 0.7.0 - 0.19.1.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea