Since version 13.2, Telegram for iOS draws animated stickers, emoji and reactions with tlottie, a library written in Rust, and the old rlottie engine has been removed from the app. Android moved to tlottie in August and desktop in September, so the old engine is gone from all three main clients. rlottie is where the authors of the OffensiveCon talk found 14 vulnerabilities: on iOS and desktop a sticker closed the app without a single tap, and in the iOS simulator it executed code.

What to do

Update Telegram to a version that no longer contains rlottie:

ClientVersion without rlottieWhen
Android12.10.0source published August 22
Desktop7.2.7September 7
iOS13.2release tag of November 3, the App Store now has 13.2.1

What tlottie is

An animated sticker is a TGS file: gzip-compressed JSON in the Lottie format, where every frame is described by vector paths, gradients and masks. The client receives this JSON from the sender and rasterizes it itself, so the rendering engine is the first place where someone else's file meets the code on your device.

tlottie is a new implementation of such an engine: about 27,000 lines of Rust under the MIT license, with no third-party dependencies. The repository was created on July 14, 2026; the current version is 1.0.6 from September 17. Telegram's clients pull it in directly: iOS keeps it as a source submodule, Android as a prebuilt static library for four CPU architectures, desktop as an external build dependency.

The first line of the library's description is about speed, the second says that animation JSON is treated as untrusted input. Speed is compared against the 2019 fork of rlottie the clients used, on more than 17,000 animations from Telegram: on a Samsung Galaxy Fold7 a 64-pixel frame renders 64.7% faster, a 720-pixel one 52% faster. On the budget Galaxy F15 the gain on large frames is smaller, 23%.

Why Rust closes the class of bugs that was found

All five headline findings of the talk are memory corruption bugs typical of C++: writes past the end of a buffer on the stack and on the heap, reads of uninitialized memory, type confusion. By default Rust does not let you write any of these at all.

  • Out-of-bounds access. Every indexed access is checked, and tlottie additionally bans direct indexing in its linter settings: an element is fetched with a method that returns "nothing" on a miss, and the code has to handle that.
  • Uninitialized memory. A variable cannot be read before something has been written to it; the compiler checks this.
  • Type confusion. In rlottie the LOTAnimatable field held either a value or a pointer, and the check for which one was there sat in an assert that does not run in release builds. In Rust such a field is an enum with a variant tag, and it cannot be read as another variant without an explicit check.

These rules can only be bypassed with an unsafe block. tlottie denies it for the whole library and allows it explicitly in 15 modules: CPU vector instructions for NEON, SSE2, AVX2, AVX-512 and WebAssembly, the bindings for calling from C and from the browser, pixel operations, and math function substitutes for builds without the standard library. JSON parsing and frame geometry are not among them.

The OffensiveCon speaker covered the replacement in one sentence: the authors did not look at tlottie, but since it is Rust, it probably has fewer memory corruption bugs, or none.

What Rust does not close

A logic bug is a bug in any language, and a sticker can still make a client work too long or take too much memory. tlottie has a separate system for that.

Limits on everything that can multiply. Input file up to 16 MiB, JSON nesting up to 175 levels, layers across the whole animation up to 2,720, vertices in a single path up to 4,355, points per frame after curves are expanded up to 3.6 million, canvas side up to 8,192 pixels. The code records where the numbers come from: each limit is at least five times what the animations in the test set needed. Exceeding a limit returns an error instead of closing the app; a corrupted file also gets an error back.

How the frame budget is counted

A limit is checked before the work is done, not after. Before splitting a path curve into segments, the library reserves the maximum number of points that split can produce and charges it to the frame counter; whatever goes unused is refunded afterwards. The same goes for bytes spent on dashed strokes and for the number of layers after nested compositions are expanded, when one layer references another animation. Say, an animation with a thousand references to a composition that itself references a thousand stops at the counter, not at running out of memory.

Hang tests. The repository holds 112 denial-of-service regression tests. According to the suite's description, each is a piece of JSON on which tlottie once ran from seconds to forever or took gigabytes of memory. The test runs it on a separate thread with a time and memory budget; the fixed code finishes in a few milliseconds and a few megabytes.

No I/O at all. JSON arrives in the library as ready bytes, and external references inside it, to fonts or image files, are never opened.

How Telegram for iOS moved to tlottie

On iOS the move took two steps, and both are visible in the client's open source code.

On September 11 tlottie was added as a second engine next to rlottie. The engine choice was passed to every place where an animation is created, and the server could send everyone back to rlottie with the ios_killswitch_disable_tlottie flag. Telegram's limits on sticker size, frame rate and duration were moved out of the engine one level up, so that flipping the flag changed only how a sticker is rasterized, not which stickers are shown at all.

On October 28 rlottie was removed entirely: the submodule, the binding, the server flag, the switch in debug settings and the engine choice parameter threaded through 460 files. The commit description lists four places where network content was parsed by rlottie whatever the flag said:

  • emoji statuses and custom emoji badges next to a name;
  • custom emoji in notification text;
  • animated stickers when exporting from the media editor;
  • about 45 built-in interface animations.

Before the removal, all 358 animations bundled with the app were run through both engines. tlottie rejected none, frame counts and frame rates matched everywhere, and pixel differences came down to edge antialiasing, at most 5% of pixels on one file. On this set tlottie was about 4.6 times faster. Both commits are in the release-13.2 tag of November 3.

On desktop the move fit into a single commit on September 6 titled "Move rlottie -> tlottie"; the notes for version 7.2.7, released the next day, say one thing: crashes on invalid Lottie files are fixed.

Where rlottie remains

  • The Apple Watch app. It has its own copy of rlottie, and the removal commit states explicitly that it was not touched.
  • Discord. Its iOS and Android apps, according to the speaker, use the rlottie forks made by Telegram. Discord's GitHub organization holds RLottieAndroid, last committed to in January 2026, and an iOS binding unchanged since 2020.
  • rlottie itself. Samsung's original library keeps developing: the latest commits, from September 30, add size checks when allocating memory for images. Telegram's fork got its last fix on September 6, a crash on a polygon shape.

What the Telegram server uses to check stickers at upload now is not visible from the open source code: according to the talk, before the replacement it rendered them with the iOS fork.