/ Модель

Характеристики

Опубликована
16 июл 2026

huntr-poc-jax-export-deserialize-shapepoly-power-oom

Языковая модель3 профессии

Отчет описывает уязвимость отказа в обслуживании из-за чрезмерного расхода памяти при десериализации экспортированных объектов JAX.

0скачиваний за 30 дней0лайковвеса обновлены16 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это отчет о проблеме безопасности в JAX, а не описание модели или ее весов. В README описана уязвимость отказа в обслуживании при разборе сериализованного объекта Exported через jax.export.deserialize(): строка размерности с возведением константы в неограниченную степень может привести к чрезмерному расходу памяти и аварийному завершению процесса.

Проблема затрагивает парсер символических форм в JAX 0.10.2 и связана с тем, что показатель степени вычисляется без ограничения до завершения проверки входных данных. Указаны затронутые модули, пример эксплуатации и возможное исправление — ограничивать показатель или размер результата до вычисления. Это не уязвимость удаленного выполнения кода.

Репозиторий не содержит сведений о модели, ее задачах, архитектуре, языках или лицензии; метаданные также не задают задачу модели. Поэтому запись можно использовать для поиска и анализа уязвимостей JAX, но не как карточку ML-модели.

Сценарии применения

  • поиск уязвимостей в JAX
  • анализ отказа в обслуживании при десериализации
  • проверка обработки недоверенных сериализованных артефактов

Ограничения

Это отчет о безопасности, а не модель; данных для определения задач и возможностей модели нет. Описанный эффект — отказ в обслуживании из-за расхода памяти, а не удаленное выполнение кода.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Uncontrolled resource consumption (memory-exhaustion DoS) in jax.export.deserialize via unbounded symbolic-shape power expression

Summary

jax.export.deserialize() parses a serialized Exported object from an untrusted flatbuffer. During deserialization it passes attacker-controlled per-dimension shape strings straight into JAX's symbolic-shape polynomial parser. The parser's ^ (power) operator reads an unbounded integer exponent and eagerly evaluates factor ** exponent. When the base factor is a constant (e.g. 2), a single tiny shape string such as "2^2000000000" forces Python to materialize a multi-gigabit bignum (2 ** 2_000_000_000) at the very first deserialization step, exhausting memory and triggering an OOM-kill. The exponent is fully attacker-controlled, so the memory cost scales linearly to arbitrary GB.

  • Target: jax (google/jax) — PyPI jax / jaxlib 0.10.2 (current latest at time of report)
  • Sink module: jax/_src/export/shape_poly.py (_Parser.term), reached via jax/_src/export/serialization.py (_deserialize_aval / _deserialize_exported)
  • Public entry point: jax.export.deserialize(blob)
  • Impact: Denial of Service (memory exhaustion / OOM). Not RCE.
  • CWE: CWE-400 (Uncontrolled Resource Consumption) / CWE-1284 (Improper Validation of Specified Quantity in Input)

Threat model

Exported blobs are the on-disk / on-wire serialization format for JAX exported functions and are shared, downloaded, and loaded as untrusted model artifacts. This is the same untrusted-model-file threat model under which the previously-filed jax.export pickle bug in this same module was filed. Harm here is a DoS (OOM), not RCE, so severity is lower.

Reviewer note (disclosed up front): deserialize()'s docstring states its input "must be trusted." A reviewer could contest the report on that trust-boundary docstring. The counter-argument is that the format is a model-distribution format and this is the identical threat model already accepted for the pickle finding in this module; the fix (bounding the parsed exponent) is cheap and local regardless.

Root cause

1. Untrusted shape strings flow into the symbolic-shape parser

jax/_src/export/serialization.py, _deserialize_aval (~line 821). The per-dimension shape entries from the flatbuffer are joined and handed directly to shape_poly.symbolic_shape:

def _deserialize_aval(aval: ser_flatbuf.AbstractValue, *,
                      scope: shape_poly.SymbolicScope,
                      sharding: named_sharding.NamedSharding | None,
                      ) -> core.ShapedArray:
  dtype = _dtype_kind_to_dtype[aval.Dtype()]
  shape = shape_poly.symbolic_shape(
      ",".join(
            aval.Shape(i).decode("utf-8") for i in range(aval.ShapeLength())
        ),
        scope=scope, ...)

_deserialize_exported (~line 284) iterates every entry in UniqueAvals and calls _deserialize_aval, so the parse happens eagerly and early — before most other validation.

2. Unbounded integer exponent evaluated eagerly

jax/_src/export/shape_poly.py, _Parser.term (~line 1653-1657):

    # A term is product of factors. Each factor may be raised to an integer power.
    acc: DimSize | None = None
    while True:
      f: DimSize
      f, tok = self.factor(tok)
      if tok.exact_type == tokenize.CIRCUMFLEX:
        tok = self.next_tok()
        self.expect_token(tok, [tokenize.NUMBER])
        power, tok = self.integer(tok)   # int() of a NUMBER token — NO upper bound
        f = f ** power                   # eagerly computes constant ** power (bignum)

self.integer(tok) is just int() of the token text with no upper bound, and f = f ** power immediately materializes the result. With f == 2 and power == 2_000_000_000, this allocates a ~2-billion-bit (~250 MB per copy, multiple GB peak) Python integer synchronously during deserialization.

Proof of Concept

A minimal but real malicious Exported flatbuffer (116 bytes) is built with the real jaxlib-shipped flatbuffers builder (jax._src.export.serialization_generated): one AbstractValue in UniqueAvals whose single Shape entry is the string "2^2000000000", dtype f32. Feeding this to the public API jax.export.deserialize(bytearray(blob)) drives the shape_poly parser to compute 2**2_000_000_000 at the first deserialization step.

  • craft_jax_export.py — builds the blob and calls the real public API, measuring peak RSS.
  • malicious_exported.bin — the 116-byte malicious Exported flatbuffer.

Run:

python craft_jax_export.py control                # benign shape "3"
python craft_jax_export.py malicious 2000000000   # malicious shape "2^2000000000"

The negative control is an identical flatbuffer whose shape string is the benign constant "3".

Captured evidence (verbatim)

Environment: jax 0.10.2 jaxlib 0.10.2 flatbuffers 25.12.19 py 3.13.12, clean venv.

[control] benign shape '3':
[craft] shape='3'  blob_size=104 bytes  rss_before=193.5MB
[deserialize] AttributeError: 'NoneType' object has no attribute 'decode'  after 0.000s  rss_peak=193.5MB

[attack] shape '2^2000000000' from a 116-byte file:
[craft] shape='2^2000000000'  blob_size=116 bytes  rss_before=193.4MB
[deserialize] AttributeError: 'NoneType' object has no attribute 'decode'  after 5.251s  rss_peak=988.1MB

--- linear/unbounded scaling (peak RSS grows with attacker exponent) ---
2^100000000  -> rss_peak=234.9MB  (0.19s)
2^500000000  -> rss_peak=403.1MB  (1.19s)
2^1000000000 -> rss_peak=609.8MB  (2.45s)
2^3000000000 -> rss_peak=1364.7MB (7.77s)
(control stays flat at 193.5MB)

Independently reproduced again at packaging time (same venv):

[craft] shape='3'  blob_size=104 bytes  rss_before=193.6MB
[deserialize] AttributeError: 'NoneType' object has no attribute 'decode'  after 0.000s  rss_peak=193.6MB
===
[craft] shape='2^1000000000'  blob_size=116 bytes  rss_before=193.7MB
[deserialize] AttributeError: 'NoneType' object has no attribute 'decode'  after 2.500s  rss_peak=607.0MB

On the incidental AttributeError

The AttributeError: 'NoneType' object has no attribute 'decode' is not the vulnerability. It is an artifact of the deliberately minimal flatbuffer omitting the FunctionName field, and it fires only after the multi-GB bignum has already been materialized at the aval-parse step. This is proven by the control, which reaches the identical code path and returns instantly (0.000s) at unchanged RSS (193.5MB) because its benign shape "3" requires no bignum. The measured quantity is peak RSS and wall-clock time at the parse step, both of which scale with the attacker-controlled exponent while the control stays flat. A more complete flatbuffer would let deserialization proceed further, but the OOM already occurs at the shape-parse step regardless.

Suggested fix

Bound the exponent parsed by _Parser.term (e.g. reject powers above a small limit such as 128), or bound the bit-length / magnitude of any constant produced during symbolic-shape parsing, before evaluating f ** power. The DoS surface is the ^ operator applied to a constant factor with an unbounded exponent.

Dedup / prior-work note

This is distinct from prior findings:

  • Different module & sink from the previously-filed jax.experimental.serialize_executable pickle find_class RCE (that is a pickle reduction RCE; this is a flatbuffer + shape_poly integer-power parser DoS).
  • Different mechanism from the orbax msgpack/zarray HF PoCs (msgpack / zarray shape alloc).
  • Sink here is specifically the jax/_src/export/shape_poly.py _Parser.term ^-power handler reached via jax.export.deserialize — a flatbuffer-format DoS, not pickle/msgpack.
  • No known CVE covers unbounded exponent evaluation in the JAX symbolic-shape parser at time of report.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

У модели не указана задача.

Ревизия весов
bd7d0f5

0 моделей