Cloudanix VulnDB

CVE-2022-28042

High · 8.8

CVSS

8.8

EPSS

1.6%

Published

Apr 15, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in how some apps handle image files could let attackers crash those apps or take control of devices by tricking users into opening a bad picture.

Exploit Available
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Remote Code Execution
Component
Library
Class
Use After Free
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Heap-based use-after-free in the stbi__jpeg_huff_decode function of stb_image.h allows memory corruption during JPEG processing.

Why it matters to the business

Applications using the affected library face risk of crashes or remote code execution when processing untrusted images, potentially disrupting mobile app services and requiring urgent dependency updates.

How an attack unfolds

An attacker crafts a malicious JPEG image that triggers the use-after-free condition during Huffman decoding; when the image is loaded by an affected application the corrupted memory state can be leveraged for arbitrary code execution.

How to fix it

Upgrade software-mansion/react-native-reanimated to commit 1b61196c1a5e2f05da533b6035c6663d0129bbc5 or later; rebuild and redeploy all dependent mobile applications.

How to confirm the fix worked

Verify the react-native-reanimated dependency resolves to commit 1b61196c1a5e2f05da533b6035c6663d0129bbc5 and test image decoding with known-malformed JPEG samples for absence of crashes or memory errors.

Typical attack path

  1. Attacker prepares a specially crafted JPEG file exploiting the Huffman decode path
  2. Victim application loads the image via the vulnerable stb_image code path
  3. Use-after-free occurs leading to memory corruption
  4. Attacker chains the corruption to achieve code execution or denial of service

How to detect it

Review application crash logs and memory sanitizer reports for patterns involving JPEG Huffman decode failures; inspect network or file logs for unexpected JPEG uploads immediately preceding crashes.

What your security team should do

  • Immediately update react-native-reanimated to the fixed commit across all projects
  • Scan dependency trees for any other packages shipping the vulnerable stb_image version
  • Add automated dependency update checks and image-fuzzing tests to the CI pipeline
  • Monitor for new exploit code or public PoCs given the ExploitAvailable maturity

The record

stb_image.h v2.27 was discovered to contain an heap-based use-after-free via the function stbi__jpeg_huff_decode.

Affected packages

Ecosystem Package Introduced Fixed
Debian:10 libstb 0 0.0~git20180212.15.e6afb9c-1+deb10u1
Debian:11 libstb 0 No fix
Debian:12 libstb 0 No fix
Debian:13 libstb 0 0.0~git20230129.5736b15+ds-1
Ubuntu:20.04:LTS libstb 0 No fix
Ubuntu:22.04:LTS libstb 0 No fix
Ubuntu:24.04:LTS libstb 0 No fix
Ubuntu:24.10 libstb 0 No fix
Ubuntu:25.04 libstb 0 No fix
Ubuntu:25.10 libstb 0 No fix
Ubuntu:Pro:20.04:LTS libstb 0 No fix

Related vulnerabilities