CVE-2021-31315
NixOS vulnerability analysis and mitigation

Overview

A stack-based buffer overflow vulnerability was discovered in Telegram's custom fork of the rlottie library, affecting Telegram Android <7.1.0 (2090), Telegram iOS <7.1, and Telegram macOS <7.1. The vulnerability (CVE-2021-31315) was identified in the blit function, where a remote attacker could potentially access Telegram's stack memory out-of-bounds on a victim device through a malicious animated sticker (Shielder Advisory).

Technical details

The vulnerability occurs in the blit function where bound checks are insufficient against negative indices. When spans->x is negative, an out-of-bounds read access is triggered during the std::max call, where the address of ptr is calculated using the negative span->x value. The vulnerability has a CVSS v3.1 score of 5.5 (Medium) (NVD).

Impact

An attacker could potentially access Telegram's stack memory out-of-bounds on a victim device. The vulnerability only triggers when a chat containing the malicious animated sticker is opened, making it a persistent threat that could prevent users from accessing previous messages in the affected chat (Shielder Blog).

Exploitability

The vulnerability can be exploited through malicious animated stickers sent via secret chats in Telegram. The attack requires user interaction as the sticker is only parsed and rendered when the chat is opened. The vulnerability was more impactful in secret chats where automatic chat acceptance was possible before Telegram introduced additional security measures (Shielder Blog).

Mitigation and workarounds

The vulnerability was patched in Telegram Android v7.1.0 (2090), Telegram iOS v7.1, and Telegram macOS v7.1. Telegram also implemented additional security measures requiring animated stickers in secret chats to be part of verified sticker sets, preventing arbitrary sticker parsing (Shielder Advisory).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-78662HIGH7.5
  • Docker logoDocker
  • telegraf-1.38
NoYesSep 02, 2026
CVE-2026-56855HIGH7.5
  • Docker logoDocker
  • flux-notification-controller
NoYesSep 02, 2026
CVE-2026-84642HIGH7.5
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:thunderbird
NoYesSep 01, 2026
CVE-2026-84641HIGH7.5
  • NixOS logoNixOS
  • thunderbird
NoYesSep 01, 2026
CVE-2026-84640HIGH7.5
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:thunderbird
NoYesSep 01, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management