Intel

AIKIDO-2024-10357

postgrex is vulnerable to Code Injection

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

80

High Risk

This Affects:

elixirpostgrex
0.7.0 - 0.19.1
Fixed in 0.19.2
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.

Who does this affect?

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

Background info

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

How to fix this

Upgrade the postgrex library to the patch version.