Перейти к содержимому
Noroxi
Рекомендация экосистемы OSV

GHSA-9x4h-8wgm-8xfg: Malformed CAR panics and excessive memory usage

Средняя—Эксплойта нет Есть исправление

Оценка Noroxi

Приоритет: Наблюдать (оценка срочности 0/100)

  • В отслеживаемых источниках (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) нет публичного эксплойта или записей об эксплуатации.
  • Исправленная версия: github.com/ipld/go-car (Go) 0.4.0; github.com/ipld/go-car/v2 (Go) 2.4.0.

Пока низкий приоритет. Обновитесь до github.com/ipld/go-car (Go) 0.4.0; github.com/ipld/go-car/v2 (Go) 2.4.0 или новее.

Формируется автоматически по данным записи: CVSS (NVD и CNA), CISA KEV и SSVC, FIRST EPSS, источники эксплойтов, исправленные версии. Как мы считаем

Первоисточники: OSV

### Impact **Versions impacted** * `<=` go-car@v0.3.3 * `<=` go-car@v2.3.0 **Description** Decoding CAR data from untrusted user input can cause: - Panics: - Out of bound memory access - Out of memory - Divide by zero - Excessive memory usage Such panics can be triggered by intentionally malformed CARv1 data, including CARv1 data within a CARv2 container; and also CARv2 data with excessively large indexes. These vulnerabilities are not known to be exploited in the wild and were discovered primarily with the use of code fuzzing tooling. **Details** **Out of bound memory access** (OOB), **out of memory** (OOM) panics or **excessive memory usage** can be triggered by decode of malformed CARv1 headers, malformed CARv1 sections, and malformed CIDv0 data used in CARv1 sections. This also applies to CARv1 data within a CARv2 container. Additionally, we wish to use this security advisory to make clear to consumers of CARv2 format data that **loading CARv2 indexes from untrusted sources is dangerous and should be avoided**. Where CAR data indexes are required, they should be regenerated locally. Out of memory (OOM) panics or excessive memory usage can be triggered by decode of intentionally malformed CARv2 indexes, or CARv2 indexes which are larger than available system memory (i.e. parallelization of CARv2 decodes may increase such a vulnerability). ### Patches **Fixed versions** * `>=` go-car@v0.4.0 * `>=` go-car@v2.4.0 **Description of user-facing changes** ***go-car@v0.4.0*** imposes a fixed maximum header length and section length of 32 MiB during decode. Headers exceeding this length will cause the decoder to return an error as the initial CAR decode occurs. Sections (the combination of CID and block data) exceeding this length will cause the decoder to return an error as that section is read. The default maximum of 32 MiB may be changed _globally_ in an application instance by directly changing the `MaxAllowedSectionSize` variable in the `github.com/ipld/go-car/util` package. We recommend that users of go-car@v0 upgrade to go-car@v2, where these maximums may be applied per-decode rather than globally. ***go-car@v2.4.0*** imposes a default maximum header length of 32 MiB and a default maximum section length of 8 MiB. Headers exceeding this length will cause the decoder to return an error as the initial CAR decode occurs. Sections (the combination of CID and block data) exceeding this length will cause the decoder to return an error as that section is read. The default values may be adjusted by supplying a `MaxAllowedHeaderSize(x)` or `MaxAllowedSectionSize(y)` option to any decode function that accepts options. These include: * `OpenReader()` * `NewReader()` * `NewBlockReader()` * `ReadVersion()` * `LoadIndex()` * `GenerateIndex()` * `ReadOrGenerateIndex()` * `WrapV1()` * `ExtractV1File()` * `ReplaceRootsInFile()` * `blockstore/NewBlockReader()` * `blockstore/NewReadOnly()` * `blockstore/OpenReadOnly()` * `blockstore/OpenReadWrite()` Please be aware that the default values are **very generous** and may be lowered where a user wants to impose restrictions closer to typical sizes. * Typical header lengths should be in the order of 60 bytes, but the CAR format does not specify a maximum number of roots a header may contain. The default maximum of 32 MiB makes room for novel uses of the CAR format. * Typical IPLD block sizes are under 2 MiB, and it is generally recommended that they not be above 1 MiB for maximum interoperability (e.g. there are hard limitations when sharing IPLD data with IPFS). CARv1 sections are the concatenation of CID and block bytes. The default maximum section length of 8 MiB makes room for novel IPLD data. ***go-car@v2.4.0*** introduces a new API that can be used to inspect a CAR and check for various errors, including those detailed in this advisory. The `Reader#Inspect(bool)` API returns a `Stats` object with various details about the CAR, such as its version, number of blocks, and details about codecs and multihashers used. When its argument is `true`, it will also perform a full hash consistency check of blocks contained within the CAR to ensure they match the CIDs. When `false`, block data is skipped over so a scan will likely be more efficient than reading blocks through a `BlockReader` if statistics and/or validity checking is all that's required. Note that `Inspect()` does minimal checking of index data; the strong recommendation is that if index data is untrusted then it should be regenerated. ***go-car@v2.4.0*** also includes additional documentation regarding the dangers of consuming CARv2 index data from untrusted sources and a recommendation to regenerate indexes of CAR data from such sources where an index is required. ### Workarounds There are no workarounds for vulnerabilities in impacted versions decoding CARv1 data. Users of impacted versions should avoid accepting CAR data from untrusted sources. OOM or excessive memory usage vulnerabilities resulting from CARv2 index parsing in impacted versions can be avoided by not reading indexes from CARv2 data from untrusted sources. ### References Details on the CARv1 and CARv2 formats, including the composition of CARv1 headers and sections, and CARv2 indexes can be found in the CAR format specifications: https://ipld.io/specs/transport/car/ ### For more information If you have any questions or comments about this advisory please open an issue in [go-car](https://github.com/ipld/go-car).

Опубликовано
6 июл. 2022 г.
Обновлено
8 нояб. 2023 г.
EPSS
—

Инструменты для отчёта

JSON

Оценка срочности

0

Наблюдать

Пока низкий приоритет.

CVSS
0 / 40 · —
CISA KEV
0 / 30 · Нет в списке
EPSS
0 / 30 · —

Узнайте, когда запись изменится

  • Нет в KEV: эксплуатация в реальных атаках не зафиксирована
  • Публичного эксплойта нет
  • Исправление выпущено

Если что-то из этого изменится, сообщим в ежедневной сводке.

Следить за GHSA-9x4h-8wgm-8xfg

Когда мы напишем

  • когда запись попадёт в CISA KEV
  • когда появится или станет боевым эксплойт
  • когда запись обновится (в том числе исправленная версия)
  • когда EPSS вырастет на 20 пунктов за неделю

Одна сводка в день по почте (06:00 UTC); с вебхуком попадание в KEV и боевые эксплойты — на платных планах раз в 10 минут, на бесплатном раз в час.

С бесплатным аккаунтом также

  • Оповещения о CVE: добавьте свои продукты и версии — новые CVE для них придут вам
  • Мониторинг сайта: 1 сайт, письмо сразу при недоступности
  • Добавьте домен: поддомены и риск захвата проверяются каждую неделю (1 домен)
  • 10 проверок в час в инструментах безопасности, не больше 30 в день (без аккаунта — 3 в день), API-ключ и MCP
  • Все сканирования в одной панели: находки, изменения с прошлого сканирования, отчёт по домену или клиенту (PDF, ссылка для просмотра)
Все бесплатные инструменты

Регистрация по почте · Уже есть аккаунт? Войти

Бесплатный аккаунт, без карты. Отписаться можно в любой момент.

Затронута ли ваша версия? Проверьте

Анализ Noroxi

Что это значит для вашей инфраструктуры?

Оценка выше формируется автоматически по данным записи и не знает вашей среды. Наша команда проверит на ваших системах, действительно ли уязвимость эксплуатируема и какой меры достаточно.

Мы используем этот продукт, нужна помощь

Затронутые системы

Затронута ли ваша версия?

Выберите продукт и введите свою версию. Она сравнивается с диапазонами этой записи прямо в браузере и никуда не отправляется.

ВендорПродукт
Gogithub.com/ipld/go-car
Gogithub.com/ipld/go-car/v2

Затронутые пакеты

Данные OSV и GitHub Advisory: экосистема, пакет и диапазон. Сопоставление SBOM использует эту таблицу.

ЭкосистемаПакетЗатронутый диапазонИсправление
Gogithub.com/ipld/go-carдо 0.4.00.4.0
Gogithub.com/ipld/go-car/v2с 2.0.0 · до 2.4.02.4.0

Тот же продукт

Go: все записи

Другие записи с наивысшей оценкой для того же основного продукта.

  • GO-2022-0503Denial of service via malformed CAR data in github.com/ipld/go-car and go-car/v2
    0Наблюдать

Исправление

На какую версию обновиться

Версии с исправлением по данным вендора, реестров пакетов и Microsoft. Перед обновлением сверьтесь с бюллетенем вендора.

Продукт / пакетИсправленная версияИсточник
Go:github.com/ipld/go-car0.4.0Реестр пакетов (OSV)
Go:github.com/ipld/go-car/v22.4.0Реестр пакетов (OSV)

Статус эксплойта

Публичный эксплойт неизвестен

Публичный эксплойт пока не обнаружен. Это не значит, что вы в безопасности, лишь что порог чуть выше.

Контекст для исследователя

Для пентестеров и исследователей: профиль атаки, расхождение оценок, хронология, коммиты исправлений, авторы, кандидаты в варианты и цепочки, охват bug bounty. Всё выводится из имеющихся данных; без кода эксплойтов.

Хронология

От публикации до сегодня: proof of concept, модуль Metasploit, CISA KEV и запись об исправлении. Даты — как сообщают источники.

Кроме публикации датированных событий нет.

В записи нет: истории EPSS · ссылки на коммит или PR с исправлением · указания авторов находки · кандидатов в варианты и цепочки · публичной программы вознаграждений.

Технические детали

Для этой записи нет вектора CVSS, условия атаки вывести нельзя.

Класс уязвимости (CWE)

CWE-400 · Uncontrolled Resource Consumption

Первопричина

Код, разбирающий вложенные структуры, не ограничивает глубину или размер. Небольшие входные данные могут привести к несоразмерной вычислительной нагрузке.

Ошибка в коде

Весь класс CWE-400

Показательный пример этого класса уязвимостей. Это не исходный код вендора; показан ошибочный шаблон и его исправление.

Уязвимый код

ts
function expand(node) {  return node.children.map(expand);}

Исправленный код

ts
const MAX_DEPTH = 32;function expand(node, depth = 0) {  if (depth > MAX_DEPTH) throw new Error("слишком глубоко");  return node.children.map((c) => expand(c, depth + 1));}

Контекст атаки

Шаблоны атак MITRE CAPEC и техники ATT&CK для этого класса уязвимости (CWE). Отправная точка для правил обнаружения и threat hunting.

Источники

Показать все источники (ещё 2)

Рекомендации вендоров и официальные записи. Ссылки на эксплойты/PoC намеренно исключены.

Все записи