diff --git a/.env.example b/.env.example index 2e9f054..710e5a5 100644 --- a/.env.example +++ b/.env.example @@ -1,41 +1,43 @@ -# Copy to .env for your LOCAL synthetic test environment; never commit .env. -# These are logical interface suggestions; map actual framework names in REPORT.md. -APP_HOST=0.0.0.0 -APP_PORT=8080 -APP_ENV=lab -SESSION_TTL_SECONDS=3600 -# Choose credentials locally. File paths contain no secret values. -DATABASE_URL_FILE=/run/secrets/database_url -# Optional on 3, required use on 4 in lab2; Redis OR Valkey: -SESSION_STORE=postgres -CACHE_URL_FILE=/run/secrets/cache_url -API_REPLICAS=2 -IDEMPOTENCY_TTL_SECONDS=86400 -S3_ENDPOINT=https://s3:9000 -S3_REGION=us-east-1 -S3_BUCKET=messenger-attachments -S3_ACCESS_KEY_ID_FILE=/run/secrets/s3_access_key_id -S3_SECRET_ACCESS_KEY_FILE=/run/secrets/s3_secret_access_key -MAX_UPLOAD_BYTES=10485760 -MAX_IMAGE_PIXELS=40000000 -BROKER_URL_FILE=/run/secrets/broker_url -WORKER_CONCURRENCY=2 -JOB_MAX_ATTEMPTS=5 -JOB_TIMEOUT_SECONDS=60 -STAGING_RETENTION_SECONDS=86400 -OTEL_SERVICE_NAME=messenger-api -# Worker must set a distinct service.name. -OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector:4318 -OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf -OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=lab -# TLS and OpenBao: actual paths/ports depend on your implemented trust matrix. +# Copy to .env for the LOCAL synthetic lab7 stand. Never commit .env or secrets/. +# Values are paths/names, not secrets. Real secret values are generated locally +# by scripts/bootstrap-secrets.sh and stored in secrets/ (gitignored). +COMPOSE_PROJECT_NAME=lab7 PUBLIC_BASE_URL=https://localhost:8443 -TLS_CA_FILE=/run/secrets/ca.crt -TLS_CERT_FILE=/run/secrets/service.crt -TLS_KEY_FILE=/run/secrets/service.key -BAO_ADDR=https://openbao:8200 -BAO_CACERT=/run/secrets/bao-ca.crt -# No root token here. Bootstrap operator -> short-lived service auth -> scoped token. +CA_FILE=./certs/ca.crt + +# Sessions are stored in PostgreSQL (no Valkey in lab7). +SESSION_TTL_SECONDS=3600 + +# Argon2id: OWASP minimum m=19 MiB, t=2, p=1. Raise only with measurement. ARGON2_MEMORY_KIB=19456 ARGON2_ITERATIONS=2 ARGON2_PARALLELISM=1 + +# Shared-across-replicas login limiter (PostgreSQL). +LOGIN_RATE_LIMIT_ATTEMPTS=10 +LOGIN_RATE_LIMIT_WINDOW_SECONDS=60 +LOGIN_RATE_LIMIT_BLOCK_SECONDS=60 +LOGIN_MAX_CONCURRENCY=2 + +# OpenBao: dev-mode is never used. AppRole credentials are written by +# scripts/openbao_bootstrap.py into secrets/bao_runtime/ and mounted read-only. +BAO_ADDR=https://openbao:8200 +BAO_TOKEN_TTL_SECONDS=300 +BAO_TOKEN_MAX_TTL_SECONDS=900 +BAO_SECRET_ID_TTL_SECONDS=3600 + +# Worker pipeline limits. +WORKER_CONCURRENCY=2 +WORKER_PREFETCH=2 +JOB_MAX_ATTEMPTS=5 +JOB_TIMEOUT_SECONDS=60 +STAGING_RETENTION_SECONDS=86400 + +# Telemetry stays inside the trusted network; every hop is TLS/mTLS. +OTEL_SERVICE_NAME=messenger-api +OTEL_EXPORTER_OTLP_ENDPOINT=https://internal-gateway:4318 +OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf +OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=lab +OTEL_SDK_DISABLED=false +OTEL_TRACES_SAMPLER=parentbased_always_on +OTEL_TRACES_SAMPLER_ARG=1.0 diff --git a/.gitignore b/.gitignore index b5a7189..d077192 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ .env.* !.env.example secrets/ -certs/private/ +certs/ *.key *.p12 *.pfx @@ -25,6 +25,7 @@ bin/ obj/ coverage/ *.log +!evidence/**/*.log .DS_Store .idea/ .vscode/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1573fb4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,62 @@ +# Сборка и рантайм разделены: в итоговый образ не попадают кэш pip и инструменты +# сборки, а зависимости ставятся по зафиксированному requirements.txt. +# Базовый образ закреплён по неизменяемому digest, а не только по тегу. +FROM python:3.11.9-slim-bookworm@sha256:8fb099199b9f2d70342674bd9dbccd3ed03a258f26bbd1d556822c6dfc60c317 AS builder + +ENV PIP_NO_CACHE_DIR=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PYTHONDONTWRITEBYTECODE=1 + +RUN python -m venv /opt/venv +COPY requirements.txt ./ +RUN /opt/venv/bin/pip install --no-cache-dir --timeout 60 -r requirements.txt + + +FROM python:3.11.9-slim-bookworm@sha256:8fb099199b9f2d70342674bd9dbccd3ed03a258f26bbd1d556822c6dfc60c317 AS runtime + +# Base image tag фиксирован по digest, но Debian-пакеты в нём могут отставать. +# Обновляем их на сборке, чтобы не публиковать заведомо устаревший userspace; +# версии Python-пакетов остаются закреплены requirements.txt. +RUN apt-get update \ + && apt-get upgrade -y --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# Позволяет собрать новую ревизию того же исходника для проверки rolling update: +# метка меняет config образа, поэтому Swarm видит новую image ID и заменяет задачи. +ARG APP_REVISION=local + +LABEL org.opencontainers.image.title="mtusi-messenger-lab7" \ + org.opencontainers.image.description="API и worker мессенджера на PostgreSQL, S3 и RabbitMQ; TLS/mTLS и OpenBao, лабораторная 7 (MTUSI HighLoad)" \ + org.opencontainers.image.version="7.0.0" \ + org.opencontainers.image.revision="${APP_REVISION:-local}" + +ENV PYTHONUNBUFFERED=1 \ + PYTHONDONTWRITEBYTECODE=1 \ + PATH="/opt/venv/bin:$PATH" \ + PYTHONPATH=/app/src \ + APP_HOST=0.0.0.0 \ + APP_PORT=8080 + +WORKDIR /app + +RUN useradd --create-home --uid 10001 --shell /usr/sbin/nologin app + +COPY --from=builder /opt/venv /opt/venv + +# Миграции лежат в образе: роль контейнера задаётся командой (api или migrate). +COPY --chown=app:app src/ ./src/ +COPY --chown=app:app alembic.ini ./ +COPY --chown=app:app migrations/ ./migrations/ + +# Приложение работает без прав root: в образе нет ни компилятора, ни secrets. +USER 10001:10001 + +EXPOSE 8080 + +# SIGTERM доходит до PID 1 напрямую: uvicorn завершает запросы в своём бюджете. +STOPSIGNAL SIGTERM + +HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \ + CMD ["python", "-m", "messenger.healthcheck"] + +CMD ["python", "-m", "messenger"] \ No newline at end of file diff --git a/Makefile b/Makefile index 5ad43ad..361e3c4 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,17 @@ PYTHON ?= python3 BASE_URL ?= https://localhost:8443 -CA_FILE ?= +CA_FILE ?= certs/ca.crt ACTION_SCRIPT ?= TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",) -.PHONY: help check validate test load test-persistence test-failover test-security +.PHONY: help check validate test load test-persistence test-failover test-security \ + bootstrap up down wait mtls security-checks track1 rotate-cert help: - @echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes" + @echo "check: offline structure; validate: full OpenAPI; test: running API" + @echo "bootstrap: local CA/secrets, data services, migrations, OpenBao AppRoles" + @echo "up/down/wait: compose lifecycle; mtls: internal trust matrix" + @echo "track1: worker compromise / revoke / rotate / restore evidence" check: $(PYTHON) scripts/check_contract.py @@ -31,3 +35,39 @@ test-failover: test-security: $(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS) + +bootstrap: + sh scripts/bootstrap-certs.sh + sh scripts/bootstrap-secrets.sh + docker compose --env-file .env up -d postgres minio rabbitmq openbao + sh scripts/wait-data.sh + docker compose --env-file .env up -d db-roles + docker compose --env-file .env up migrate + docker compose --env-file .env up -d db-grants + docker compose --env-file .env up minio-init + docker compose --env-file .env up openbao-bootstrap + sh scripts/bootstrap-rabbit.sh + docker compose --env-file .env up -d --build + +up: + docker compose --env-file .env up -d --build + sh scripts/wait-ready.sh + +down: + docker compose --env-file .env down + +wait: + sh scripts/wait-ready.sh + +mtls: + docker compose --env-file .env --profile tools up -d security-probe + docker compose --env-file .env exec -T security-probe python /app/scripts/mtls_probe.py + +security-checks: + $(PYTHON) scripts/security_checks.py + +track1: + $(PYTHON) scripts/track1.py + +rotate-cert: + sh scripts/rotate-worker-cert.sh diff --git a/REPORT.md b/REPORT.md index 9801db4..bb64e81 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,37 +1,491 @@ # Отчёт — лабораторная 7 -- Автор, группа: TODO -- Целевая оценка; выбранный трек 5, если нужен: TODO -- Commit/PR: TODO после публикации -- Использованные источники, библиотеки и помощь ИИ: TODO +- Автор, группа: Кокорин Денис, БВТ2301 +- Целевая оценка: **5** — весь уровень 3, весь уровень 4 и трек **5.1 + «Компрометация worker»** +- Commit/PR: коммиты в этой сессии намеренно **не создавались**; решение лежит + в рабочем дереве (см. git status). Целевой PR — после публикации форка. +- Дата измерений: 2026-11-27, Docker Desktop Linux VM, 6 CPU / 4 GiB. +- Источники: skeleton lab7 (README.md, contracts/, tests/), собственная + реализация lab6 из mtusi2026lab6, документация OpenBao AppRole/policies, + PostgreSQL TLS, MinIO policies, RabbitMQ TLS/access control, OTel Collector, + Prometheus/Grafana provisioning, Docker security. +- Помощь ИИ: генерация и ревью кода, текста и сценариев проверки; все команды и + числа в [evidence](evidence/README.md) получены на описанном стенде. -## Запуск из чистого clone +## 1. Запуск из чистого clone -TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных. +### 1.1. Версии и предпосылки -## Архитектура и решения +| Компонент | Версия / фиксация | Назначение | +| --- | --- | --- | +| Python | 3.11.9, образ python:3.11.9-slim-bookworm @ sha256:8fb09919… | API, worker, relay, migrations, gateway | +| API/worker image | mtusi-messenger-lab7:7.0.0 (локальная сборка) | api/worker/relay/mTLS-шлюзы | +| Traefik | traefik:v3.5.4 @ sha256:4df0a50f… | единственный публичный HTTPS ingress/LB | +| PostgreSQL | postgres:16.15-bookworm @ sha256:0ea6700a… | users/chats/messages/jobs/outbox/sessions | +| MinIO | minio/minio @ sha256:14cea493… | приватный S3 (staging/final) | +| RabbitMQ | rabbitmq:4.1.4-alpine @ sha256:b736d649… | quorum queue + DLQ | +| OpenBao | openbao/openbao:2.3.2 @ sha256:afec9f65… | KV v2, AppRole, scoped policies | +| OTel Collector | otel/opentelemetry-collector-contrib:0.140.0 | OTLP/HTTP traces/metrics/logs | +| Prometheus | prom/prometheus:v3.7.3 | метрики | +| Loki | grafana/loki:3.6.2 | логи | +| Tempo | grafana/tempo:2.9.0 | трассы | +| Grafana | grafana/grafana:12.2.0 | datasources/dashboard provisioning | +| Docker Engine / Compose | 28.0.1 / v2.33.1-desktop.1 | стенд | -TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab6, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации. +Python-зависимости зафиксированы в [requirements.txt](requirements.txt); +OpenTelemetry SDK 1.45.2 / instrumentation 0.66b2. Образ приложения собирается +из pinned base image, а Debian-пакеты обновляются apt-get upgrade на сборке; +Trivy-разбор — §8. -## Доказательства критериев +### 1.2. Одна последовательность запуска -| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства | +~~~sh +git clone && cd mtusi2026lab7 +chmod +x scripts/*.sh +sh scripts/bootstrap-certs.sh # локальный CA + leaf, secrets/certs (gitignored) +sh scripts/bootstrap-secrets.sh # DB/S3/Rabbit пароли, .env (gitignored) + +docker compose --env-file .env up -d postgres minio rabbitmq openbao +sh scripts/wait-data.sh +docker compose --env-file .env up -d db-roles # роли до миграций +docker compose --env-file .env up migrate # alembic head +docker compose --env-file .env up -d db-grants # минимальные права +docker compose --env-file .env up minio-init # bucket + scoped users +docker compose --env-file .env up openbao-bootstrap # KV + AppRole + policies +sh scripts/bootstrap-rabbit.sh # producer/consumer users + +docker compose --env-file .env up -d --build +sh scripts/wait-ready.sh +~~~ + +Эквивалент: make bootstrap, затем make up. Повторный запуск скриптов +идемпотентен и не перезаписывает существующие secrets/CA. +openbao-bootstrap при повторном запуске только unseal-ит OpenBao и сохраняет +действующие SecretID (если файлы непустые). + +Проверки: + +~~~sh +make check +make validate PYTHON=.venv/bin/python +make test BASE_URL=https://localhost:8443 CA_FILE=certs/ca.crt +make test-security BASE_URL=https://localhost:8443 CA_FILE=certs/ca.crt +make test-persistence ACTION_SCRIPT=scripts/restart.sh +make test-failover ACTION_SCRIPT=scripts/stop-one.sh +make mtls +make security-checks +make track1 +~~~ + +Windows-хост: системный Python — WindowsApps alias, публичные проверки +запускались bundled Python 3.12.14 с PYTHONUTF8=1; для ACTION_SCRIPT +использованы обёртки scripts/restart.cmd и scripts/stop-one.cmd (они просто +вызывают sh-реализацию, потому что tests/resilience.py запускает hook +напрямую). На Linux используются .sh. localhost на этом хосте сначала +резолвится в IPv6 и даёт ~2 s на новый TLS handshake; нагрузка измерена на +https://127.0.0.1:8443 (тот же сертификат, SAN включает IP). Публичный smoke +проверен и через localhost. + +### 1.3. Остановка и удаление данных + +~~~sh +docker compose --env-file .env down # остановить, volumes сохранить +# docker compose --env-file .env down -v # осознанно удалить БД/очередь/S3/OpenBao/telemetry +rm -rf secrets certs .env # удалить локальные ключи/пароли +~~~ + +Volumes: lab7_pgdata, lab7_miniodata, lab7_rabbitmqdata, lab7_openbaodata, +lab7_promdata, lab7_lokidata, lab7_tempodata, lab7_grafanadata. +scripts/restart.sh и scripts/stop-one.sh volumes не удаляют и не seed-ят БД. + +### 1.4. Действия оператора + +- Оператор создаёт CA/leaf и пароли **вне Git**; private CA key — в + secrets/ca-private/ (mode 700, не монтируется), unseal shares/root token — + в secrets/openbao-init.json (mode 644 внутри каталога secrets/ 700). Приложение root token не получает. +- После рестарта OpenBao остаётся sealed: scripts/restart.sh запускает + openbao-bootstrap для unseal; при обычном старте OpenBao сначала + docker compose up -d openbao, затем up openbao-bootstrap. +- Публичный CA для тестов: certs/ca.crt; private keys не распространяются. + +## 2. Архитектура и решения + +### 2.1. Схема процессов + +~~~ +Клиент ── TLS(CA+hostname), Bearer ──► Traefik :8443 (единственный публичный вход) + │ mTLS (lb.messenger.internal) + ▼ + API gateway :8081 ── loopback ──► uvicorn :8080 + │ + ┌─────────────────────────────────┼─────────────────────────────────┐ + ▼ ▼ ▼ + PostgreSQL :5432 TLS verify-full MinIO :9000 TLS+CA OpenBao :8200 TLS + (api/worker/relay roles) (api/worker scoped users) AppRole + scoped KV + ▲ ▲ + │ │ + worker/relay ── mTLS ──► internal-gateway :5671/:5672 ──TLS──► RabbitMQ :5671 + │ :4318/:4319/:4320 ─────► OTel Collector :4318 + │ + └── Prometheus ◄── mTLS ── collector-tls :8889/8888 + Loki/Tempo ◄── mTLS ── loki-tls:8443 / tempo-tls:4317 + Grafana ── mTLS+CA ── prometheus-tls/loki-tls/tempo-tls +~~~ + +- **Источник истины:** PostgreSQL для пользователей/чатов/сообщений/заданий/ + сессий; S3 — только байты; RabbitMQ — ссылки на задания; OpenBao — секреты + приложения. Telemetry не является источником истины. +- **Транзакционные границы:** создание сообщения + idempotency, upload + + attachment + job + outbox — в одной транзакции; worker фиксирует variants + + ready после публикации объектов. Outbox закрывает разрыв COMMIT/publish. +- **Изменено относительно lab6:** Valkey удалён (сессии в PostgreSQL); + добавлены TLS/mTLS на всех границах, mTLS-шлюзы, OpenBao, Argon2id rehash, + общий rate limit, leaf revocation list, hardening. Бизнес-API lab1–6 + сохранён, smoke проходит. + +### 2.2. Порты и сегментация + +| Компонент | Публикация | Сеть(и) | +| --- | --- | --- | +| Traefik | 127.0.0.1:8443 | lab7_edge | +| API-реплики | нет (только EXPOSE 8080 в образе) | edge, app, data | +| worker/relay | нет | app, data | +| PostgreSQL/MinIO/OpenBao | OpenBao только 127.0.0.1:8200; остальные нет | data (+ admin у OpenBao) | +| RabbitMQ | нет | broker | +| internal-gateway | нет | app, broker, otelnet | +| Collector | нет | otelnet, telemetry, collectorscrape | +| Prometheus/Loki/Tempo | нет | приватные promnet/lokinet/temponet + telemetry | +| Grafana | 127.0.0.1:3000 HTTPS | telemetry, admin | +| security-probe | нет, профиль tools | edge, app, data, telemetry | + +Plaintext hop остаётся только: API gateway → uvicorn на 127.0.0.1 внутри +контейнера; Traefik → API использует TLS/mTLS; Collector → backends — только +через mTLS-sidecar, plaintext-плечо внутри изолированной сети из двух +контейнеров. Публичного обхода API нет. + +### 2.3. Соответствие .env.example + +Все реальные имена и значения отражены в [.env.example](.env.example): +SESSION_TTL_SECONDS, ARGON2_*, LOGIN_RATE_LIMIT_*, BAO_TOKEN_*, +BAO_SECRET_ID_TTL_SECONDS, worker/job limits, OTEL_*. Секреты передаются +файлами в /run/secrets или через OpenBao; DATABASE_URL_FILE, BROKER_URL, +S3_* в приложении не содержат статических значений — их выставляет +secrets_provider.py после AppRole login. + +## 3. Безопасность: что и как проверено + +### 3.1. Пароли, сессии, вход + +- Argon2id m=19456 KiB, t=2, p=1 (OWASP minimum), hash_len=32, salt_len=16; + параметры настраиваются, но не ниже минимума. Benchmark: hash median + **33.34 ms**, verify **34.70 ms** ([06-argon2.txt](evidence/06-argon2.txt)). +- Rehash: старый хэш с m=8192,t=1 получает check_needs_rehash=true и + пересчитывается при успешном входе; пароль при этом не меняется. +- Пароль и session token не попадают в User/логи; в БД сессия хранится как + SHA-256 токена, expires_at абсолютный. Logout — атомарный DELETE, expiry + проверяется на каждом запросе. +- Login rate limit — таблица login_rate_limits в PostgreSQL, поэтому общий + для реплик: 11-я попытка → **429 + Retry-After: 60**, вторая реплика тоже + получает 429 ([05-security-checks.log](evidence/05-security-checks.log)). + KDF ограничен семафором LOGIN_MAX_CONCURRENCY=2. +- ACL: посторонний получает 404 на историю, metadata и content; поддельный + X-User-Id не меняет sender (Bearer owner). Request body >10 MiB → 413, + fake PNG → 415. + +### 3.2. TLS/mTLS и идентичности + +- **Внешний TLS:** Traefik с публичным CA, SAN localhost, 127.0.0.1, traefik; + без CA/с чужим CA/с неверным hostname — ошибка верификации + ([03-external-tls.txt](evidence/03-external-tls.txt)). +- **LB → API:** Traefik serversTransport api-mtls@file с insecureSkipVerify: + false, rootCAs, client cert lb-client. API gateway проверяет CERT_REQUIRED + и SAN **ровно** lb.messenger.internal. Без cert/чужой CA — + handshake/соединение отклонено; доверенный CA с чужой SAN — HTTP 403; LB SAN — + 200. +- **Broker:** internal-gateway имеет разные listener-ы: :5671 разрешает + api/relay, :5672 — только worker. Gateway открывает backend TLS к RabbitMQ + (verify_peer, fail_if_no_peer_cert) своим gateway-client; Rabbit permissions + ограничены: worker — consumer-only (passive read attachment.jobs, без + publish/bind), API/relay — producer. +- **Collector:** отдельные порты 4318 (api), 4319 (worker), 4320 (relay) с + разными SAN. Collector plaintext только в lab7_otelnet (gateway+collector). +- **Telemetry:** Prometheus scrape → collector-tls:8889/8888 mTLS + (prometheus-client); Grafana → prometheus-tls/loki-tls/tempo-tls с + клиентским grafana-client; Collector → loki-tls/tempo-tls с + telemetry-client. Sidecar-ы проверяют SAN и возвращают 403 чужой identity. +- **PostgreSQL:** hostssl + verify-full (CA и hostname); hostnossl + отклоняется. Роли messenger_api, messenger_worker, messenger_relay имеют + разные права; worker не читает users/password_hash, не делает DDL. +- **S3:** MinIO TLS + CA; API/worker — разные users и prefix policies; чужой + prefix возвращает AccessDenied; анонимный доступ выключен. +- **OpenBao:** TLS SAN openbao; AppRole role_id/secret_id → token TTL 300 s + (max 900), политики только на свой KV path; запись policy/чтение чужого path + → 403. Root token/unseal keys только у оператора. + +Полный результат: **33/33** проверки в +[04-mtls-matrix.json](evidence/04-mtls-matrix.json), лог — +[04-mtls-probe.log](evidence/04-mtls-probe.log). + +### 3.3. OpenBao + +- Не dev-mode: storage "file" на persistent volume openbaodata, TLS listener, + bao operator init 5 shares / threshold 3. Init/unseal — один раз и после + рестарта; root token не передаётся приложению. +- AppRole с secret_id_ttl=86400 (учебный стенд; production — короче), + token_ttl=300, token_max_ttl=900; secrets_provider.py продлевает token и + при отказе повторно логинится. +- Политики: messenger-api, messenger-worker, messenger-relay — только свой + kv/data/...; worker не получает admin credentials API/БД/S3. +- Sealed-поведение: работающие реплики остаются ready (секреты уже в памяти), + новая реплика не стартует (локальный readiness URLError), после unseal — + healthy ([openbao-sealed.txt](evidence/openbao-sealed.txt)). + +### 3.4. Контейнеры и лимиты + +- API/worker/relay: user 10001:10001, read_only, cap_drop: ALL, + no-new-privileges, tmpfs /tmp, CPU/RAM limits. API 1 CPU/512 MiB ×2, worker + 1 CPU/512 MiB, relay 0.5 CPU/256 MiB. +- mTLS-шлюзы и telemetry sidecars — те же ограничения, 0.25–0.5 CPU, + 96–128 MiB. +- Traefik/OpenBao — read-only, cap_drop ALL (OpenBao добавляет только + SETUID/SETGID/CHOWN/DAC_OVERRIDE для сброса на uid 100); Docker socket + смонтирован только в Traefik read-only. +- Stateful PostgreSQL/MinIO/RabbitMQ не read-only (нужны данные) и не + cap_drop — это объяснённое исключение; публичных портов у них нет. +- privileged, host network и Docker socket у app/worker отсутствуют + ([07-container-hardening.json](evidence/07-container-hardening.json)). + +## 4. Доказательства критериев + +| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл | | --- | --- | --- | --- | -| Публичный smoke | make test | TODO | TODO | -| Остальные пункты уровня 3 | TODO | TODO | TODO | -| Все пункты уровня 4, если заявлен | TODO | TODO | TODO | -| Выбранный трек 5, если заявлен | TODO | TODO | TODO | +| Публичный smoke через HTTPS | tests/smoke.py | PASS: health, 3 users, chat, messages, pagination, idempotency, upload 202, ready JPEG | [02-public-smoke.txt](evidence/02-public-smoke.txt) | +| Внешний TLS: CA/hostname | tests/security.py | trusted → 200; untrusted CA → verify error | [03-external-tls.txt](evidence/03-external-tls.txt) | +| LB→API mTLS + identity | mtls_probe.py | no cert/foreign CA → reject; trusted wrong SAN → 403; LB SAN → 200 | [04-mtls-matrix.json](evidence/04-mtls-matrix.json) | +| Broker mTLS/identity | mtls_probe.py | worker на producer и api на consumer → 403; api producer → AMQP Start | там же | +| Collector mTLS/identity | mtls_probe.py | api/worker разделены, wrong SAN → 403 | там же | +| DB/S3 TLS + least privilege | mtls_probe.py, track1_probe.py | TLS verify-full; plaintext reject; worker users/DDL denied; S3 foreign prefix denied | там же, [track1/summary.json](evidence/track1/summary.json) | +| OpenBao policy allow/deny | mtls_probe.py | own secret 200; чужой path/policy write/list 403 | [04-mtls-matrix.json](evidence/04-mtls-matrix.json) | +| Argon2id + rehash | scripts/argon2_bench.py | m=19456,t=2,p=1; hash 33.34 ms; rehash true | [06-argon2.txt](evidence/06-argon2.txt) | +| Login rate limit 429/Retry-After, общий для реплик | security_checks.py | 11-я попытка 429, Retry-After=60, вторая реплика 429 | [05-security-checks.log](evidence/05-security-checks.log) | +| ACL/logout/expiry/413/415 | security_checks.py | 404 чужому, 401 после logout/expiry, 413/415 | там же | +| Restart API+stores без потери | resilience.py --mode persistence | PASS, та же сессия/сообщение/файл | [08-persistence.txt](evidence/08-persistence.txt) | +| Отказ одной API-реплики | resilience.py --mode failover | 96 успешных, 2 переходных, recovery 3.782 s, без дублей | [09-failover.txt](evidence/09-failover.txt) | +| Leaf rotation/revocation | track1.py + cert_probe.py | old serial REJECTED, new ACCEPTED | [track1/summary.json](evidence/track1/summary.json) | +| Secret rotation worker | track1.py | DB/S3/broker rotated, OpenBao updated, 5/5 ready, 0 dup | там же | +| Sealed OpenBao | openbao_seal_test.sh | existing API 200; new API local readiness URLError; after unseal healthy | [openbao-sealed.txt](evidence/openbao-sealed.txt) | +| Grafana/data sources TLS | grafana_evidence.py | HTTPS, 3 datasources с tlsAuth, dashboard uid messenger-lab7 | [11-grafana.json](evidence/11-grafana.json) | +| Нет утечки пароля в telemetry | telem_check.py | 100 лог-записей, 0 вхождений пароля | [10-telemetry-leak.txt](evidence/10-telemetry-leak.txt) | +| Hardening/limits | docker inspect | non-root/read_only/cap_drop/limits, published ports | [07-container-hardening.json](evidence/07-container-hardening.json) | +| Scan + triage | Trivy app image | 112 HIGH / 2 CRITICAL base OS; разбор §8 | [13-trivy-app.json](evidence/13-trivy-app.json) | +| Track 5.1 | make track1 | broad vs least, revoke/rotate/restore, cert rotation | [14-track1-run.log](evidence/14-track1-run.log), [track1/summary.json](evidence/track1/summary.json) | -TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены. +## 5. Уровень 5, трек 5.1 «Компрометация worker» -## Эксперименты и отказы +### 5.1. Гипотеза -TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения. +Если worker скомпрометирован, least-privilege identity ограничит доступ +конкретными bucket-prefix/очередью/DB-операциями; отзыв identity остановит +обработку, но не потеряет уже принятые задачи; ротация связанных secrets и +восстановление вернут обработку без дублей. Over-broad identity того же +worker-а покажет существенно больший эффект. -| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных | -| --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | +### 5.2. Методика -## Ограничения и следующие шаги +1. scripts/track1.py создаёт на стенде намеренно broad identity: DB-роль + messenger_worker_broad с правами на все таблицы, MinIO user с consoleAdmin, + Rabbit user с ".* .* .*". +2. scripts/track1_probe.py --identity broad и --identity worker выполняют + одни и те же операции: S3 staging/final/foreign prefix, DB jobs/users/DDL, + Rabbit publish. Печатается только JSON boolean-фактов. +3. Worker останавливается; через публичный HTTPS API ставятся 5 новых + upload-ов (jobs queued). Затем отзываются identity: DB NOLOGIN, MinIO + disable, Rabbit delete_user; worker запускается и уходит в restart loop. +4. Ротируются DB password, MinIO secret и Rabbit password; локальные secrets и + OpenBao KV обновляются; identity включаются; worker перезапускается. +5. Проверяется: все 5 attachments ready, нет дублей variants, задачи не + потеряны. +6. rotate-worker-cert.sh выпускает новый leaf с тем же SAN, старый serial + попадает в revoked-serials.txt; cert_probe.py проверяет old/new. -TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза. +### 5.3. Результаты + +| Операция | Broad identity | Least-privilege worker | +| --- | --- | --- | +| S3 staging put | ✅ | ✅ | +| S3 final put | ✅ | ✅ | +| S3 foreign prefix put/get | ✅ | ❌ | +| S3 list whole bucket | ✅ | ❌ | +| DB jobs SELECT | ✅ | ✅ | +| DB users/password_hash SELECT | ✅ (users; pg_shadow — нет) | ❌ | +| DB DDL | ❌ (нет CREATEDB) | ❌ | +| Rabbit connect | ✅ | ✅ | +| Rabbit publish в jobs | ✅ | ❌ (consumer-only) | + +- После отзыва identity worker: **restarting / unhealthy**, в логе + worker_fatal с отказом Rabbit/DB; 5 jobs остались queued + ([revocation-log.txt](evidence/track1/revocation-log.txt)). +- После ротации и восстановления: **5/5 ready**, duplicate_variant_groups=0, + queued_before=5, queued_after_revoke=5. +- Leaf: старый сертификат — REJECTED after handshake (revoked/denied identity); + новый — ACCEPTED worker port (AMQP Connection.Start). +- Вывод: least privilege уменьшает эффект компрометации (не даёт publish, + foreign prefix, users), а отзыв/ротация — управляемое восстановление без + потери задач. Остаточный риск: worker по-прежнему пишет final-объекты и + читает jobs/attachments — это его штатная функция. + +### 5.4. Ограничения трека + +- Один Docker host; PostgreSQL/RabbitMQ/MinIO — single-node. Потеря узла не + проверялась. +- Broad baseline создаётся скриптом и удаляется после прогона; это модель + «если бы worker имел широкие права», а не реальная lab6-конфигурация. +- Revocation list — локальный файл serial-ов, не CRL/OCSP; требует рестарта + gateway для перечитывания. Для production нужен CRL/OCSP или короткоживущие + сертификаты с автоматическим renewal. +- 5 задач — малая выборка; проверяется отсутствие потерь/дублей, не throughput. + +## 6. Эксперименты + +### 6.1. Argon2id + +См. [06-argon2.txt](evidence/06-argon2.txt): 5 прогонов, median hash 33.34 ms, +median verify 34.70 ms, m=19456,t=2,p=1, v=19, rehash старого хэша true. +При 2 CPU API и семафоре 2 это осознанный бюджет: 11-я попытка входа +блокируется общим счётчиком. Абсолютные ms зависят от CPU хоста. + +### 6.2. Нагрузка + +tests/load.py (closed-loop, 30 s, concurrency 4, POST сообщений, +https://127.0.0.1:8443): **2194 успешных, 0 ошибок, 73.06 RPS, +p50 47 ms, p95 94 ms, p99 156 ms** ([12-load.json](evidence/12-load.json)). +Это throughput подтверждений HTTP, не точный счётчик COMMIT; closed-loop +страдает coordinated omission. Через localhost на этом Windows-хосте +клиентские handshake-и дают ~2 s и 1.9 RPS — это артефакт IPv6/Docker Desktop, +а не серверной задержки (серверные duration_ms ~20 ms в том же прогоне). + +### 6.3. Persistence и failover + +- Persistence: scripts/restart.sh перезапускает PostgreSQL, MinIO, RabbitMQ, + OpenBao (с unseal), API/worker/relay; volumes сохраняются. PASS, сессия, + сообщение и файл доступны ([08-persistence.txt](evidence/08-persistence.txt)). +- Failover: stop-one.sh останавливает одну API-реплику по X-Instance-Id; + 96 успешных, 2 переходных, recovery **3.782 s**, дублей нет + ([09-failover.txt](evidence/09-failover.txt)). Затем реплика восстановлена. + +### 6.4. Sealed OpenBao + +[openbao-sealed.txt](evidence/openbao-sealed.txt): sealed → работающая реплика +отдаёт 200, новая реплика local readiness URLError; после unseal — healthy. +Это доказывает fail-closed и отсутствие fallback на plaintext/static secret. + +### 6.5. Telemetry + +[10-telemetry-leak.txt](evidence/10-telemetry-leak.txt): 100 записей Loki, +уникальный пароль тестового пользователя не найден. Grafana provisioning — +[11-grafana.json](evidence/11-grafana.json): HTTPS, 3 datasources с TLS/mTLS, +dashboard messenger-lab7. + +## 7. Модель угроз + +Модель: [security/THREAT_MODEL.md](security/THREAT_MODEL.md); матрица: +[contracts/trust-matrix.md](contracts/trust-matrix.md). В модели 10 конкретных +угроз; минимум 6 обязательных связаны с контролями и воспроизводимыми +отрицательными тестами: + +1. поддельный TLS endpoint/hostname → tests/security.py, external_tls_wrong_hostname; +2. прямой доступ к API без client cert → api_no_client_cert; +3. доверенный CA, но чужая SAN → api_trusted_ca_wrong_identity (403); +4. worker публикует/читает чужое → track1_probe.py; +5. посторонний читает чат/вложение, поддельный X-User-Id → security_checks.py; +6. login DoS/перебор → rate limit 429 + Argon2 benchmark; +7. компрометация worker identity → broad/least track1; +8. утечка credentials в telemetry → Loki-запрос; +9. кража/подмена leaf, старый сертификат → rotation + revocation list; +10. sealed/недоступный OpenBao → fail-closed + unseal. + +## 8. Сканирование и triage + +Trivy 0.58.1 по mtusi-messenger-lab7:7.0.0 (после apt-get upgrade): +**112 HIGH, 2 CRITICAL**; JSON — [13-trivy-app.json](evidence/13-trivy-app.json). +Практически все findings — Debian-пакеты base image (util-linux, libexpat1, +libsqlite3-0, zlib1g, ncurses, perl-base, setuptools/wheel), а не +Python-зависимости приложения. + +- **CRITICAL CVE-2025-7458 (sqlite)** и **CVE-2023-45853 (zlib)**: в Debian + bookworm на момент сканирования нет fixed version (Trivy FixedVersion пуст). + Путь эксплуатации требует обработки специально сформированного zip/БД; API + не принимает SQL/zip от клиента, принимает только PNG/JPEG, работает + non-root, read-only rootfs, без shell-инструментов в образе. Остаточный + риск — base image; рекомендация: перейти на более новый pinned + base digest/дистрибутив и повторить скан, а не считать «0 CVE» + доказательством. +- HIGH в util-linux/expat связаны с mount/XML-парсингом, который в runtime + приложения не вызывается; тем не менее они остаются в образе. +- Docker Scout в этом окружении требовал Docker ID и не использовался; Trivy + выбран как воспроизводимый локальный сканер. Полный scan — не + «применимость»; применимость разобрана выше. + +## 9. Ограничения и следующие шаги + +- Один Docker host, single-node PostgreSQL/RabbitMQ/MinIO; HA БД/брокера/LB не + заявлена. Потеря узла не покрывается. +- mTLS-шлюзы — Python-процессы, а не sidecar mesh; они проверяют SAN и + serial-revocation, но не делают OCSP/CRL. Ротация leaf требует рестарта + gateway (файл revocation list перечитывается при старте). +- CA private key и unseal shares хранятся на файловой системе оператора + (mode 644/700), без HSM/Vault-запечатывания. Для production нужен внешний + KMS/HSM и автоматический unseal с контролем. +- OpenBao KV статический; динамические DB credentials не реализованы. + SecretID TTL 86400 — учебное послабление; production — короче + response + wrapping. +- Rate limit — per-username; распределённый по username spray не ограничен + глобальным бюджетом. KDF-семафор — на процесс. +- Telemetry sidecars добавляют hop; задержка и отказ sidecar не входят в SLO + API (Collector/backends не критичны для readiness). +- Trivy base-image findings не исправлены полностью; см. §8. +- Windows-обвязка (bundled Python, .cmd hook, IPv6 localhost) — особенность + окружения, не часть production-конфигурации. + +## 10. Ответы на вопросы защиты + +- **Что в mTLS шифрует, что подтверждает identity, где authorization?** + TLS шифрует канал и проверяет цепочку/срок/hostname сервера; client + certificate подтверждает identity клиента, а gateway сверяет SAN с allowlist + (LB, api, worker, relay) и serial с revocation list. Authorization — отдельно: + Rabbit permissions, DB grants, S3 policy, OpenBao policy. +- **Почему доверенный CA не значит «любой его клиент — LB»?** CA подтверждает + только подпись; право быть LB даёт SAN lb.messenger.internal в allowlist. + Сертификат того же CA с SAN foreign получает 403 (проверено). +- **Где первый секрет для OpenBao и кто unseal?** RoleID/SecretID выдаёт + openbao-bootstrap и кладёт в secrets/bao_runtime/ (600, gitignored); + root token/unseal shares — только у оператора в secrets/openbao-init.json. + Приложение не имеет root token; после рестарта OpenBao unseal выполняет + оператор/скрипт, затем AppRole login. +- **Что при истечении credentials/остановке OpenBao/рестарте API?** Истёкший + SecretID → 403, приложение fail-closed (не стартует); работающая реплика + использует уже полученные секреты до рестарта; после unseal и нового + bootstrap — восстановление. Sealed-тест показывает это явно. +- **Почему worker consumer-only?** Компрометация consumer-а не даёт публиковать + поддельные задания; publish/bind остаются у relay/API. Проверено + rabbit_publish_allowed=false и отказом Rabbit permissions. + +## 11. Индекс evidence + +См. [evidence/README.md](evidence/README.md). Ключевые: +[02-public-smoke.txt](evidence/02-public-smoke.txt), +[03-external-tls.txt](evidence/03-external-tls.txt), +[04-mtls-matrix.json](evidence/04-mtls-matrix.json), +[05-security-checks.log](evidence/05-security-checks.log), +[06-argon2.txt](evidence/06-argon2.txt), +[07-container-hardening.json](evidence/07-container-hardening.json), +[08-persistence.txt](evidence/08-persistence.txt), +[09-failover.txt](evidence/09-failover.txt), +[10-telemetry-leak.txt](evidence/10-telemetry-leak.txt), +[11-grafana.json](evidence/11-grafana.json), +[12-load.json](evidence/12-load.json), +[13-trivy-app.json](evidence/13-trivy-app.json), +[openbao-sealed.txt](evidence/openbao-sealed.txt), +[track1/summary.json](evidence/track1/summary.json), +[track1/revocation-log.txt](evidence/track1/revocation-log.txt). diff --git a/alembic.ini b/alembic.ini new file mode 100644 index 0000000..e299f78 --- /dev/null +++ b/alembic.ini @@ -0,0 +1,38 @@ +# Конфигурация Alembic. URL базы здесь намеренно не задан: он приходит из +# окружения (DATABASE_URL или DATABASE_URL_FILE) и подставляется migrations/env.py. +[alembic] +script_location = migrations +prepend_sys_path = src + +[loggers] +keys = root,sqlalchemy,alembic + +[handlers] +keys = console + +[formatters] +keys = plain + +[logger_root] +level = WARNING +handlers = console +qualname = + +[logger_sqlalchemy] +level = WARNING +handlers = +qualname = sqlalchemy.engine + +[logger_alembic] +level = INFO +handlers = +qualname = alembic + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = plain + +[formatter_plain] +format = %(levelname)s [%(name)s] %(message)s diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..92c6984 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,894 @@ +# Лабораторная 7: защищённый стенд. +# +# Публично опубликованы только Traefik :8443 (HTTPS) и локальные +# административные интерфейсы на 127.0.0.1 (Grafana, OpenBao, Prometheus). +# API-реплики не публикуют порт: единственный вход — Traefik, который идёт в +# mTLS-шлюз каждой реплики с клиентским сертификатом lb-client. +name: lab7 + +x-api-environment: &api-environment + APP_ENV: lab + APP_HOST: 127.0.0.1 + APP_PORT: "8080" + GATEWAY_CONFIG: /etc/gateway/api.json + LOG_LEVEL: info + SESSION_TTL_SECONDS: "${SESSION_TTL_SECONDS:-3600}" + SESSION_STORE: postgres + DB_POOL_SIZE: "5" + DB_MAX_OVERFLOW: "5" + DB_POOL_TIMEOUT_SECONDS: "2" + DB_CONNECT_TIMEOUT_SECONDS: "1.5" + DB_COMMAND_TIMEOUT_SECONDS: "2.5" + DB_STATEMENT_TIMEOUT_MS: "2000" + DB_CA_FILE: /certs/ca.crt + S3_CA_FILE: /certs/ca.crt + BROKER_CA_FILE: /certs/ca.crt + BROKER_CLIENT_CERT_FILE: /certs/api-client.crt + BROKER_CLIENT_KEY_FILE: /certs/api-client.key + GRACEFUL_SHUTDOWN_SECONDS: "5" + SHUTDOWN_DRAIN_SECONDS: "2" + S3_REGION: us-east-1 + S3_BUCKET: messenger-attachments + S3_KEY_PREFIX: "attachments/" + S3_CONNECT_TIMEOUT_SECONDS: "1.5" + S3_READ_TIMEOUT_SECONDS: "30" + S3_MAX_ATTEMPTS: "2" + MAX_UPLOAD_BYTES: "10485760" + MAX_IMAGE_PIXELS: "40000000" + ATTACHMENT_ORPHAN_GRACE_SECONDS: "3600" + STAGING_RETENTION_SECONDS: "86400" + ATTACHMENT_FAULT_MODE: none + PIPELINE_VERSION: "2" + JOB_MAX_ATTEMPTS: "5" + ALLOW_FAULT_INJECTION: "true" + ARGON2_MEMORY_KIB: "${ARGON2_MEMORY_KIB:-19456}" + ARGON2_ITERATIONS: "${ARGON2_ITERATIONS:-2}" + ARGON2_PARALLELISM: "${ARGON2_PARALLELISM:-1}" + LOGIN_RATE_LIMIT_ATTEMPTS: "${LOGIN_RATE_LIMIT_ATTEMPTS:-10}" + LOGIN_RATE_LIMIT_WINDOW_SECONDS: "60" + LOGIN_RATE_LIMIT_BLOCK_SECONDS: "60" + LOGIN_MAX_CONCURRENCY: "2" + SECRETS_FROM_BAO: "1" + BAO_ADDR: https://openbao:8200 + BAO_CACERT: /certs/ca.crt + BAO_ROLE_ID_FILE: /run/bao/api_role_id + BAO_SECRET_ID_FILE: /run/bao/api_secret_id + BAO_SECRET_PATH: messenger/api + OTEL_SERVICE_NAME: messenger-api + OTEL_EXPORTER_OTLP_ENDPOINT: https://internal-gateway:4318 + OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + OTEL_EXPORTER_OTLP_CERTIFICATE: /certs/ca.crt + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /certs/api-client.crt + OTEL_EXPORTER_OTLP_CLIENT_KEY: /certs/api-client.key + OTEL_RESOURCE_ATTRIBUTES: deployment.environment.name=lab + OTEL_SDK_DISABLED: "false" + OTEL_TRACES_SAMPLER: parentbased_always_on + OTEL_TRACES_SAMPLER_ARG: "1.0" + +x-worker-environment: &worker-environment + APP_ENV: lab + LOG_LEVEL: info + DB_POOL_SIZE: "3" + DB_MAX_OVERFLOW: "3" + DB_POOL_TIMEOUT_SECONDS: "2" + DB_CONNECT_TIMEOUT_SECONDS: "1.5" + DB_COMMAND_TIMEOUT_SECONDS: "5" + DB_STATEMENT_TIMEOUT_MS: "10000" + DB_CA_FILE: /certs/ca.crt + S3_CA_FILE: /certs/ca.crt + BROKER_CA_FILE: /certs/ca.crt + GRACEFUL_SHUTDOWN_SECONDS: "10" + S3_REGION: us-east-1 + S3_BUCKET: messenger-attachments + S3_KEY_PREFIX: "attachments/" + S3_CONNECT_TIMEOUT_SECONDS: "1.5" + S3_READ_TIMEOUT_SECONDS: "60" + S3_MAX_ATTEMPTS: "3" + MAX_UPLOAD_BYTES: "10485760" + MAX_IMAGE_PIXELS: "40000000" + PIPELINE_VERSION: "2" + WORKER_CONCURRENCY: "${WORKER_CONCURRENCY:-2}" + WORKER_PREFETCH: "${WORKER_PREFETCH:-2}" + JOB_MAX_ATTEMPTS: "${JOB_MAX_ATTEMPTS:-5}" + JOB_TIMEOUT_SECONDS: "${JOB_TIMEOUT_SECONDS:-60}" + JOB_LEASE_SECONDS: "${JOB_LEASE_SECONDS:-15}" + JOB_BACKOFF_BASE_SECONDS: "1" + JOB_BACKOFF_MAX_SECONDS: "30" + STAGING_RETENTION_SECONDS: "86400" + ALLOW_FAULT_INJECTION: "true" + RELAY_POLL_SECONDS: "0.25" + REAPER_INTERVAL_SECONDS: "1" + SECRETS_FROM_BAO: "1" + BAO_ADDR: https://openbao:8200 + BAO_CACERT: /certs/ca.crt + OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + OTEL_RESOURCE_ATTRIBUTES: deployment.environment.name=lab + OTEL_SDK_DISABLED: "false" + OTEL_TRACES_SAMPLER: parentbased_always_on + OTEL_TRACES_SAMPLER_ARG: "1.0" + +services: + traefik: + image: traefik:v3.5.4@sha256:4df0a50fcf71b454c0d7ad17675776dc8d37359deae3291895bdaa008c1b9972 + command: + - --providers.docker=true + - --providers.docker.exposedbydefault=false + - --providers.docker.network=lab7_edge + - --providers.docker.watch=true + - --providers.docker.endpoint=unix:///var/run/docker.sock + - --providers.file.filename=/etc/traefik/dynamic.yml + - --entryPoints.websecure.address=:8443 + - --log.level=INFO + - --accesslog=false + ports: + - target: 8443 + published: 8443 + protocol: tcp + host_ip: 127.0.0.1 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - ./infra/traefik/dynamic.yml:/etc/traefik/dynamic.yml:ro + - ./secrets/certs/traefik:/certs:ro + networks: [edge] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.50" + memory: 128M + + postgres: + image: postgres:16.15-bookworm@sha256:0ea6700a3b4f0ae6ce746519073558aed4d88a79d8d07622a9a644946c7319c4 + entrypoint: ["/bin/sh", "/etc/postgres-entrypoint.sh"] + environment: + POSTGRES_USER: messenger + POSTGRES_DB: messenger + POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password + POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256" + secrets: [postgres_password] + volumes: + - pgdata:/var/lib/postgresql/data + - ./infra/postgres/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro + - ./infra/postgres/entrypoint.sh:/etc/postgres-entrypoint.sh:ro + - ./secrets/certs/postgres:/certs:ro + networks: [data] + healthcheck: + test: ["CMD-SHELL", "pg_isready -U messenger -d messenger"] + interval: 5s + timeout: 3s + retries: 12 + start_period: 10s + security_opt: ["no-new-privileges:true"] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "2.0" + memory: 512M + + db-roles: + image: postgres:16.15-bookworm@sha256:0ea6700a3b4f0ae6ce746519073558aed4d88a79d8d07622a9a644946c7319c4 + entrypoint: ["/bin/sh", "/etc/db-init.sh", "roles"] + environment: + PGHOST: postgres + PGUSER: messenger + PGDATABASE: messenger + secrets: + - postgres_password + - db_api_password + - db_worker_password + - db_relay_password + volumes: + - ./scripts/db-init.sh:/etc/db-init.sh:ro + networks: [data] + depends_on: + postgres: + condition: service_healthy + restart: "no" + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 128M + + migrate: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: + - /bin/sh + - -c + - "until alembic upgrade head; do echo migration waiting for postgres; sleep 2; done" + environment: + SECRETS_FROM_BAO: "0" + DATABASE_URL_FILE: /run/secrets/migrate_database_url + DB_CA_FILE: /certs/ca.crt + secrets: + - migrate_database_url + volumes: + - ./secrets/certs/postgres:/certs:ro + networks: [data] + depends_on: + db-roles: + condition: service_completed_successfully + restart: "no" + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 256M + + db-grants: + image: postgres:16.15-bookworm@sha256:0ea6700a3b4f0ae6ce746519073558aed4d88a79d8d07622a9a644946c7319c4 + entrypoint: ["/bin/sh", "/etc/db-init.sh", "grants"] + environment: + PGHOST: postgres + PGUSER: messenger + PGDATABASE: messenger + secrets: + - postgres_password + - db_api_password + - db_worker_password + - db_relay_password + volumes: + - ./scripts/db-init.sh:/etc/db-init.sh:ro + networks: [data] + depends_on: + migrate: + condition: service_completed_successfully + restart: "no" + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 128M + + minio: + image: minio/minio@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e + entrypoint: ["/bin/sh", "-c"] + command: + - >- + export MINIO_ROOT_USER=$$(cat /run/secrets/minio_root_user); + export MINIO_ROOT_PASSWORD=$$(cat /run/secrets/minio_root_password); + exec /usr/bin/minio server /data --certs-dir /certs --console-address :9001 + environment: + MINIO_BROWSER: "off" + MINIO_SERVER_URL: "https://minio:9000" + secrets: [minio_root_user, minio_root_password] + volumes: + - miniodata:/data + - ./secrets/certs/minio:/certs:ro + networks: [data] + healthcheck: + test: ["CMD", "curl", "-fsS", "--cacert", "/certs/ca.crt", "https://127.0.0.1:9000/minio/health/live"] + interval: 5s + timeout: 3s + retries: 12 + start_period: 10s + security_opt: ["no-new-privileges:true"] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 512M + + minio-init: + image: minio/minio@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e + entrypoint: ["/bin/sh", "/etc/minio-init.sh"] + environment: + S3_CA_FILE: /certs/ca.crt + MC_CONFIG_DIR: /tmp/.mc + secrets: + - minio_root_user + - minio_root_password + - s3_api_access_key + - s3_api_secret_key + - s3_worker_access_key + - s3_worker_secret_key + volumes: + - ./scripts/minio-init.sh:/etc/minio-init.sh:ro + - ./secrets/certs/minio:/certs:ro + networks: [data] + depends_on: + minio: + condition: service_healthy + restart: "no" + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 128M + + rabbitmq: + image: rabbitmq:4.1.4-alpine@sha256:b736d649308e1b3e1a116c3f36986b605ee3d03e88f10166be2900083d2e63f2 + entrypoint: ["/bin/sh", "-c"] + command: + - >- + export RABBITMQ_DEFAULT_USER=$$(cat /run/secrets/rabbitmq_root_user); + export RABBITMQ_DEFAULT_PASS=$$(cat /run/secrets/rabbitmq_root_password); + exec docker-entrypoint.sh rabbitmq-server + environment: + RABBITMQ_NODENAME: "rabbit@localhost" + RABBITMQ_USE_LONGNAME: "false" + RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: "+S 2:2" + secrets: [rabbitmq_root_user, rabbitmq_root_password] + volumes: + - rabbitmqdata:/var/lib/rabbitmq + - ./infra/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro + - ./secrets/certs/rabbitmq:/certs:ro + networks: [broker] + healthcheck: + test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"] + interval: 10s + timeout: 5s + retries: 18 + start_period: 30s + security_opt: ["no-new-privileges:true"] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 512M + + openbao: + image: openbao/openbao:2.3.2@sha256:afec9f65a7067a22acf24b29f07d2f028353c02cc0fa9c80dfa4e7fab158b373 + entrypoint: ["/bin/sh", "/etc/openbao-entrypoint.sh"] + volumes: + - openbaodata:/openbao/data + - ./infra/openbao/config.hcl:/openbao/config.hcl:ro + - ./infra/openbao/entrypoint.sh:/etc/openbao-entrypoint.sh:ro + - ./secrets/certs/openbao:/certs:ro + ports: + - target: 8200 + published: 8200 + host_ip: 127.0.0.1 + protocol: tcp + networks: [data, admin] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + cap_add: [SETUID, SETGID, CHOWN, DAC_OVERRIDE] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 256M + + openbao-bootstrap: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + # bootstrap пишет в host secrets/; root только для записи, app — uid 10001. + user: "0:0" + command: ["python", "/app/scripts/openbao_bootstrap.py"] + environment: + BAO_ADDR: https://openbao:8200 + BAO_CACERT: /certs/ca.crt + BOOTSTRAP_DIR: /bootstrap + BAO_TOKEN_TTL_SECONDS: "${BAO_TOKEN_TTL_SECONDS:-300}" + BAO_TOKEN_MAX_TTL_SECONDS: "${BAO_TOKEN_MAX_TTL_SECONDS:-900}" + BAO_SECRET_ID_TTL_SECONDS: "${BAO_SECRET_ID_TTL_SECONDS:-86400}" + volumes: + - ./scripts:/app/scripts:ro + - ./secrets:/bootstrap + - ./secrets/certs/openbao:/certs:ro + networks: [data] + depends_on: + openbao: + condition: service_started + restart: "no" + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 128M + + internal-gateway: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.mtls_gateway", "--config", "/etc/gateway/internal.json"] + volumes: + - ./infra/gateway/internal.json:/etc/gateway/internal.json:ro + - ./secrets/certs/gateway:/certs:ro + networks: [app, broker, otelnet] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + healthcheck: + test: ["CMD-SHELL", "python -c \"import socket; s=socket.create_connection(('127.0.0.1',5671),2); s.close()\""] + interval: 10s + timeout: 3s + retries: 6 + start_period: 5s + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 128M + + api: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["/bin/sh", "/usr/local/bin/api-entrypoint.sh"] + environment: + <<: *api-environment + volumes: + - ./scripts/api-entrypoint.sh:/usr/local/bin/api-entrypoint.sh:ro + - ./infra/gateway/api.json:/etc/gateway/api.json:ro + - ./secrets/certs/api:/certs:ro + - ./secrets/bao_runtime:/run/bao:ro + networks: [edge, app, data] + stop_grace_period: 15s + healthcheck: + test: ["CMD", "python", "-m", "messenger.healthcheck"] + interval: 5s + timeout: 3s + start_period: 20s + retries: 3 + depends_on: + migrate: + condition: service_completed_successfully + db-grants: + condition: service_completed_successfully + postgres: + condition: service_healthy + minio: + condition: service_healthy + openbao-bootstrap: + condition: service_completed_successfully + labels: + - traefik.enable=true + - traefik.docker.network=lab7_edge + - traefik.http.routers.messenger-lab7.rule=PathPrefix(`/`) + - traefik.http.routers.messenger-lab7.entrypoints=websecure + - traefik.http.routers.messenger-lab7.tls=true + - traefik.http.routers.messenger-lab7.service=messenger-lab7 + - traefik.http.services.messenger-lab7.loadbalancer.server.port=8081 + - traefik.http.services.messenger-lab7.loadbalancer.server.scheme=https + - traefik.http.services.messenger-lab7.loadbalancer.serverstransport=api-mtls@file + - traefik.http.services.messenger-lab7.loadbalancer.healthcheck.path=/health/ready + - traefik.http.services.messenger-lab7.loadbalancer.healthcheck.interval=2s + - traefik.http.services.messenger-lab7.loadbalancer.healthcheck.timeout=2s + - traefik.http.services.messenger-lab7.loadbalancer.healthcheck.scheme=https + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 2 + resources: + limits: + cpus: "1.0" + memory: 512M + reservations: + cpus: "0.25" + memory: 128M + + worker: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.worker"] + environment: + <<: *worker-environment + OTEL_SERVICE_NAME: messenger-worker + BAO_ROLE_ID_FILE: /run/bao/worker_role_id + BAO_SECRET_ID_FILE: /run/bao/worker_secret_id + BAO_SECRET_PATH: messenger/worker + BROKER_CLIENT_CERT_FILE: /certs/worker-client.crt + BROKER_CLIENT_KEY_FILE: /certs/worker-client.key + OTEL_EXPORTER_OTLP_ENDPOINT: https://internal-gateway:4319 + OTEL_EXPORTER_OTLP_CERTIFICATE: /certs/ca.crt + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /certs/worker-client.crt + OTEL_EXPORTER_OTLP_CLIENT_KEY: /certs/worker-client.key + HEARTBEAT_FILE: /tmp/messenger-worker-heartbeat + volumes: + - ./secrets/certs/worker:/certs:ro + - ./secrets/bao_runtime:/run/bao:ro + networks: [app, data] + stop_grace_period: 20s + healthcheck: + test: ["CMD", "python", "-m", "messenger.worker_health"] + interval: 10s + timeout: 3s + start_period: 15s + retries: 3 + depends_on: + db-grants: + condition: service_completed_successfully + postgres: + condition: service_healthy + minio: + condition: service_healthy + rabbitmq: + condition: service_healthy + openbao-bootstrap: + condition: service_completed_successfully + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 512M + + relay: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.relay"] + environment: + <<: *worker-environment + OTEL_SERVICE_NAME: messenger-relay + BAO_ROLE_ID_FILE: /run/bao/relay_role_id + BAO_SECRET_ID_FILE: /run/bao/relay_secret_id + BAO_SECRET_PATH: messenger/relay + BROKER_CLIENT_CERT_FILE: /certs/relay-client.crt + BROKER_CLIENT_KEY_FILE: /certs/relay-client.key + OTEL_EXPORTER_OTLP_ENDPOINT: https://internal-gateway:4320 + OTEL_EXPORTER_OTLP_CERTIFICATE: /certs/ca.crt + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /certs/relay-client.crt + OTEL_EXPORTER_OTLP_CLIENT_KEY: /certs/relay-client.key + HEARTBEAT_FILE: /tmp/messenger-relay-heartbeat + volumes: + - ./secrets/certs/relay:/certs:ro + - ./secrets/bao_runtime:/run/bao:ro + networks: [app, data] + stop_grace_period: 15s + healthcheck: + test: ["CMD", "python", "-m", "messenger.worker_health"] + interval: 10s + timeout: 3s + start_period: 15s + retries: 3 + depends_on: + db-grants: + condition: service_completed_successfully + postgres: + condition: service_healthy + rabbitmq: + condition: service_healthy + minio: + condition: service_healthy + openbao-bootstrap: + condition: service_completed_successfully + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 256M + + otel-collector: + image: otel/opentelemetry-collector-contrib:0.140.0 + command: ["--config=/etc/otelcol/config.yaml"] + volumes: + - ./observability/otel-collector/config.yaml:/etc/otelcol/config.yaml:ro + - ./secrets/certs/telemetry:/certs:ro + networks: [otelnet, telemetry, collectorscrape] + depends_on: + tempo: + condition: service_started + loki: + condition: service_started + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 512M + + prometheus: + image: prom/prometheus:v3.7.3 + command: + - --config.file=/etc/prometheus/prometheus.yml + - --storage.tsdb.path=/prometheus + - --storage.tsdb.retention.time=24h + - --web.enable-lifecycle + volumes: + - ./observability/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro + - ./observability/prometheus/rules:/etc/prometheus/rules:ro + - ./secrets/certs/telemetry:/certs:ro + - promdata:/prometheus + networks: [promnet, collectorscrape] + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:9090/-/healthy"] + interval: 10s + timeout: 3s + retries: 12 + start_period: 10s + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "1.0" + memory: 512M + + loki: + image: grafana/loki:3.6.2 + command: ["-config.file=/etc/loki/local-config.yaml"] + volumes: + - ./observability/loki/loki-config.yaml:/etc/loki/local-config.yaml:ro + - lokidata:/loki + networks: [lokinet] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 384M + + tempo: + image: grafana/tempo:2.9.0 + command: ["-config.file=/etc/tempo.yaml"] + volumes: + - ./observability/tempo/tempo.yaml:/etc/tempo.yaml:ro + - tempodata:/var/tempo + networks: [temponet] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 384M + + grafana: + image: grafana/grafana:12.2.0 + environment: + GF_SECURITY_ADMIN_USER: admin + GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_admin_password + GF_USERS_ALLOW_SIGN_UP: "false" + GF_AUTH_ANONYMOUS_ENABLED: "true" + GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer + GF_ANALYTICS_REPORTING_ENABLED: "false" + GF_ANALYTICS_CHECK_FOR_UPDATES: "false" + GF_SERVER_PROTOCOL: https + GF_SERVER_HTTP_PORT: "3000" + GF_SERVER_CERT_FILE: /certs/grafana.crt + GF_SERVER_CERT_KEY: /certs/grafana.key + secrets: [grafana_admin_password] + ports: + - "127.0.0.1:3000:3000" + volumes: + - ./observability/grafana/provisioning:/etc/grafana/provisioning:ro + - ./observability/grafana/dashboards:/var/lib/grafana/dashboards:ro + - ./secrets/certs/telemetry:/certs:ro + - grafanadata:/var/lib/grafana + networks: [telemetry, admin] + depends_on: + prometheus: + condition: service_started + loki: + condition: service_started + tempo: + condition: service_started + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: 384M + + prometheus-tls: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.mtls_gateway", "--config", "/etc/gateway/tls.json"] + healthcheck: + disable: true + volumes: + - ./infra/gateway/prometheus-tls.json:/etc/gateway/tls.json:ro + - ./secrets/certs/telemetry:/certs:ro + networks: [promnet, telemetry] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.25" + memory: 96M + + loki-tls: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.mtls_gateway", "--config", "/etc/gateway/tls.json"] + healthcheck: + disable: true + volumes: + - ./infra/gateway/loki-tls.json:/etc/gateway/tls.json:ro + - ./secrets/certs/telemetry:/certs:ro + networks: [lokinet, telemetry] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.25" + memory: 96M + + tempo-tls: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.mtls_gateway", "--config", "/etc/gateway/tls.json"] + healthcheck: + disable: true + volumes: + - ./infra/gateway/tempo-tls.json:/etc/gateway/tls.json:ro + - ./secrets/certs/telemetry:/certs:ro + networks: [temponet, telemetry] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.25" + memory: 96M + + collector-tls: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["python", "-m", "messenger.mtls_gateway", "--config", "/etc/gateway/tls.json"] + healthcheck: + disable: true + volumes: + - ./infra/gateway/collector-tls.json:/etc/gateway/tls.json:ro + - ./secrets/certs/telemetry:/certs:ro + networks: [collectorscrape, telemetry] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + restart: unless-stopped + deploy: + replicas: 1 + resources: + limits: + cpus: "0.25" + memory: 96M + + security-probe: + image: ${API_IMAGE:-mtusi-messenger-lab7:7.0.0} + build: + context: . + command: ["sleep", "infinity"] + healthcheck: + disable: true + volumes: + - ./scripts:/app/scripts:ro + - ./secrets/certs:/certs:ro + - ./secrets/bao_runtime:/bao:ro + networks: [edge, app, data, telemetry] + read_only: true + tmpfs: [/tmp] + security_opt: ["no-new-privileges:true"] + cap_drop: [ALL] + profiles: ["tools"] + deploy: + replicas: 1 + resources: + limits: + cpus: "0.25" + memory: 128M + +secrets: + postgres_password: {file: ./secrets/postgres_password} + db_api_password: {file: ./secrets/db_api_password} + db_worker_password: {file: ./secrets/db_worker_password} + db_relay_password: {file: ./secrets/db_relay_password} + migrate_database_url: {file: ./secrets/migrate_database_url} + rabbitmq_root_user: {file: ./secrets/rabbitmq_root_user} + rabbitmq_root_password: {file: ./secrets/rabbitmq_root_password} + minio_root_user: {file: ./secrets/minio_root_user} + minio_root_password: {file: ./secrets/minio_root_password} + s3_api_access_key: {file: ./secrets/s3_api_access_key} + s3_api_secret_key: {file: ./secrets/s3_api_secret_key} + s3_worker_access_key: {file: ./secrets/s3_worker_access_key} + s3_worker_secret_key: {file: ./secrets/s3_worker_secret_key} + grafana_admin_password: {file: ./secrets/grafana_admin_password} + +volumes: + pgdata: + miniodata: + rabbitmqdata: + openbaodata: + promdata: + lokidata: + tempodata: + grafanadata: + +networks: + edge: + name: lab7_edge + driver: bridge + app: + name: lab7_app + driver: bridge + internal: true + data: + name: lab7_data + driver: bridge + internal: true + broker: + name: lab7_broker + driver: bridge + internal: true + otelnet: + name: lab7_otelnet + driver: bridge + internal: true + admin: + name: lab7_admin + driver: bridge + telemetry: + name: lab7_telemetry + driver: bridge + internal: true + promnet: + name: lab7_promnet + driver: bridge + internal: true + lokinet: + name: lab7_lokinet + driver: bridge + internal: true + temponet: + name: lab7_temponet + driver: bridge + internal: true + collectorscrape: + name: lab7_collectorscrape + driver: bridge + internal: true diff --git a/contracts/trust-matrix.md b/contracts/trust-matrix.md index 0c2a977..7ae89cf 100644 --- a/contracts/trust-matrix.md +++ b/contracts/trust-matrix.md @@ -1,37 +1,56 @@ -# Матрица доверия — заполнить в решении lab7 +# Матрица доверия — lab7 (заполнено) -Это обязательная матрица покрытия. Для каждой строки укажите реальный порт, endpoint, CA, service identity, проверку SAN/ACL, срок жизни credentials и команду положительного/отрицательного теста. TLS шифрует и подтверждает сервер; mTLS также проверяет клиента. При доверенном CA всё равно нужно ограничивать разрешённую identity. Plaintext hop допустим только внутри закрытого локального transport/proxy boundary, без опубликованного обхода; границу и rationale нужно доказать. +Стенд: Docker Compose, проект `lab7`. Публично опубликованы только +`127.0.0.1:8443` (Traefik HTTPS) и локальные административные порты +`127.0.0.1:8200` (OpenBao) и `127.0.0.1:3000` (Grafana HTTPS). API-реплики, +PostgreSQL, MinIO, RabbitMQ, Collector, Prometheus, Loki и Tempo портов наружу +не публикуют. -| Связь | Минимум на 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 | +CA: локальный `internal-ca` (см. `scripts/bootstrap-certs.sh`). Приватный ключ +CA лежит в `secrets/ca-private/` (mode 700, не монтируется в контейнеры), +публичный — `certs/ca.crt`. -Нет выбранного компонента — отметьте N/A с причиной, а не оставляйте пустую строку. Внутренний публичный health listener, если нужен, минимален и изолирован; через него нельзя обращаться к бизнес-API без mTLS. Отдельно задокументируйте scrape/health/bootstrap каналы: они тоже не должны создавать обход. +| Связь | Реальный порт / endpoint | TLS / identity | Проверка SAN/ACL | TTL / ротация | Положительный и отрицательный тест | +| --- | --- | --- | --- | --- | --- | +| Клиент → ingress/LB | Traefik `127.0.0.1:8443` | TLS 1.2+, server cert SAN `localhost`, `127.0.0.1`, `traefik`; клиент — Bearer | CA + hostname; сессия хранится как SHA-256, TTL из `SESSION_TTL_SECONDS`; login rate limit общий в PostgreSQL | leaf 397 дней; сессия 3600 с; ротация leaf — `scripts/rotate-worker-cert.sh` (пример) | `tests/security.py`; `scripts/mtls_probe.py: external_tls_*`; `tests/smoke.py` | +| LB → API (обе реплики) | Traefik → `api:8081`, HTTPS | mTLS; LB client cert SAN `lb.messenger.internal`; API server SAN `api.messenger.internal` | API gateway: `verify_mode=CERT_REQUIRED`, allowlist SAN ровно `lb.messenger.internal`; нет опубликованного порта API | LB leaf 397 дней; SAN проверяется на каждом новом TLS-соединении; revocation list `secrets/certs/gateway/revoked-serials.txt` | `mtls_probe.py: api_no_client_cert, api_foreign_ca_client, api_trusted_ca_wrong_identity, api_lb_identity_allowed`; `cert_probe.py` | +| API/worker/relay → PostgreSQL | `postgres:5432` | TLS verify-full; server SAN `postgres`; клиент — отдельные DB-роли `messenger_api`, `messenger_worker`, `messenger_relay` | `pg_hba.conf`: `hostnossl ... reject`, только `hostssl`; права ролей выданы по таблицам, worker не читает `users` | DB-пароли генерируются локально, ротация — `scripts/track1.py`; mTLS не обязателен (TLS + роли) | `mtls_probe.py: postgres_api_tls_allowed, postgres_plaintext_rejected, postgres_worker_users_denied, postgres_worker_ddl_denied`; `track1.py` | +| API/worker/relay → S3 | `https://minio:9000` | TLS + CA; отдельные MinIO users `api`/`worker` | API: staging rw, final read; worker: staging/final rw; foreign prefix `attachments/other/*` запрещён; bucket приватный, anonymous off | ключи генерируются локально, ротация и disable — `track1.py`; root MinIO только в bootstrap | `mtls_probe.py: s3_api_tls_allowed, s3_api_foreign_prefix_denied, s3_untrusted_ca_rejected`; `track1_probe.py` | +| API/worker/relay → broker | `internal-gateway:5671` (producer), `:5672` (worker consumer), `amqps` | mTLS front (SAN `api`/`relay` на 5671, `worker` на 5672); gateway → RabbitMQ TLS 5671 с `verify_peer`, `fail_if_no_peer_cert` | SAN allowlist по listener-у; Rabbit permissions: worker только read `attachment.jobs` (без publish/bind), API/relay — producer; guest удалён | Rabbit user passwords ротируются `track1.py`; gateway leaf 397 дней | `mtls_probe.py: broker_no_client_cert, broker_wrong_identity_on_producer, broker_api_on_consumer_port, broker_api_identity_allowed`; `track1_probe.py: rabbit_publish_allowed` | +| API/worker/relay → Collector | `internal-gateway:4318` (api), `:4319` (worker), `:4320` (relay) | mTLS; отдельные SAN; gateway → Collector plaintext только в изолированной сети `lab7_otelnet` (только gateway+collector) | SAN allowlist по порту; app не знает адреса Prometheus/Loki/Tempo | leaf 397 дней; collector не публикует порт | `mtls_probe.py: collector_api_identity_allowed, collector_worker_on_api_port, collector_worker_identity_allowed` | +| Collector → telemetry backends | `collector-tls:8889/8888` (scrape), `loki-tls:8443`, `tempo-tls:4317` | mTLS; Prometheus client SAN `prometheus`; collector client SAN `otel-collector`; backends проверяют SAN | `collector-tls`, `loki-tls`, `tempo-tls` allowlist; plaintext backend hop только в изолированных `promnet/lokinet/temponet` | sidecar leaf 397 дней; collector client cert `telemetry-client` | `mtls_probe.py: collector_metrics_prometheus_allowed, collector_metrics_grafana_denied, loki_collector_allowed, loki_foreign_identity_denied`; Prometheus target `up` | +| Grafana → data sources | Grafana `https://127.0.0.1:3000`; datasources `https://prometheus-tls:8443`, `https://loki-tls:8443`, `https://tempo-tls:8443` | TLS server + mTLS client cert SAN `grafana.messenger.internal`; Grafana admin password из secret file | datasource provisioning с `tlsAuth` + CA; negative — collector cert на Grafana-порту | admin password локальный; datasource cert 397 дней | `scripts/grafana_evidence.py`; `prometheus_collector_denied`; Grafana datasource health | +| API/worker/relay → OpenBao | `https://openbao:8200` | TLS server SAN `openbao`; AppRole role_id/secret_id; token TTL 300 с, max 900 с | Политики: `messenger-api` → только `kv/data/messenger/api`; worker/relay — только свой path; запись policy и чтение чужого path запрещены | token renewal/re-auth; SecretID TTL 3600 с; root token только в bootstrap | `mtls_probe.py: openbao_api_own_secret_allowed, openbao_api_foreign_secret_denied, openbao_api_policy_write_denied, openbao_api_policy_list_denied, openbao_worker_foreign_secret_denied`; `evidence/openbao-sealed.txt` | +| Оператор → OpenBao/Grafana/S3 admin | `127.0.0.1:8200`, `127.0.0.1:3000`; MinIO console только внутренний | TLS + admin auth; OpenBao root/unseal только у оператора | Публикация только на loopback; root token в `secrets/openbao-init.json` (gitignored), не в app | root token не ротируется автоматически; unseal shares 5/3 | `docker compose ps`; `scripts/openbao_seal_test.sh`; Grafana admin login | +| API → Redis/Valkey | N/A | — | В lab7 Valkey/Redis удалён; сессии перенесены в PostgreSQL | — | `grep -R Redis src` пусто; миграция 0006 | +| Replication/кластерные каналы | N/A | — | Стенд single-node PostgreSQL/RabbitMQ/MinIO; HA БД/брокера не заявлена | — | ограничение в REPORT.md | -## Обязательные отрицательные проверки +## Обязательные отрицательные проверки — где лежат -1. HTTPS с правильным CA/hostname проходит; с пустым/чужим CA и неправильным hostname — ошибка верификации, не «сервер недоступен». -2. LB→API: без client cert, с cert чужого CA, с запрещённой identity от доверенного CA — отказ; с разрешённой LB identity — успех. -3. На 4 повторите набор для broker и Collector; ограничение на network policy не заменяет проверку identity. -4. Пользователь вне чата не читает metadata/content и не прикрепляет чужой файл; поддельный X-User-Id не меняет Bearer identity. -5. OpenBao app policy читает только свой secret/path; запись policy и чтение чужого path запрещены. Worker не получает admin credentials API/БД/S3. -6. На 4 отзовите secret/cert и дождитесь контролируемого эффекта с учётом действующих соединений, TLS resumption и cache/TTL. Покажите новое подключение, иначе тест отзыва может ничего не проверить. +1. Внешний TLS: `tests/security.py` (trusted, untrusted CA); `mtls_probe.py` (trusted, foreign CA, wrong hostname). +2. LB→API: `mtls_probe.py` — без cert, foreign CA, wrong SAN (403), правильная SAN (200). +3. Broker/Collector: `mtls_probe.py` — worker на producer-порту 403, api на consumer-порту 403, правильные identity проходят; collector api/worker разделены. +4. ACL: `scripts/security_checks.py` — посторонний получает 404 на историю/метаданные/content; поддельный `X-User-Id` не меняет sender. +5. OpenBao: `mtls_probe.py` — чужой path 403, запись policy 403, список policy 403. +6. Revocation/rotation: `scripts/track1.py` — DB NOLOGIN, MinIO disable/delete, Rabbit delete, ротация трёх секретов, 5 задач пережили отзыв и стали ready; `cert_probe.py` — старый leaf serial отклонён, новый принят. + +## Bootstrap/health/scrape каналы + +- API health на `127.0.0.1:8080` внутри контейнера; наружу не опубликован. Traefik healthcheck идёт через mTLS на `api:8081`. +- Collector scrape: Prometheus → `collector-tls:8889/8888` по mTLS; collector self-metrics не публикуются. +- OpenBao bootstrap: одноразовый контейнер `openbao-bootstrap` с root token из файла; после bootstrap root token не передаётся API/worker. +- MinIO bootstrap: root-учётка только в `minio-init`; API/worker получают scoped users через OpenBao. +- Grafana admin: пароль из `secrets/grafana_admin_password`, опубликован только на loopback. ## Bootstrap и эксплуатация -В репозитории только открытые конфиги, policy templates и scripts. CA private key, leaf keys, root token, unseal shares и SecretID не коммитятся, не запекаются в образ и не печатаются в отчёте. Для локального стенда оператор создаёт их вне Git и передаёт через files/secrets с ограниченными правами. Опишите, кто имеет доступ к CA/unseal, что нужно после рестарта OpenBao и как восстановить работу. - -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. +- CA private key и unseal shares создаются `scripts/bootstrap-certs.sh` / + `scripts/openbao_bootstrap.py`; они лежат в gitignored `secrets/` с mode 644 внутри каталога 700, + не попадают в образ (Dockerfile копирует только `src/`, `migrations/`). +- `scripts/bootstrap-openbao.sh`/сервис `openbao-bootstrap` идемпотентно + инициализирует OpenBao, unseal-ит его и создаёт AppRole. Повторный запуск не + меняет действующие role_id/secret_id. +- После рестарта OpenBao остаётся sealed: `scripts/restart.sh` запускает + bootstrap для unseal; API/worker fail-closed, пока OpenBao не доступен. +- Ротация worker: `scripts/rotate-worker-cert.sh` (leaf + revocation list) и + `scripts/track1.py` (DB/S3/broker secrets + OpenBao KV). diff --git a/evidence/01-contract-check.txt b/evidence/01-contract-check.txt new file mode 100644 index 0000000..017db5f Binary files /dev/null and b/evidence/01-contract-check.txt differ diff --git a/evidence/01-openapi-validation.txt b/evidence/01-openapi-validation.txt new file mode 100644 index 0000000..8bbfb0a Binary files /dev/null and b/evidence/01-openapi-validation.txt differ diff --git a/evidence/02-public-smoke.txt b/evidence/02-public-smoke.txt new file mode 100644 index 0000000..88376e2 Binary files /dev/null and b/evidence/02-public-smoke.txt differ diff --git a/evidence/03-external-tls.txt b/evidence/03-external-tls.txt new file mode 100644 index 0000000..b094fc9 Binary files /dev/null and b/evidence/03-external-tls.txt differ diff --git a/evidence/04-mtls-matrix.json b/evidence/04-mtls-matrix.json new file mode 100644 index 0000000..264602e --- /dev/null +++ b/evidence/04-mtls-matrix.json @@ -0,0 +1,171 @@ +{ + "checks": [ + { + "detail": "HTTP 200", + "name": "external_tls_trusted", + "ok": true + }, + { + "detail": "rejected: SSLCertVerificationError", + "name": "external_tls_untrusted_ca", + "ok": true + }, + { + "detail": "rejected: CERTIFICATE_VERIFY_FAILED", + "name": "external_tls_wrong_hostname", + "ok": true + }, + { + "detail": "connection rejected: RemoteDisconnected; no client certificate", + "name": "api_no_client_cert", + "ok": true + }, + { + "detail": "connection rejected: RemoteDisconnected; client signed by foreign CA", + "name": "api_foreign_ca_client", + "ok": true + }, + { + "detail": "HTTP 403; foreign.messenger.internal must be denied", + "name": "api_trusted_ca_wrong_identity", + "ok": true + }, + { + "detail": "HTTP 200; lb.messenger.internal ready", + "name": "api_lb_identity_allowed", + "ok": true + }, + { + "detail": "HTTP 403; no client certificate", + "name": "broker_no_client_cert", + "ok": true + }, + { + "detail": "HTTP 403; worker identity on producer port must be closed", + "name": "broker_wrong_identity_on_producer", + "ok": true + }, + { + "detail": "HTTP 403; api identity on consumer port must be closed", + "name": "broker_api_on_consumer_port", + "ok": true + }, + { + "detail": "AMQP Connection.Start bytes=64", + "name": "broker_api_identity_allowed", + "ok": true + }, + { + "detail": "HTTP 405; api identity reaches collector", + "name": "collector_api_identity_allowed", + "ok": true + }, + { + "detail": "HTTP 403; worker identity on api port must be denied", + "name": "collector_worker_on_api_port", + "ok": true + }, + { + "detail": "HTTP 405; worker identity reaches collector", + "name": "collector_worker_identity_allowed", + "ok": true + }, + { + "detail": "HTTP 200; collector reads Loki", + "name": "loki_collector_allowed", + "ok": true + }, + { + "detail": "HTTP 403; foreign identity denied", + "name": "loki_foreign_identity_denied", + "ok": true + }, + { + "detail": "HTTP 200; Grafana reads Prometheus", + "name": "prometheus_grafana_allowed", + "ok": true + }, + { + "detail": "HTTP 403; collector cert on Grafana port denied", + "name": "prometheus_collector_denied", + "ok": true + }, + { + "detail": "HTTP 200; Prometheus scrapes collector over mTLS", + "name": "collector_metrics_prometheus_allowed", + "ok": true + }, + { + "detail": "HTTP 403; Grafana cert on scrape port denied", + "name": "collector_metrics_grafana_denied", + "ok": true + }, + { + "detail": "HTTP 200", + "name": "openbao_api_own_secret_allowed", + "ok": true + }, + { + "detail": "HTTP 403", + "name": "openbao_api_foreign_secret_denied", + "ok": true + }, + { + "detail": "HTTP 403", + "name": "openbao_api_policy_write_denied", + "ok": true + }, + { + "detail": "HTTP 403", + "name": "openbao_api_policy_list_denied", + "ok": true + }, + { + "detail": "HTTP 403", + "name": "openbao_worker_foreign_secret_denied", + "ok": true + }, + { + "detail": "verified TLS + SELECT 1", + "name": "postgres_api_tls_allowed", + "ok": true + }, + { + "detail": "worker reads jobs", + "name": "postgres_worker_jobs_allowed", + "ok": true + }, + { + "detail": "users/password_hash denied", + "name": "postgres_worker_users_denied", + "ok": true + }, + { + "detail": "CREATE TABLE denied", + "name": "postgres_worker_ddl_denied", + "ok": true + }, + { + "detail": "ssl=False rejected", + "name": "postgres_plaintext_rejected", + "ok": true + }, + { + "detail": "TLS + ListBucket staging", + "name": "s3_api_tls_allowed", + "ok": true + }, + { + "detail": "attachments/other/* denied", + "name": "s3_api_foreign_prefix_denied", + "ok": true + }, + { + "detail": "SSLError", + "name": "s3_untrusted_ca_rejected", + "ok": true + } + ], + "failed": 0, + "passed": 33 +} diff --git a/evidence/04-mtls-probe.log b/evidence/04-mtls-probe.log new file mode 100644 index 0000000..40ae907 --- /dev/null +++ b/evidence/04-mtls-probe.log @@ -0,0 +1,34 @@ +PASS external_tls_trusted: HTTP 200 +PASS external_tls_untrusted_ca: rejected: SSLCertVerificationError +PASS external_tls_wrong_hostname: rejected: CERTIFICATE_VERIFY_FAILED +PASS api_no_client_cert: connection rejected: RemoteDisconnected; no client certificate +PASS api_foreign_ca_client: connection rejected: RemoteDisconnected; client signed by foreign CA +PASS api_trusted_ca_wrong_identity: HTTP 403; foreign.messenger.internal must be denied +PASS api_lb_identity_allowed: HTTP 200; lb.messenger.internal ready +PASS broker_no_client_cert: HTTP 403; no client certificate +PASS broker_wrong_identity_on_producer: HTTP 403; worker identity on producer port must be closed +PASS broker_api_on_consumer_port: HTTP 403; api identity on consumer port must be closed +PASS broker_api_identity_allowed: AMQP Connection.Start bytes=64 +PASS collector_api_identity_allowed: HTTP 405; api identity reaches collector +PASS collector_worker_on_api_port: HTTP 403; worker identity on api port must be denied +PASS collector_worker_identity_allowed: HTTP 405; worker identity reaches collector +PASS loki_collector_allowed: HTTP 200; collector reads Loki +PASS loki_foreign_identity_denied: HTTP 403; foreign identity denied +PASS prometheus_grafana_allowed: HTTP 200; Grafana reads Prometheus +PASS prometheus_collector_denied: HTTP 403; collector cert on Grafana port denied +PASS collector_metrics_prometheus_allowed: HTTP 200; Prometheus scrapes collector over mTLS +PASS collector_metrics_grafana_denied: HTTP 403; Grafana cert on scrape port denied +PASS openbao_api_own_secret_allowed: HTTP 200 +PASS openbao_api_foreign_secret_denied: HTTP 403 +PASS openbao_api_policy_write_denied: HTTP 403 +PASS openbao_api_policy_list_denied: HTTP 403 +PASS openbao_worker_foreign_secret_denied: HTTP 403 +PASS postgres_api_tls_allowed: verified TLS + SELECT 1 +PASS postgres_worker_jobs_allowed: worker reads jobs +PASS postgres_worker_users_denied: users/password_hash denied +PASS postgres_worker_ddl_denied: CREATE TABLE denied +PASS postgres_plaintext_rejected: ssl=False rejected +PASS s3_api_tls_allowed: TLS + ListBucket staging +PASS s3_api_foreign_prefix_denied: attachments/other/* denied +PASS s3_untrusted_ca_rejected: SSLError +{"checks": [{"detail": "HTTP 200", "name": "external_tls_trusted", "ok": true}, {"detail": "rejected: SSLCertVerificationError", "name": "external_tls_untrusted_ca", "ok": true}, {"detail": "rejected: CERTIFICATE_VERIFY_FAILED", "name": "external_tls_wrong_hostname", "ok": true}, {"detail": "connection rejected: RemoteDisconnected; no client certificate", "name": "api_no_client_cert", "ok": true}, {"detail": "connection rejected: RemoteDisconnected; client signed by foreign CA", "name": "api_foreign_ca_client", "ok": true}, {"detail": "HTTP 403; foreign.messenger.internal must be denied", "name": "api_trusted_ca_wrong_identity", "ok": true}, {"detail": "HTTP 200; lb.messenger.internal ready", "name": "api_lb_identity_allowed", "ok": true}, {"detail": "HTTP 403; no client certificate", "name": "broker_no_client_cert", "ok": true}, {"detail": "HTTP 403; worker identity on producer port must be closed", "name": "broker_wrong_identity_on_producer", "ok": true}, {"detail": "HTTP 403; api identity on consumer port must be closed", "name": "broker_api_on_consumer_port", "ok": true}, {"detail": "AMQP Connection.Start bytes=64", "name": "broker_api_identity_allowed", "ok": true}, {"detail": "HTTP 405; api identity reaches collector", "name": "collector_api_identity_allowed", "ok": true}, {"detail": "HTTP 403; worker identity on api port must be denied", "name": "collector_worker_on_api_port", "ok": true}, {"detail": "HTTP 405; worker identity reaches collector", "name": "collector_worker_identity_allowed", "ok": true}, {"detail": "HTTP 200; collector reads Loki", "name": "loki_collector_allowed", "ok": true}, {"detail": "HTTP 403; foreign identity denied", "name": "loki_foreign_identity_denied", "ok": true}, {"detail": "HTTP 200; Grafana reads Prometheus", "name": "prometheus_grafana_allowed", "ok": true}, {"detail": "HTTP 403; collector cert on Grafana port denied", "name": "prometheus_collector_denied", "ok": true}, {"detail": "HTTP 200; Prometheus scrapes collector over mTLS", "name": "collector_metrics_prometheus_allowed", "ok": true}, {"detail": "HTTP 403; Grafana cert on scrape port denied", "name": "collector_metrics_grafana_denied", "ok": true}, {"detail": "HTTP 200", "name": "openbao_api_own_secret_allowed", "ok": true}, {"detail": "HTTP 403", "name": "openbao_api_foreign_secret_denied", "ok": true}, {"detail": "HTTP 403", "name": "openbao_api_policy_write_denied", "ok": true}, {"detail": "HTTP 403", "name": "openbao_api_policy_list_denied", "ok": true}, {"detail": "HTTP 403", "name": "openbao_worker_foreign_secret_denied", "ok": true}, {"detail": "verified TLS + SELECT 1", "name": "postgres_api_tls_allowed", "ok": true}, {"detail": "worker reads jobs", "name": "postgres_worker_jobs_allowed", "ok": true}, {"detail": "users/password_hash denied", "name": "postgres_worker_users_denied", "ok": true}, {"detail": "CREATE TABLE denied", "name": "postgres_worker_ddl_denied", "ok": true}, {"detail": "ssl=False rejected", "name": "postgres_plaintext_rejected", "ok": true}, {"detail": "TLS + ListBucket staging", "name": "s3_api_tls_allowed", "ok": true}, {"detail": "attachments/other/* denied", "name": "s3_api_foreign_prefix_denied", "ok": true}, {"detail": "SSLError", "name": "s3_untrusted_ca_rejected", "ok": true}], "failed": 0, "passed": 33} diff --git a/evidence/05-security-checks.log b/evidence/05-security-checks.log new file mode 100644 index 0000000..d5faf96 Binary files /dev/null and b/evidence/05-security-checks.log differ diff --git a/evidence/06-argon2.txt b/evidence/06-argon2.txt new file mode 100644 index 0000000..1eaffb6 Binary files /dev/null and b/evidence/06-argon2.txt differ diff --git a/evidence/07-container-hardening.json b/evidence/07-container-hardening.json new file mode 100644 index 0000000..367d6e5 --- /dev/null +++ b/evidence/07-container-hardening.json @@ -0,0 +1,286 @@ +[ + { + "name": "lab7-api-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 536870912, + "nano_cpus": 1000000000, + "ports": [], + "networks": [ + "lab7_app", + "lab7_data", + "lab7_edge" + ] + }, + { + "name": "lab7-worker-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 536870912, + "nano_cpus": 1000000000, + "ports": [], + "networks": [ + "lab7_app", + "lab7_data" + ] + }, + { + "name": "lab7-relay-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 268435456, + "nano_cpus": 500000000, + "ports": [], + "networks": [ + "lab7_app", + "lab7_data" + ] + }, + { + "name": "lab7-openbao-1", + "user": "", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_SETGID", + "CAP_SETUID" + ], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 268435456, + "nano_cpus": 1000000000, + "ports": [ + { + "container": "8200/tcp", + "host": "127.0.0.1:8200" + } + ], + "networks": [ + "lab7_admin", + "lab7_data" + ] + }, + { + "name": "lab7-traefik-1", + "user": "", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 134217728, + "nano_cpus": 500000000, + "ports": [ + { + "container": "8443/tcp", + "host": "127.0.0.1:8443" + } + ], + "networks": [ + "lab7_edge" + ] + }, + { + "name": "lab7-postgres-1", + "user": "", + "read_only": false, + "privileged": false, + "cap_drop": [], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 536870912, + "nano_cpus": 2000000000, + "ports": [], + "networks": [ + "lab7_data" + ] + }, + { + "name": "lab7-minio-1", + "user": "", + "read_only": false, + "privileged": false, + "cap_drop": [], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 536870912, + "nano_cpus": 1000000000, + "ports": [], + "networks": [ + "lab7_data" + ] + }, + { + "name": "lab7-rabbitmq-1", + "user": "", + "read_only": false, + "privileged": false, + "cap_drop": [], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 536870912, + "nano_cpus": 1000000000, + "ports": [], + "networks": [ + "lab7_broker" + ] + }, + { + "name": "lab7-internal-gateway-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 134217728, + "nano_cpus": 500000000, + "ports": [], + "networks": [ + "lab7_app", + "lab7_broker", + "lab7_otelnet" + ] + }, + { + "name": "lab7-otel-collector-1", + "user": "10001:10001", + "read_only": false, + "privileged": false, + "cap_drop": [], + "cap_add": [], + "security_opt": [], + "memory_bytes": 536870912, + "nano_cpus": 1000000000, + "ports": [], + "networks": [ + "lab7_collectorscrape", + "lab7_otelnet", + "lab7_telemetry" + ] + }, + { + "name": "lab7-prometheus-tls-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 100663296, + "nano_cpus": 250000000, + "ports": [], + "networks": [ + "lab7_promnet", + "lab7_telemetry" + ] + }, + { + "name": "lab7-tempo-tls-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 100663296, + "nano_cpus": 250000000, + "ports": [], + "networks": [ + "lab7_telemetry", + "lab7_temponet" + ] + }, + { + "name": "lab7-collector-tls-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 100663296, + "nano_cpus": 250000000, + "ports": [], + "networks": [ + "lab7_collectorscrape", + "lab7_telemetry" + ] + }, + { + "name": "lab7-loki-tls-1", + "user": "10001:10001", + "read_only": true, + "privileged": false, + "cap_drop": [ + "ALL" + ], + "cap_add": [], + "security_opt": [ + "no-new-privileges:true" + ], + "memory_bytes": 100663296, + "nano_cpus": 250000000, + "ports": [], + "networks": [ + "lab7_lokinet", + "lab7_telemetry" + ] + } +] \ No newline at end of file diff --git a/evidence/08-persistence.txt b/evidence/08-persistence.txt new file mode 100644 index 0000000..c25ceba Binary files /dev/null and b/evidence/08-persistence.txt differ diff --git a/evidence/09-failover.txt b/evidence/09-failover.txt new file mode 100644 index 0000000..10c55d3 Binary files /dev/null and b/evidence/09-failover.txt differ diff --git a/evidence/10-telemetry-leak.txt b/evidence/10-telemetry-leak.txt new file mode 100644 index 0000000..58c581c Binary files /dev/null and b/evidence/10-telemetry-leak.txt differ diff --git a/evidence/11-grafana.json b/evidence/11-grafana.json new file mode 100644 index 0000000..da003b0 --- /dev/null +++ b/evidence/11-grafana.json @@ -0,0 +1,39 @@ +{ + "health": { + "database": "ok", + "version": "12.2.0", + "commit": "92f1fba9b4b6700328e99e97328d6639df8ddc3d" + }, + "datasources": [ + { + "name": "Loki", + "uid": "loki", + "type": "loki", + "url": "https://loki-tls:8443", + "tlsAuth": true, + "tlsAuthWithCACert": true + }, + { + "name": "Prometheus", + "uid": "prometheus", + "type": "prometheus", + "url": "https://prometheus-tls:8443", + "tlsAuth": true, + "tlsAuthWithCACert": true + }, + { + "name": "Tempo", + "uid": "tempo", + "type": "tempo", + "url": "https://tempo-tls:8443", + "tlsAuth": true, + "tlsAuthWithCACert": true + } + ], + "dashboards": [ + { + "uid": "messenger-lab7", + "title": "Messenger — Observability (lab7)" + } + ] +} \ No newline at end of file diff --git a/evidence/12-load.json b/evidence/12-load.json new file mode 100644 index 0000000..19b3896 --- /dev/null +++ b/evidence/12-load.json @@ -0,0 +1,17 @@ +{ + "lab": 7, + "workload": "closed-loop POST messages; no automatic retries", + "requested_duration_seconds": 30.0, + "elapsed_seconds": 30.031, + "concurrency": 4, + "successful_requests": 2194, + "failed_requests": 0, + "error_ratio": 0.0, + "successful_rps": 73.058, + "successful_latency_ms": { + "p50": 47.0, + "p95": 94.0, + "p99": 156.0 + }, + "note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead." +} diff --git a/evidence/13-trivy-app.json b/evidence/13-trivy-app.json new file mode 100644 index 0000000..855e864 --- /dev/null +++ b/evidence/13-trivy-app.json @@ -0,0 +1,11388 @@ +{ + "SchemaVersion": 2, + "CreatedAt": "2026-11-27T12:42:39.0447822Z", + "ArtifactName": "mtusi-messenger-lab7:7.0.0", + "ArtifactType": "container_image", + "Metadata": { + "OS": { + "Family": "debian", + "Name": "12.15" + }, + "ImageID": "sha256:e97d957738634d62a166198d34083737ac44958e47b87ca2ade7882b396ee504", + "DiffIDs": [ + "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb", + "sha256:fbc55748732d0123d94fc4db6b7a810df835cc38db45a6ad1088d41f4cb2ef40", + "sha256:cadfff4b36cfd18d3a844aad4bc14f304c6baad6ad1f52cec0a99ee167915833", + "sha256:5c7e24e4a88ec3b59fd307e1d386b482be12334f7b53b06575a10d7b0a549669", + "sha256:7cb94502409a1280e22fcd64bb6570e5e4fc332725a928c96477994393be09db", + "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844", + "sha256:4c7bc8858603480ee698cc46d6b53fb23dbf86f9c579971a00aedd5387d8c80f", + "sha256:ab99651ae47e5fa51d2b7b35cc9ce7eff3659330710a23376870285daed260e8", + "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881", + "sha256:7a7897e492d12b92c627c2d330c65c22d8d07c8c57b5b8e3d1bb41f41dd16552", + "sha256:f94aae7c47ba240d3c05377eaa49ea37de1685523f79a3d0e258c065600ff27a", + "sha256:fa7d4afb63667c51897183b3bc26d21e2197069f906f4d972c82d7e3d4fd9616" + ], + "RepoTags": [ + "mtusi-messenger-lab7:7.0.0" + ], + "RepoDigests": [ + "mtusi-messenger-lab7@sha256:e97d957738634d62a166198d34083737ac44958e47b87ca2ade7882b396ee504" + ], + "ImageConfig": { + "architecture": "amd64", + "created": "2026-11-27T12:40:59.4106922Z", + "history": [ + { + "created": "2024-08-29T23:26:33Z", + "created_by": "/bin/sh -c #(nop) ADD file:d13afefcc2b0b02b598a3ac2598fe2187db41de1e17820e5b600a955b1429d59 in / " + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "/bin/sh -c #(nop) CMD [\"bash\"]", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV LANG=C.UTF-8", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "RUN /bin/sh -c set -eux; \tapt-get update; \tapt-get install -y --no-install-recommends \t\tca-certificates \t\tnetbase \t\ttzdata \t; \trm -rf /var/lib/apt/lists/* # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV PYTHON_VERSION=3.11.9", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "RUN /bin/sh -c set -eux; \t\tsavedAptMark=\"$(apt-mark showmanual)\"; \tapt-get update; \tapt-get install -y --no-install-recommends \t\tdpkg-dev \t\tgcc \t\tgnupg \t\tlibbluetooth-dev \t\tlibbz2-dev \t\tlibc6-dev \t\tlibdb-dev \t\tlibexpat1-dev \t\tlibffi-dev \t\tlibgdbm-dev \t\tliblzma-dev \t\tlibncursesw5-dev \t\tlibreadline-dev \t\tlibsqlite3-dev \t\tlibssl-dev \t\tmake \t\ttk-dev \t\tuuid-dev \t\twget \t\txz-utils \t\tzlib1g-dev \t; \t\twget -O python.tar.xz \"https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz\"; \twget -O python.tar.xz.asc \"https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc\"; \tGNUPGHOME=\"$(mktemp -d)\"; export GNUPGHOME; \tgpg --batch --keyserver hkps://keys.openpgp.org --recv-keys \"$GPG_KEY\"; \tgpg --batch --verify python.tar.xz.asc python.tar.xz; \tgpgconf --kill all; \trm -rf \"$GNUPGHOME\" python.tar.xz.asc; \tmkdir -p /usr/src/python; \ttar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \trm python.tar.xz; \t\tcd /usr/src/python; \tgnuArch=\"$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)\"; \t./configure \t\t--build=\"$gnuArch\" \t\t--enable-loadable-sqlite-extensions \t\t--enable-optimizations \t\t--enable-option-checking=fatal \t\t--enable-shared \t\t--with-lto \t\t--with-system-expat \t\t--without-ensurepip \t; \tnproc=\"$(nproc)\"; \tEXTRA_CFLAGS=\"$(dpkg-buildflags --get CFLAGS)\"; \tLDFLAGS=\"$(dpkg-buildflags --get LDFLAGS)\"; \tLDFLAGS=\"${LDFLAGS:--Wl},--strip-all\"; \tmake -j \"$nproc\" \t\t\"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}\" \t\t\"LDFLAGS=${LDFLAGS:-}\" \t\t\"PROFILE_TASK=${PROFILE_TASK:-}\" \t; \trm python; \tmake -j \"$nproc\" \t\t\"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}\" \t\t\"LDFLAGS=${LDFLAGS:--Wl},-rpath='\\$\\$ORIGIN/../lib'\" \t\t\"PROFILE_TASK=${PROFILE_TASK:-}\" \t\tpython \t; \tmake install; \t\tcd /; \trm -rf /usr/src/python; \t\tfind /usr/local -depth \t\t\\( \t\t\t\\( -type d -a \\( -name test -o -name tests -o -name idle_test \\) \\) \t\t\t-o \\( -type f -a \\( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \\) \\) \t\t\\) -exec rm -rf '{}' + \t; \t\tldconfig; \t\tapt-mark auto '.*' \u003e /dev/null; \tapt-mark manual $savedAptMark; \tfind /usr/local -type f -executable -not \\( -name '*tkinter*' \\) -exec ldd '{}' ';' \t\t| awk '/=\u003e/ { so = $(NF-1); if (index(so, \"/usr/local/\") == 1) { next }; gsub(\"^/(usr/)?\", \"\", so); printf \"*%s\\n\", so }' \t\t| sort -u \t\t| xargs -r dpkg-query --search \t\t| cut -d: -f1 \t\t| sort -u \t\t| xargs -r apt-mark manual \t; \tapt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \trm -rf /var/lib/apt/lists/*; \t\tpython3 --version # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "RUN /bin/sh -c set -eux; \tfor src in idle3 pydoc3 python3 python3-config; do \t\tdst=\"$(echo \"$src\" | tr -d 3)\"; \t\t[ -s \"/usr/local/bin/$src\" ]; \t\t[ ! -e \"/usr/local/bin/$dst\" ]; \t\tln -svT \"$src\" \"/usr/local/bin/$dst\"; \tdone # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV PYTHON_PIP_VERSION=24.0", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV PYTHON_SETUPTOOLS_VERSION=65.5.1", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "ENV PYTHON_GET_PIP_SHA256=bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "RUN /bin/sh -c set -eux; \t\tsavedAptMark=\"$(apt-mark showmanual)\"; \tapt-get update; \tapt-get install -y --no-install-recommends wget; \t\twget -O get-pip.py \"$PYTHON_GET_PIP_URL\"; \techo \"$PYTHON_GET_PIP_SHA256 *get-pip.py\" | sha256sum -c -; \t\tapt-mark auto '.*' \u003e /dev/null; \t[ -z \"$savedAptMark\" ] || apt-mark manual $savedAptMark \u003e /dev/null; \tapt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \trm -rf /var/lib/apt/lists/*; \t\texport PYTHONDONTWRITEBYTECODE=1; \t\tpython get-pip.py \t\t--disable-pip-version-check \t\t--no-cache-dir \t\t--no-compile \t\t\"pip==$PYTHON_PIP_VERSION\" \t\t\"setuptools==$PYTHON_SETUPTOOLS_VERSION\" \t\twheel \t; \trm -f get-pip.py; \t\tpip --version # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2024-08-29T23:26:33Z", + "created_by": "CMD [\"python3\"]", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:53Z", + "created_by": "RUN /bin/sh -c apt-get update \u0026\u0026 apt-get upgrade -y --no-install-recommends \u0026\u0026 rm -rf /var/lib/apt/lists/* # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:53Z", + "created_by": "ARG APP_REVISION=local", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:53Z", + "created_by": "LABEL org.opencontainers.image.title=mtusi-messenger-lab7 org.opencontainers.image.description=API и worker мессенджера на PostgreSQL, S3 и RabbitMQ; TLS/mTLS и OpenBao, лабораторная 7 (MTUSI HighLoad) org.opencontainers.image.version=7.0.0 org.opencontainers.image.revision=local", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:53Z", + "created_by": "ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 PATH=/opt/venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PYTHONPATH=/app/src APP_HOST=0.0.0.0 APP_PORT=8080", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:53Z", + "created_by": "WORKDIR /app", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:53Z", + "created_by": "RUN |1 APP_REVISION=local /bin/sh -c useradd --create-home --uid 10001 --shell /usr/sbin/nologin app # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "COPY /opt/venv /opt/venv # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "COPY --chown=app:app src/ ./src/ # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "COPY --chown=app:app alembic.ini ./ # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "COPY --chown=app:app migrations/ ./migrations/ # buildkit", + "comment": "buildkit.dockerfile.v0" + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "USER 10001:10001", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "EXPOSE map[8080/tcp:{}]", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "STOPSIGNAL SIGTERM", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "HEALTHCHECK \u0026{[\"CMD\" \"python\" \"-m\" \"messenger.healthcheck\"] \"10s\" \"3s\" \"5s\" \"0s\" '\\x03'}", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + }, + { + "created": "2026-11-27T12:40:59Z", + "created_by": "CMD [\"python\" \"-m\" \"messenger\"]", + "comment": "buildkit.dockerfile.v0", + "empty_layer": true + } + ], + "os": "linux", + "rootfs": { + "type": "layers", + "diff_ids": [ + "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb", + "sha256:fbc55748732d0123d94fc4db6b7a810df835cc38db45a6ad1088d41f4cb2ef40", + "sha256:cadfff4b36cfd18d3a844aad4bc14f304c6baad6ad1f52cec0a99ee167915833", + "sha256:5c7e24e4a88ec3b59fd307e1d386b482be12334f7b53b06575a10d7b0a549669", + "sha256:7cb94502409a1280e22fcd64bb6570e5e4fc332725a928c96477994393be09db", + "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844", + "sha256:4c7bc8858603480ee698cc46d6b53fb23dbf86f9c579971a00aedd5387d8c80f", + "sha256:ab99651ae47e5fa51d2b7b35cc9ce7eff3659330710a23376870285daed260e8", + "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881", + "sha256:7a7897e492d12b92c627c2d330c65c22d8d07c8c57b5b8e3d1bb41f41dd16552", + "sha256:f94aae7c47ba240d3c05377eaa49ea37de1685523f79a3d0e258c065600ff27a", + "sha256:fa7d4afb63667c51897183b3bc26d21e2197069f906f4d972c82d7e3d4fd9616" + ] + }, + "config": { + "Cmd": [ + "python", + "-m", + "messenger" + ], + "Healthcheck": { + "Test": [ + "CMD", + "python", + "-m", + "messenger.healthcheck" + ], + "Interval": 10000000000, + "Timeout": 3000000000, + "StartPeriod": 5000000000, + "Retries": 3 + }, + "Env": [ + "PATH=/opt/venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "LANG=C.UTF-8", + "GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D", + "PYTHON_VERSION=3.11.9", + "PYTHON_PIP_VERSION=24.0", + "PYTHON_SETUPTOOLS_VERSION=65.5.1", + "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", + "PYTHON_GET_PIP_SHA256=bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", + "PYTHONUNBUFFERED=1", + "PYTHONDONTWRITEBYTECODE=1", + "PYTHONPATH=/app/src", + "APP_HOST=0.0.0.0", + "APP_PORT=8080" + ], + "Labels": { + "com.docker.compose.project": "lab7", + "com.docker.compose.service": "api", + "com.docker.compose.version": "2.33.1", + "org.opencontainers.image.description": "API и worker мессенджера на PostgreSQL, S3 и RabbitMQ; TLS/mTLS и OpenBao, лабораторная 7 (MTUSI HighLoad)", + "org.opencontainers.image.revision": "local", + "org.opencontainers.image.title": "mtusi-messenger-lab7", + "org.opencontainers.image.version": "7.0.0" + }, + "User": "10001:10001", + "WorkingDir": "/app", + "ArgsEscaped": true, + "StopSignal": "SIGTERM" + } + } + }, + "Results": [ + { + "Target": "mtusi-messenger-lab7:7.0.0 (debian 12.15)", + "Class": "os-pkgs", + "Type": "debian", + "Vulnerabilities": [ + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "bsdutils@1:2.38.1-5+deb12u3", + "PkgName": "bsdutils", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/bsdutils@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15\u0026epoch=1", + "UID": "c2dbbb96ca1fc6d7" + }, + "InstalledVersion": "1:2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "bsdutils@1:2.38.1-5+deb12u3", + "PkgName": "bsdutils", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/bsdutils@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15\u0026epoch=1", + "UID": "c2dbbb96ca1fc6d7" + }, + "InstalledVersion": "1:2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "bsdutils@1:2.38.1-5+deb12u3", + "PkgName": "bsdutils", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/bsdutils@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15\u0026epoch=1", + "UID": "c2dbbb96ca1fc6d7" + }, + "InstalledVersion": "1:2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2026-41992", + "PkgID": "gzip@1.12-1", + "PkgName": "gzip", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/gzip@1.12-1?arch=amd64\u0026distro=debian-12.15", + "UID": "6e3848387630e6cc" + }, + "InstalledVersion": "1.12-1", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-41992", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "gzip: gzip: Information disclosure via global buffer overflow in LZH decompression", + "Description": "GNU gzip contains a global buffer overflow vulnerability in the LZH decompression logic caused by improper reuse of shared global state between different decompression formats within a single execution. GNU gzip maintains a global array that is shared across the LZ77, LZW, and LZH decompression routines and is not reinitialized between files processed in the same invocation.\nBy decompressing a specially crafted LZW file followed by a specially crafted LZH file in a single gzip -d command, an attacker can poison the shared global state and subsequently trigger an out‑of‑bounds read in the LZH decoder. The LZH decompression logic follows stale values left in the shared array, causing reads past the end of the allocated global buffer.\n\nThis issue has been fixed in commits 63dbf6b3b9e6e781df1a6a64e609b10e23969681 and e7378c2d421be6a286922374425680bbe9ad8b7d.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-126" + ], + "VendorSeverity": { + "alma": 2, + "azure": 2, + "julia": 2, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 1, + "rocky": 2, + "ubuntu": 2 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", + "V40Vector": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N", + "V3Score": 7.5, + "V40Score": 6.9 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:L", + "V3Score": 3.6 + } + }, + "References": [ + "http://www.openwall.com/lists/oss-security/2026/08/23/1", + "http://www.openwall.com/lists/oss-security/2026/08/25/1", + "http://www.openwall.com/lists/oss-security/2026/08/27/2", + "https://access.redhat.com/errata/RHSA-2026:61623", + "https://access.redhat.com/security/cve/CVE-2026-41992", + "https://bugzilla.redhat.com/2494158", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494158", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494159", + "https://cert.pl/en/posts/2026/04/CVE-2026-41991", + "https://cert.pl/en/posts/2026/04/CVE-2026-41991/", + "https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681", + "https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=e7378c2d421be6a286922374425680bbe9ad8b7d", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-41991", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-41992", + "https://errata.almalinux.org/9/ALSA-2026-61623.html", + "https://errata.rockylinux.org/RLSA-2026:61623", + "https://github.com/advisories/GHSA-qxh4-rprf-2mmj", + "https://linux.oracle.com/cve/CVE-2026-41992.html", + "https://linux.oracle.com/errata/ELSA-2026-65998-0.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-41992", + "https://ubuntu.com/security/notices/USN-8512-1", + "https://ubuntu.com/security/notices/USN-8733-1", + "https://ubuntu.com/security/notices/USN-8733-2", + "https://www.cve.org/CVERecord?id=CVE-2026-41992", + "https://www.gnu.org/software/gzip", + "https://www.gnu.org/software/gzip/" + ], + "PublishedDate": "2026-06-29T12:16:29.94Z", + "LastModifiedDate": "2026-10-25T21:10:00.77Z" + }, + { + "VulnerabilityID": "CVE-2026-54369", + "PkgID": "libacl1@2.3.1-3", + "PkgName": "libacl1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libacl1@2.3.1-3?arch=amd64\u0026distro=debian-12.15", + "UID": "196610212f549146" + }, + "InstalledVersion": "2.3.1-3", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-54369", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "acl: Symlink traversal privilege escalation via libacl functions", + "Description": "acl before version 2.4.0 contains a symlink traversal vulnerability in the libacl pathname-based functions acl_get_file(), acl_set_file(), acl_extended_file(), and acl_delete_def_file() that allows local attackers to escalate privileges by replacing any pathname component with a symbolic link. Attackers who control any component of a pathname processed by a privileged caller can redirect ACL read or write operations to arbitrary files or directories, enabling unauthorized manipulation of access control lists and local privilege escalation.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-59" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 7.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:34351", + "https://access.redhat.com/errata/RHSA-2026:42736", + "https://access.redhat.com/errata/RHSA-2026:42739", + "https://access.redhat.com/errata/RHSA-2026:43420", + "https://access.redhat.com/errata/RHSA-2026:44481", + "https://access.redhat.com/errata/RHSA-2026:46836", + "https://access.redhat.com/errata/RHSA-2026:50205", + "https://access.redhat.com/errata/RHSA-2026:53371", + "https://access.redhat.com/errata/RHSA-2026:54769", + "https://access.redhat.com/errata/RHSA-2026:58981", + "https://access.redhat.com/errata/RHSA-2026:64805", + "https://access.redhat.com/errata/RHSA-2026:67140", + "https://access.redhat.com/errata/RHSA-2026:67142", + "https://access.redhat.com/errata/RHSA-2026:67144", + "https://access.redhat.com/security/cve/CVE-2026-54369", + "https://bugzilla.redhat.com/2490277", + "https://bugzilla.redhat.com/2490279", + "https://bugzilla.redhat.com/show_bug.cgi?id=2490277", + "https://bugzilla.redhat.com/show_bug.cgi?id=2490279", + "https://cgit.git.savannah.nongnu.org/cgit/acl.git/commit/?id=24a227d0ab8576612194f8a56c2314389adc74a5", + "https://cgit.git.savannah.nongnu.org/cgit/acl.git/commit/?id=3589787cd589b34bdd9265936e17190b6d3f17d1", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-54369", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-54370", + "https://errata.almalinux.org/9/ALSA-2026-42736.html", + "https://errata.rockylinux.org/RLSA-2026:42736", + "https://linux.oracle.com/cve/CVE-2026-54369.html", + "https://linux.oracle.com/errata/ELSA-2026-43420.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-54369", + "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-54369.json", + "https://www.cve.org/CVERecord?id=CVE-2026-54369", + "https://www.vulncheck.com/advisories/acl-symlink-traversal-privilege-escalation-via-libacl-functions" + ], + "PublishedDate": "2026-06-29T14:16:57.487Z", + "LastModifiedDate": "2026-10-25T21:10:00.77Z" + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "libblkid1@2.38.1-5+deb12u3", + "PkgName": "libblkid1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libblkid1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "11e280117e08af9a" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "libblkid1@2.38.1-5+deb12u3", + "PkgName": "libblkid1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libblkid1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "11e280117e08af9a" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "libblkid1@2.38.1-5+deb12u3", + "PkgName": "libblkid1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libblkid1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "11e280117e08af9a" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2026-113351", + "PkgID": "libexpat1@2.5.0-1+deb12u5", + "PkgName": "libexpat1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libexpat1@2.5.0-1%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "6bb8ece8e7970b68" + }, + "InstalledVersion": "2.5.0-1+deb12u5", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-113351", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "expat: expat: Denial of Service via improper memory tracking in XML_ParserReset", + "Description": "libexpat 2.7.2 through 2.9.0 contains a denial of service vulnerability because XML_ParserReset zeroes the direct byte count but never offsets tracked heap allocations. Attackers can submit a large XML document so later documents on the same reset parser fail with XML_ERROR_NO_MEMORY until it is recreated.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-909" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "julia": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 2, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N", + "V3Score": 7.5, + "V40Score": 8.2 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 5.9 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:100679", + "https://access.redhat.com/errata/RHSA-2026:100681", + "https://access.redhat.com/security/cve/CVE-2026-113351", + "https://advisory.echohq.com/cve/cve-2026-113351", + "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1151840", + "https://bugzilla.redhat.com/2556110", + "https://bugzilla.redhat.com/2562538", + "https://bugzilla.redhat.com/2562544", + "https://bugzilla.redhat.com/show_bug.cgi?id=2556110", + "https://bugzilla.redhat.com/show_bug.cgi?id=2559312", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562538", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562544", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-113351", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-115506", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-117610", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118370", + "https://docs.bell-sw.com/security/cves/cve-2026-113351", + "https://errata.almalinux.org/10/ALSA-2026-100681.html", + "https://errata.rockylinux.org/RLSA-2026:100679", + "https://github.com/cveproject/cvelistv5/tree/main/cves/2026/113xxx/cve-2026-113351.json", + "https://github.com/libexpat/libexpat", + "https://github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#L1560", + "https://github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#L860-L884", + "https://github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#l1560", + "https://github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#l860-l884", + "https://github.com/libexpat/libexpat/pull/1431", + "https://linux.oracle.com/cve/CVE-2026-113351.html", + "https://linux.oracle.com/errata/ELSA-2026-100681.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-113351", + "https://nvd.nist.gov/vuln/detail/cve-2026-113351", + "https://security-tracker.debian.org/tracker/cve-2026-113351", + "https://ubuntu.com/security/notices/USN-9196-1", + "https://www.cve.org/CVERecord?id=CVE-2026-113351", + "https://www.vulncheck.com/advisories/libexpat-2.7.2-through-2.9.0-denial-of-service-via-xml-parserreset" + ], + "PublishedDate": "2026-10-20T11:17:19.363Z", + "LastModifiedDate": "2026-11-03T21:26:47.25Z" + }, + { + "VulnerabilityID": "CVE-2026-115506", + "PkgID": "libexpat1@2.5.0-1+deb12u5", + "PkgName": "libexpat1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libexpat1@2.5.0-1%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "6bb8ece8e7970b68" + }, + "InstalledVersion": "2.5.0-1+deb12u5", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-115506", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "expat: expat: Denial of Service via delayed entity amplification detection", + "Description": "libexpat through 2.9.0 contains a denial of service vulnerability because billion laughs protection in accountingDiffTolerated() in xmlparse.c detects entity amplification too late. Attackers can supply a moderately sized XML document with a large DTD and nested entity expansions to consume tens of seconds of CPU per parse.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-776" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "julia": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N", + "V3Score": 7.5, + "V40Score": 8.7 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:100679", + "https://access.redhat.com/errata/RHSA-2026:100681", + "https://access.redhat.com/security/cve/CVE-2026-115506", + "https://bugzilla.redhat.com/2556110", + "https://bugzilla.redhat.com/2562538", + "https://bugzilla.redhat.com/2562544", + "https://bugzilla.redhat.com/show_bug.cgi?id=2556110", + "https://bugzilla.redhat.com/show_bug.cgi?id=2559312", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562538", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562544", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-113351", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-115506", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-117610", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118370", + "https://errata.almalinux.org/10/ALSA-2026-100681.html", + "https://errata.rockylinux.org/RLSA-2026:100679", + "https://github.com/hannob/lololol", + "https://github.com/libexpat/libexpat", + "https://github.com/libexpat/libexpat/issues/1160", + "https://github.com/libexpat/libexpat/pull/1433", + "https://linux.oracle.com/cve/CVE-2026-115506.html", + "https://linux.oracle.com/errata/ELSA-2026-102193.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-115506", + "https://ubuntu.com/security/notices/USN-9196-1", + "https://www.cve.org/CVERecord?id=CVE-2026-115506", + "https://www.vulncheck.com/advisories/libexpat-through-2.9.0-denial-of-service-via-billion-laughs-detection-delay" + ], + "PublishedDate": "2026-10-22T20:17:06.62Z", + "LastModifiedDate": "2026-11-02T18:27:06.127Z" + }, + { + "VulnerabilityID": "CVE-2026-117610", + "PkgID": "libexpat1@2.5.0-1+deb12u5", + "PkgName": "libexpat1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libexpat1@2.5.0-1%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "6bb8ece8e7970b68" + }, + "InstalledVersion": "2.5.0-1+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-117610", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "expat: expat: Denial of Service via NULL pointer dereference in external entity parsing", + "Description": "libexpat through 2.9.0 contains a NULL pointer dereference vulnerability in externalEntityInitProcessor2() in lib/xmlparse.c that mishandles the XML_TOK_NONE token from empty input. Attackers who control stream chunking can force an empty non-final first parse on an external entity subparser, causing a later parse to crash the application.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-476" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 2, + "julia": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 2, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N", + "V3Score": 7.5, + "V40Score": 8.2 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 5.9 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:100679", + "https://access.redhat.com/errata/RHSA-2026:100681", + "https://access.redhat.com/security/cve/CVE-2026-117610", + "https://bugzilla.redhat.com/2556110", + "https://bugzilla.redhat.com/2562538", + "https://bugzilla.redhat.com/2562544", + "https://bugzilla.redhat.com/show_bug.cgi?id=2556110", + "https://bugzilla.redhat.com/show_bug.cgi?id=2559312", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562538", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562544", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-113351", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-115506", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-117610", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118370", + "https://errata.almalinux.org/10/ALSA-2026-100681.html", + "https://errata.rockylinux.org/RLSA-2026:100679", + "https://github.com/libexpat/libexpat", + "https://github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#L3468-L3510", + "https://github.com/libexpat/libexpat/commit/7b0d50e4b1d16fafd55876260701e04279a7489d", + "https://github.com/libexpat/libexpat/commit/bfc28346fa3efeb8ca56c17437d24a7344e5feab", + "https://github.com/libexpat/libexpat/commit/cedb704d2cad9d6ef77f8f172104d3e751eccfd2", + "https://github.com/libexpat/libexpat/pull/1444", + "https://linux.oracle.com/cve/CVE-2026-117610.html", + "https://linux.oracle.com/errata/ELSA-2026-102193.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-117610", + "https://ubuntu.com/security/notices/USN-9196-1", + "https://www.cve.org/CVERecord?id=CVE-2026-117610", + "https://www.vulncheck.com/advisories/libexpat-through-2.9.0-null-pointer-dereference-via-external-entity-subparser" + ], + "PublishedDate": "2026-10-28T03:17:12.777Z", + "LastModifiedDate": "2026-11-05T16:17:35.787Z" + }, + { + "VulnerabilityID": "CVE-2026-118370", + "PkgID": "libexpat1@2.5.0-1+deb12u5", + "PkgName": "libexpat1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libexpat1@2.5.0-1%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "6bb8ece8e7970b68" + }, + "InstalledVersion": "2.5.0-1+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-118370", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "expat: expat: Denial of Service via integer overflow during XML attribute parsing", + "Description": "libexpat through 2.9.0 contains a signed integer overflow vulnerability in storeAtts() in lib/xmlparse.c that allows attackers to trigger out-of-bounds writes via oversized attribute counts. Attackers can supply a multi-gigabyte document with a start tag carrying over 2^30 attributes to overflow attIndex and nPrefixes, crashing applications or corrupting heap memory.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 2, + "julia": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 2, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N", + "V3Score": 8.2, + "V40Score": 8.2 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H", + "V3Score": 8.2 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 5.9 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:100679", + "https://access.redhat.com/errata/RHSA-2026:100681", + "https://access.redhat.com/security/cve/CVE-2026-118370", + "https://bugzilla.redhat.com/2556110", + "https://bugzilla.redhat.com/2562538", + "https://bugzilla.redhat.com/2562544", + "https://bugzilla.redhat.com/show_bug.cgi?id=2556110", + "https://bugzilla.redhat.com/show_bug.cgi?id=2559312", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562538", + "https://bugzilla.redhat.com/show_bug.cgi?id=2562544", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-113351", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-115506", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-117610", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118370", + "https://errata.almalinux.org/10/ALSA-2026-100681.html", + "https://errata.rockylinux.org/RLSA-2026:100679", + "https://github.com/libexpat/libexpat", + "https://github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#L4138-L4140", + "https://github.com/libexpat/libexpat/commit/1bac53c4fc460a03cd9860f39501c7979f6750ae", + "https://github.com/libexpat/libexpat/commit/621cb2c78b253ee023a86bc91d6ddb048481c04c", + "https://github.com/libexpat/libexpat/pull/1450", + "https://linux.oracle.com/cve/CVE-2026-118370.html", + "https://linux.oracle.com/errata/ELSA-2026-102193.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-118370", + "https://ubuntu.com/security/notices/USN-9196-1", + "https://www.cve.org/CVERecord?id=CVE-2026-118370", + "https://www.vulncheck.com/advisories/libexpat-through-2.9.0-integer-overflow-in-storeatts-via-attindex-and-nprefixes" + ], + "PublishedDate": "2026-10-28T03:17:13.293Z", + "LastModifiedDate": "2026-11-02T20:17:37.377Z" + }, + { + "VulnerabilityID": "CVE-2026-107364", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-107364", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC DoS based on ASN.1 decoder read overrun", + "Description": "In all released versions of MIT krb5, an unauthenticated attacker can cause a KDC process to perform a large read overrun, likely causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-107364", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-107364.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-107364", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-107364" + ] + }, + { + "VulnerabilityID": "CVE-2026-112315", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112315", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS in RPCSEC_GSS buffer decode failure", + "Description": "The RPCSEC_GSS authentication routines in lib/rpc/authgss_prot.c in MIT Kerberos 5 (aka krb5) 1.4 and later do not free partially decoded buffers on failure, which allows remote attackers to cause a denial of service (memory leak in kadmind) via crafted RPCSEC_GSS messages.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112315", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112315.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112315", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112315" + ], + "PublishedDate": "2026-11-09T19:16:40.077Z", + "LastModifiedDate": "2026-11-24T19:17:45.673Z" + }, + { + "VulnerabilityID": "CVE-2026-112316", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112316", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory leak DoS in xdr_krb5_tl_data() decode failure", + "Description": "xdr_krb5_tl_data() in lib/kadm5/kadm_rpc_xdr.c in MIT Kerberos 5 (aka krb5) does not free partially decoded data on failure, which allows remote authenticated users to cause a denial of service (memory leak in kadmind) via crafted RPC requests that trigger a decode failure.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112316", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112316.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112316", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112316" + ], + "PublishedDate": "2026-11-09T19:16:40.243Z", + "LastModifiedDate": "2026-11-24T19:17:45.967Z" + }, + { + "VulnerabilityID": "CVE-2026-112317", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112317", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB keytab key decryption error path", + "Description": "krb5_ktkdb_get_entry() in lib/kdb/keytab.c in MIT Kerberos 5 (aka krb5) 1.2.8 and later does not free decrypted key material when a post-decryption check fails, which allows remote attackers to cause a denial of service (memory leak in the KDC or kadmind) via requests that repeatedly trigger key decryption failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112317", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112317.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112317", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112317" + ], + "PublishedDate": "2026-11-09T19:16:40.407Z", + "LastModifiedDate": "2026-11-24T19:17:49.187Z" + }, + { + "VulnerabilityID": "CVE-2026-112318", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112318", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated DoS exploiting dereference of null policy name pointers", + "Description": "The policy RPC stubs in kadmin/server/server_stubs.c in MIT Kerberos 5 (aka krb5) 1.5.3 and later do not reject a NULL policy name decoded by xdr_nullstring(), which allows remote authenticated users to cause a denial of service (kadmind crash via NULL pointer dereference) by sending a policy request with an empty policy name that reaches authorization checks or logging code.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-476" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112318", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112318.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112318", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112318" + ], + "PublishedDate": "2026-11-09T19:16:40.56Z", + "LastModifiedDate": "2026-11-24T19:17:49.407Z" + }, + { + "VulnerabilityID": "CVE-2026-112319", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112319", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory exhaustion DoS via unbounded RPC XDR allocation", + "Description": "The GSS-RPC layer in MIT Kerberos 5 (aka krb5) does not enforce size limits on XDR-decoded data, which allows remote authenticated users to cause a denial of service (memory exhaustion or excessive CPU consumption in kadmind) via crafted RPC requests that trigger unbounded memory allocations during XDR decoding.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112319", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112319.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112319", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112319" + ], + "PublishedDate": "2026-11-09T19:16:40.727Z", + "LastModifiedDate": "2026-11-24T19:17:49.59Z" + }, + { + "VulnerabilityID": "CVE-2026-112320", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112320", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via GSS-RPC auth flavor switching", + "Description": "The GSS-RPC transport layer in MIT Kerberos 5 (aka krb5) 1.4 and later does not release the previous authentication context when a client switches from an RPCSEC_GSS or AUTH_GSSAPI flavor to a non-GSS flavor on the same TCP connection. This allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by repeatedly establishing and abandoning GSS authentication contexts.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112320", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112320.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112320", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112320" + ], + "PublishedDate": "2026-11-09T19:16:40.887Z", + "LastModifiedDate": "2026-11-24T19:17:49.783Z" + }, + { + "VulnerabilityID": "CVE-2026-112321", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112321", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via AUTH_GSSAPI_INIT error paths", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) does not free decoded arguments on certain error paths, which allows remote attackers to cause a denial of service (memory exhaustion in kadmind) via crafted AUTH_GSSAPI_INIT requests that trigger authentication failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "github.com/krb5/krb5/commit/89ea06778fe893a8fdad483f7716fe8309521603", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112321", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112321.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112321", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112321", + "security-tracker.debian.org/tracker/cve-2026-112321" + ], + "PublishedDate": "2026-11-09T19:16:41.05Z", + "LastModifiedDate": "2026-11-24T19:17:49.97Z" + }, + { + "VulnerabilityID": "CVE-2026-112322", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112322", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated CPU DoS via AUTH_GSSAPI client states cleanup", + "Description": "clean_client() in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) restarts its scan from the head of the client list after each removal, resulting in quadratic CPU cost. Remote attackers can cause a denial of service (CPU consumption in kadmind) by accumulating a large number of AUTH_GSSAPI client entries.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478445", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112322", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112322.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112322", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112322", + "security-tracker.debian.org/tracker/cve-2026-112322" + ], + "PublishedDate": "2026-11-09T19:16:41.207Z", + "LastModifiedDate": "2026-11-24T19:17:50.173Z" + }, + { + "VulnerabilityID": "CVE-2026-112323", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112323", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory exhaustion via failed AUTH_GSSAPI_INIT requests", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) 1.5.2 and later allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by sending repeated failed AUTH_GSSAPI_INIT requests. Each failed request allocates client state that is only freed after a 15-minute expiration timeout, allowing an attacker to accumulate memory faster than it is reclaimed.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478440", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112323", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112323.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112323", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112323", + "security-tracker.debian.org/tracker/cve-2026-112323" + ], + "PublishedDate": "2026-11-09T19:16:41.36Z", + "LastModifiedDate": "2026-11-24T19:17:50.4Z" + }, + { + "VulnerabilityID": "CVE-2026-118380", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-118380", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: kadmind: request alteration and protected information disclosure", + "Description": "In MIT krb5 release 1.4 and later, an active network attacker can alter the arguments sent by a legitimate client to RPC services protected by RPCSEC_GSS, or cause return values to be sent in plain text.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 7.4 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-118380", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-118380.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-118380", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-118380" + ] + }, + { + "VulnerabilityID": "CVE-2026-119079", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119079", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic ASN.1 SEQUENCE OF decoding", + "Description": "decode_sequence_of() in lib/krb5/asn.1/asn1_encode.c in MIT Kerberos 5 (aka krb5) 1.11 and later grows the decoded element array one entry at a time, which allows remote attackers to cause a denial of service (CPU consumption in the KDC) by sending an unauthenticated AS-REQ or TGS-REQ with a large number of elements in a SEQUENCE OF field over TCP.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-408" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2479231", + "github.com/krb5/krb5/commit/782e5ac4fb1496a79de0b87e1fc485f897e97d6d", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-119079", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-119079.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119079", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-119079", + "security-tracker.debian.org/tracker/cve-2026-119079" + ], + "PublishedDate": "2026-11-09T19:16:43.023Z", + "LastModifiedDate": "2026-11-24T19:17:51.29Z" + }, + { + "VulnerabilityID": "CVE-2026-71199", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71199", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Alteration of authentication indicators in CAMMAC container", + "Description": "In MIT krb5 release 1.14 and later (since authentication indicator support was added), an authenticated attacker can bypass authentication indicator requirements using an unkeyed checksum in the CAMMAC authdata container.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 8.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71199", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71199.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71199", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71199" + ] + }, + { + "VulnerabilityID": "CVE-2026-71200", + "PkgID": "libgssapi-krb5-2@1.20.1-2+deb12u5", + "PkgName": "libgssapi-krb5-2", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libgssapi-krb5-2@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "1dd193bfd25266c6" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71200", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC NULL pointer dereference KDC DoS via crafted PKINIT pre-auth request", + "Description": "If a KDC is configured to allow PKINIT authentication, an unauthenticated attacker can trigger a null pointer dereference, causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71200", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71200.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71200", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71200" + ] + }, + { + "VulnerabilityID": "CVE-2026-107364", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-107364", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC DoS based on ASN.1 decoder read overrun", + "Description": "In all released versions of MIT krb5, an unauthenticated attacker can cause a KDC process to perform a large read overrun, likely causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-107364", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-107364.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-107364", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-107364" + ] + }, + { + "VulnerabilityID": "CVE-2026-112315", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112315", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS in RPCSEC_GSS buffer decode failure", + "Description": "The RPCSEC_GSS authentication routines in lib/rpc/authgss_prot.c in MIT Kerberos 5 (aka krb5) 1.4 and later do not free partially decoded buffers on failure, which allows remote attackers to cause a denial of service (memory leak in kadmind) via crafted RPCSEC_GSS messages.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112315", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112315.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112315", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112315" + ], + "PublishedDate": "2026-11-09T19:16:40.077Z", + "LastModifiedDate": "2026-11-24T19:17:45.673Z" + }, + { + "VulnerabilityID": "CVE-2026-112316", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112316", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory leak DoS in xdr_krb5_tl_data() decode failure", + "Description": "xdr_krb5_tl_data() in lib/kadm5/kadm_rpc_xdr.c in MIT Kerberos 5 (aka krb5) does not free partially decoded data on failure, which allows remote authenticated users to cause a denial of service (memory leak in kadmind) via crafted RPC requests that trigger a decode failure.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112316", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112316.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112316", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112316" + ], + "PublishedDate": "2026-11-09T19:16:40.243Z", + "LastModifiedDate": "2026-11-24T19:17:45.967Z" + }, + { + "VulnerabilityID": "CVE-2026-112317", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112317", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB keytab key decryption error path", + "Description": "krb5_ktkdb_get_entry() in lib/kdb/keytab.c in MIT Kerberos 5 (aka krb5) 1.2.8 and later does not free decrypted key material when a post-decryption check fails, which allows remote attackers to cause a denial of service (memory leak in the KDC or kadmind) via requests that repeatedly trigger key decryption failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112317", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112317.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112317", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112317" + ], + "PublishedDate": "2026-11-09T19:16:40.407Z", + "LastModifiedDate": "2026-11-24T19:17:49.187Z" + }, + { + "VulnerabilityID": "CVE-2026-112318", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112318", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated DoS exploiting dereference of null policy name pointers", + "Description": "The policy RPC stubs in kadmin/server/server_stubs.c in MIT Kerberos 5 (aka krb5) 1.5.3 and later do not reject a NULL policy name decoded by xdr_nullstring(), which allows remote authenticated users to cause a denial of service (kadmind crash via NULL pointer dereference) by sending a policy request with an empty policy name that reaches authorization checks or logging code.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-476" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112318", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112318.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112318", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112318" + ], + "PublishedDate": "2026-11-09T19:16:40.56Z", + "LastModifiedDate": "2026-11-24T19:17:49.407Z" + }, + { + "VulnerabilityID": "CVE-2026-112319", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112319", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory exhaustion DoS via unbounded RPC XDR allocation", + "Description": "The GSS-RPC layer in MIT Kerberos 5 (aka krb5) does not enforce size limits on XDR-decoded data, which allows remote authenticated users to cause a denial of service (memory exhaustion or excessive CPU consumption in kadmind) via crafted RPC requests that trigger unbounded memory allocations during XDR decoding.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112319", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112319.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112319", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112319" + ], + "PublishedDate": "2026-11-09T19:16:40.727Z", + "LastModifiedDate": "2026-11-24T19:17:49.59Z" + }, + { + "VulnerabilityID": "CVE-2026-112320", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112320", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via GSS-RPC auth flavor switching", + "Description": "The GSS-RPC transport layer in MIT Kerberos 5 (aka krb5) 1.4 and later does not release the previous authentication context when a client switches from an RPCSEC_GSS or AUTH_GSSAPI flavor to a non-GSS flavor on the same TCP connection. This allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by repeatedly establishing and abandoning GSS authentication contexts.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112320", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112320.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112320", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112320" + ], + "PublishedDate": "2026-11-09T19:16:40.887Z", + "LastModifiedDate": "2026-11-24T19:17:49.783Z" + }, + { + "VulnerabilityID": "CVE-2026-112321", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112321", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via AUTH_GSSAPI_INIT error paths", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) does not free decoded arguments on certain error paths, which allows remote attackers to cause a denial of service (memory exhaustion in kadmind) via crafted AUTH_GSSAPI_INIT requests that trigger authentication failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "github.com/krb5/krb5/commit/89ea06778fe893a8fdad483f7716fe8309521603", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112321", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112321.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112321", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112321", + "security-tracker.debian.org/tracker/cve-2026-112321" + ], + "PublishedDate": "2026-11-09T19:16:41.05Z", + "LastModifiedDate": "2026-11-24T19:17:49.97Z" + }, + { + "VulnerabilityID": "CVE-2026-112322", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112322", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated CPU DoS via AUTH_GSSAPI client states cleanup", + "Description": "clean_client() in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) restarts its scan from the head of the client list after each removal, resulting in quadratic CPU cost. Remote attackers can cause a denial of service (CPU consumption in kadmind) by accumulating a large number of AUTH_GSSAPI client entries.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478445", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112322", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112322.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112322", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112322", + "security-tracker.debian.org/tracker/cve-2026-112322" + ], + "PublishedDate": "2026-11-09T19:16:41.207Z", + "LastModifiedDate": "2026-11-24T19:17:50.173Z" + }, + { + "VulnerabilityID": "CVE-2026-112323", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112323", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory exhaustion via failed AUTH_GSSAPI_INIT requests", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) 1.5.2 and later allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by sending repeated failed AUTH_GSSAPI_INIT requests. Each failed request allocates client state that is only freed after a 15-minute expiration timeout, allowing an attacker to accumulate memory faster than it is reclaimed.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478440", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112323", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112323.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112323", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112323", + "security-tracker.debian.org/tracker/cve-2026-112323" + ], + "PublishedDate": "2026-11-09T19:16:41.36Z", + "LastModifiedDate": "2026-11-24T19:17:50.4Z" + }, + { + "VulnerabilityID": "CVE-2026-118380", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-118380", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: kadmind: request alteration and protected information disclosure", + "Description": "In MIT krb5 release 1.4 and later, an active network attacker can alter the arguments sent by a legitimate client to RPC services protected by RPCSEC_GSS, or cause return values to be sent in plain text.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 7.4 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-118380", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-118380.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-118380", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-118380" + ] + }, + { + "VulnerabilityID": "CVE-2026-119079", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119079", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic ASN.1 SEQUENCE OF decoding", + "Description": "decode_sequence_of() in lib/krb5/asn.1/asn1_encode.c in MIT Kerberos 5 (aka krb5) 1.11 and later grows the decoded element array one entry at a time, which allows remote attackers to cause a denial of service (CPU consumption in the KDC) by sending an unauthenticated AS-REQ or TGS-REQ with a large number of elements in a SEQUENCE OF field over TCP.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-408" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2479231", + "github.com/krb5/krb5/commit/782e5ac4fb1496a79de0b87e1fc485f897e97d6d", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-119079", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-119079.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119079", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-119079", + "security-tracker.debian.org/tracker/cve-2026-119079" + ], + "PublishedDate": "2026-11-09T19:16:43.023Z", + "LastModifiedDate": "2026-11-24T19:17:51.29Z" + }, + { + "VulnerabilityID": "CVE-2026-71199", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71199", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Alteration of authentication indicators in CAMMAC container", + "Description": "In MIT krb5 release 1.14 and later (since authentication indicator support was added), an authenticated attacker can bypass authentication indicator requirements using an unkeyed checksum in the CAMMAC authdata container.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 8.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71199", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71199.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71199", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71199" + ] + }, + { + "VulnerabilityID": "CVE-2026-71200", + "PkgID": "libk5crypto3@1.20.1-2+deb12u5", + "PkgName": "libk5crypto3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libk5crypto3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "e8ebd0959004ff50" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71200", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC NULL pointer dereference KDC DoS via crafted PKINIT pre-auth request", + "Description": "If a KDC is configured to allow PKINIT authentication, an unauthenticated attacker can trigger a null pointer dereference, causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71200", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71200.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71200", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71200" + ] + }, + { + "VulnerabilityID": "CVE-2026-107364", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-107364", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC DoS based on ASN.1 decoder read overrun", + "Description": "In all released versions of MIT krb5, an unauthenticated attacker can cause a KDC process to perform a large read overrun, likely causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-107364", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-107364.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-107364", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-107364" + ] + }, + { + "VulnerabilityID": "CVE-2026-112315", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112315", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS in RPCSEC_GSS buffer decode failure", + "Description": "The RPCSEC_GSS authentication routines in lib/rpc/authgss_prot.c in MIT Kerberos 5 (aka krb5) 1.4 and later do not free partially decoded buffers on failure, which allows remote attackers to cause a denial of service (memory leak in kadmind) via crafted RPCSEC_GSS messages.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112315", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112315.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112315", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112315" + ], + "PublishedDate": "2026-11-09T19:16:40.077Z", + "LastModifiedDate": "2026-11-24T19:17:45.673Z" + }, + { + "VulnerabilityID": "CVE-2026-112316", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112316", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory leak DoS in xdr_krb5_tl_data() decode failure", + "Description": "xdr_krb5_tl_data() in lib/kadm5/kadm_rpc_xdr.c in MIT Kerberos 5 (aka krb5) does not free partially decoded data on failure, which allows remote authenticated users to cause a denial of service (memory leak in kadmind) via crafted RPC requests that trigger a decode failure.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112316", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112316.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112316", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112316" + ], + "PublishedDate": "2026-11-09T19:16:40.243Z", + "LastModifiedDate": "2026-11-24T19:17:45.967Z" + }, + { + "VulnerabilityID": "CVE-2026-112317", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112317", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB keytab key decryption error path", + "Description": "krb5_ktkdb_get_entry() in lib/kdb/keytab.c in MIT Kerberos 5 (aka krb5) 1.2.8 and later does not free decrypted key material when a post-decryption check fails, which allows remote attackers to cause a denial of service (memory leak in the KDC or kadmind) via requests that repeatedly trigger key decryption failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112317", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112317.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112317", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112317" + ], + "PublishedDate": "2026-11-09T19:16:40.407Z", + "LastModifiedDate": "2026-11-24T19:17:49.187Z" + }, + { + "VulnerabilityID": "CVE-2026-112318", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112318", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated DoS exploiting dereference of null policy name pointers", + "Description": "The policy RPC stubs in kadmin/server/server_stubs.c in MIT Kerberos 5 (aka krb5) 1.5.3 and later do not reject a NULL policy name decoded by xdr_nullstring(), which allows remote authenticated users to cause a denial of service (kadmind crash via NULL pointer dereference) by sending a policy request with an empty policy name that reaches authorization checks or logging code.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-476" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112318", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112318.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112318", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112318" + ], + "PublishedDate": "2026-11-09T19:16:40.56Z", + "LastModifiedDate": "2026-11-24T19:17:49.407Z" + }, + { + "VulnerabilityID": "CVE-2026-112319", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112319", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory exhaustion DoS via unbounded RPC XDR allocation", + "Description": "The GSS-RPC layer in MIT Kerberos 5 (aka krb5) does not enforce size limits on XDR-decoded data, which allows remote authenticated users to cause a denial of service (memory exhaustion or excessive CPU consumption in kadmind) via crafted RPC requests that trigger unbounded memory allocations during XDR decoding.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112319", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112319.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112319", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112319" + ], + "PublishedDate": "2026-11-09T19:16:40.727Z", + "LastModifiedDate": "2026-11-24T19:17:49.59Z" + }, + { + "VulnerabilityID": "CVE-2026-112320", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112320", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via GSS-RPC auth flavor switching", + "Description": "The GSS-RPC transport layer in MIT Kerberos 5 (aka krb5) 1.4 and later does not release the previous authentication context when a client switches from an RPCSEC_GSS or AUTH_GSSAPI flavor to a non-GSS flavor on the same TCP connection. This allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by repeatedly establishing and abandoning GSS authentication contexts.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112320", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112320.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112320", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112320" + ], + "PublishedDate": "2026-11-09T19:16:40.887Z", + "LastModifiedDate": "2026-11-24T19:17:49.783Z" + }, + { + "VulnerabilityID": "CVE-2026-112321", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112321", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via AUTH_GSSAPI_INIT error paths", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) does not free decoded arguments on certain error paths, which allows remote attackers to cause a denial of service (memory exhaustion in kadmind) via crafted AUTH_GSSAPI_INIT requests that trigger authentication failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "github.com/krb5/krb5/commit/89ea06778fe893a8fdad483f7716fe8309521603", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112321", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112321.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112321", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112321", + "security-tracker.debian.org/tracker/cve-2026-112321" + ], + "PublishedDate": "2026-11-09T19:16:41.05Z", + "LastModifiedDate": "2026-11-24T19:17:49.97Z" + }, + { + "VulnerabilityID": "CVE-2026-112322", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112322", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated CPU DoS via AUTH_GSSAPI client states cleanup", + "Description": "clean_client() in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) restarts its scan from the head of the client list after each removal, resulting in quadratic CPU cost. Remote attackers can cause a denial of service (CPU consumption in kadmind) by accumulating a large number of AUTH_GSSAPI client entries.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478445", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112322", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112322.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112322", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112322", + "security-tracker.debian.org/tracker/cve-2026-112322" + ], + "PublishedDate": "2026-11-09T19:16:41.207Z", + "LastModifiedDate": "2026-11-24T19:17:50.173Z" + }, + { + "VulnerabilityID": "CVE-2026-112323", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112323", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory exhaustion via failed AUTH_GSSAPI_INIT requests", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) 1.5.2 and later allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by sending repeated failed AUTH_GSSAPI_INIT requests. Each failed request allocates client state that is only freed after a 15-minute expiration timeout, allowing an attacker to accumulate memory faster than it is reclaimed.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478440", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112323", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112323.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112323", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112323", + "security-tracker.debian.org/tracker/cve-2026-112323" + ], + "PublishedDate": "2026-11-09T19:16:41.36Z", + "LastModifiedDate": "2026-11-24T19:17:50.4Z" + }, + { + "VulnerabilityID": "CVE-2026-118380", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-118380", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: kadmind: request alteration and protected information disclosure", + "Description": "In MIT krb5 release 1.4 and later, an active network attacker can alter the arguments sent by a legitimate client to RPC services protected by RPCSEC_GSS, or cause return values to be sent in plain text.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 7.4 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-118380", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-118380.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-118380", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-118380" + ] + }, + { + "VulnerabilityID": "CVE-2026-119079", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119079", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic ASN.1 SEQUENCE OF decoding", + "Description": "decode_sequence_of() in lib/krb5/asn.1/asn1_encode.c in MIT Kerberos 5 (aka krb5) 1.11 and later grows the decoded element array one entry at a time, which allows remote attackers to cause a denial of service (CPU consumption in the KDC) by sending an unauthenticated AS-REQ or TGS-REQ with a large number of elements in a SEQUENCE OF field over TCP.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-408" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2479231", + "github.com/krb5/krb5/commit/782e5ac4fb1496a79de0b87e1fc485f897e97d6d", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-119079", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-119079.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119079", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-119079", + "security-tracker.debian.org/tracker/cve-2026-119079" + ], + "PublishedDate": "2026-11-09T19:16:43.023Z", + "LastModifiedDate": "2026-11-24T19:17:51.29Z" + }, + { + "VulnerabilityID": "CVE-2026-71199", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71199", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Alteration of authentication indicators in CAMMAC container", + "Description": "In MIT krb5 release 1.14 and later (since authentication indicator support was added), an authenticated attacker can bypass authentication indicator requirements using an unkeyed checksum in the CAMMAC authdata container.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 8.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71199", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71199.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71199", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71199" + ] + }, + { + "VulnerabilityID": "CVE-2026-71200", + "PkgID": "libkrb5-3@1.20.1-2+deb12u5", + "PkgName": "libkrb5-3", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5-3@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "4b91924a4dc9c42b" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71200", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC NULL pointer dereference KDC DoS via crafted PKINIT pre-auth request", + "Description": "If a KDC is configured to allow PKINIT authentication, an unauthenticated attacker can trigger a null pointer dereference, causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71200", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71200.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71200", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71200" + ] + }, + { + "VulnerabilityID": "CVE-2026-107364", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-107364", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC DoS based on ASN.1 decoder read overrun", + "Description": "In all released versions of MIT krb5, an unauthenticated attacker can cause a KDC process to perform a large read overrun, likely causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-107364", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-107364.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-107364", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-107364" + ] + }, + { + "VulnerabilityID": "CVE-2026-112315", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112315", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS in RPCSEC_GSS buffer decode failure", + "Description": "The RPCSEC_GSS authentication routines in lib/rpc/authgss_prot.c in MIT Kerberos 5 (aka krb5) 1.4 and later do not free partially decoded buffers on failure, which allows remote attackers to cause a denial of service (memory leak in kadmind) via crafted RPCSEC_GSS messages.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112315", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112315.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112315", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112315" + ], + "PublishedDate": "2026-11-09T19:16:40.077Z", + "LastModifiedDate": "2026-11-24T19:17:45.673Z" + }, + { + "VulnerabilityID": "CVE-2026-112316", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112316", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory leak DoS in xdr_krb5_tl_data() decode failure", + "Description": "xdr_krb5_tl_data() in lib/kadm5/kadm_rpc_xdr.c in MIT Kerberos 5 (aka krb5) does not free partially decoded data on failure, which allows remote authenticated users to cause a denial of service (memory leak in kadmind) via crafted RPC requests that trigger a decode failure.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112316", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112316.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112316", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112316" + ], + "PublishedDate": "2026-11-09T19:16:40.243Z", + "LastModifiedDate": "2026-11-24T19:17:45.967Z" + }, + { + "VulnerabilityID": "CVE-2026-112317", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112317", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated memory leak DoS in KDB keytab key decryption error path", + "Description": "krb5_ktkdb_get_entry() in lib/kdb/keytab.c in MIT Kerberos 5 (aka krb5) 1.2.8 and later does not free decrypted key material when a post-decryption check fails, which allows remote attackers to cause a denial of service (memory leak in the KDC or kadmind) via requests that repeatedly trigger key decryption failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112317", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112317.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112317", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112317" + ], + "PublishedDate": "2026-11-09T19:16:40.407Z", + "LastModifiedDate": "2026-11-24T19:17:49.187Z" + }, + { + "VulnerabilityID": "CVE-2026-112318", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112318", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated DoS exploiting dereference of null policy name pointers", + "Description": "The policy RPC stubs in kadmin/server/server_stubs.c in MIT Kerberos 5 (aka krb5) 1.5.3 and later do not reject a NULL policy name decoded by xdr_nullstring(), which allows remote authenticated users to cause a denial of service (kadmind crash via NULL pointer dereference) by sending a policy request with an empty policy name that reaches authorization checks or logging code.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-476" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112318", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112318.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112318", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112318" + ], + "PublishedDate": "2026-11-09T19:16:40.56Z", + "LastModifiedDate": "2026-11-24T19:17:49.407Z" + }, + { + "VulnerabilityID": "CVE-2026-112319", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112319", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind authenticated memory exhaustion DoS via unbounded RPC XDR allocation", + "Description": "The GSS-RPC layer in MIT Kerberos 5 (aka krb5) does not enforce size limits on XDR-decoded data, which allows remote authenticated users to cause a denial of service (memory exhaustion or excessive CPU consumption in kadmind) via crafted RPC requests that trigger unbounded memory allocations during XDR decoding.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 6.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112319", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112319.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112319", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112319" + ], + "PublishedDate": "2026-11-09T19:16:40.727Z", + "LastModifiedDate": "2026-11-24T19:17:49.59Z" + }, + { + "VulnerabilityID": "CVE-2026-112320", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112320", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via GSS-RPC auth flavor switching", + "Description": "The GSS-RPC transport layer in MIT Kerberos 5 (aka krb5) 1.4 and later does not release the previous authentication context when a client switches from an RPCSEC_GSS or AUTH_GSSAPI flavor to a non-GSS flavor on the same TCP connection. This allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by repeatedly establishing and abandoning GSS authentication contexts.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112320", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112320.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112320", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112320" + ], + "PublishedDate": "2026-11-09T19:16:40.887Z", + "LastModifiedDate": "2026-11-24T19:17:49.783Z" + }, + { + "VulnerabilityID": "CVE-2026-112321", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112321", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory leak DoS via AUTH_GSSAPI_INIT error paths", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) does not free decoded arguments on certain error paths, which allows remote attackers to cause a denial of service (memory exhaustion in kadmind) via crafted AUTH_GSSAPI_INIT requests that trigger authentication failures.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "github.com/krb5/krb5/commit/89ea06778fe893a8fdad483f7716fe8309521603", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112321", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112321.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112321", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112321", + "security-tracker.debian.org/tracker/cve-2026-112321" + ], + "PublishedDate": "2026-11-09T19:16:41.05Z", + "LastModifiedDate": "2026-11-24T19:17:49.97Z" + }, + { + "VulnerabilityID": "CVE-2026-112322", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112322", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated CPU DoS via AUTH_GSSAPI client states cleanup", + "Description": "clean_client() in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) restarts its scan from the head of the client list after each removal, resulting in quadratic CPU cost. Remote attackers can cause a denial of service (CPU consumption in kadmind) by accumulating a large number of AUTH_GSSAPI client entries.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478445", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112322", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112322.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112322", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112322", + "security-tracker.debian.org/tracker/cve-2026-112322" + ], + "PublishedDate": "2026-11-09T19:16:41.207Z", + "LastModifiedDate": "2026-11-24T19:17:50.173Z" + }, + { + "VulnerabilityID": "CVE-2026-112323", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-112323", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 kadmind unauthenticated memory exhaustion via failed AUTH_GSSAPI_INIT requests", + "Description": "The AUTH_GSSAPI handler in lib/rpc/svc_auth_gssapi.c in MIT Kerberos 5 (aka krb5) 1.5.2 and later allows remote attackers to cause a denial of service (memory exhaustion in kadmind) by sending repeated failed AUTH_GSSAPI_INIT requests. Each failed request allocates client state that is only freed after a 15-minute expiration timeout, allowing an attacker to accumulate memory faster than it is reclaimed.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-772" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2478440", + "github.com/krb5/krb5/commit/8aab893c6eb17125e1518f9926bc3593cf19303c", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-112323", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-112323.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-112323", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-112323", + "security-tracker.debian.org/tracker/cve-2026-112323" + ], + "PublishedDate": "2026-11-09T19:16:41.36Z", + "LastModifiedDate": "2026-11-24T19:17:50.4Z" + }, + { + "VulnerabilityID": "CVE-2026-118380", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-118380", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: kadmind: request alteration and protected information disclosure", + "Description": "In MIT krb5 release 1.4 and later, an active network attacker can alter the arguments sent by a legitimate client to RPC services protected by RPCSEC_GSS, or cause return values to be sent in plain text.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 7.4 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-118380", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-118380.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-118380", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-118380" + ] + }, + { + "VulnerabilityID": "CVE-2026-119079", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119079", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: MIT krb5 KDC unauthenticated CPU DoS via quadratic ASN.1 SEQUENCE OF decoding", + "Description": "decode_sequence_of() in lib/krb5/asn.1/asn1_encode.c in MIT Kerberos 5 (aka krb5) 1.11 and later grows the decoded element array one entry at a time, which allows remote attackers to cause a denial of service (CPU consumption in the KDC) by sending an unauthenticated AS-REQ or TGS-REQ with a large number of elements in a SEQUENCE OF field over TCP.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-408" + ], + "VendorSeverity": { + "alma": 3, + "azure": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "access.redhat.com/downloads/content/package-browser", + "bugzilla.redhat.com/show_bug.cgi?id=2479231", + "github.com/krb5/krb5/commit/782e5ac4fb1496a79de0b87e1fc485f897e97d6d", + "https://access.redhat.com/errata/RHSA-2026:102947", + "https://access.redhat.com/errata/RHSA-2026:97811", + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99625", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/errata/RHSA-2026:99716", + "https://access.redhat.com/security/cve/CVE-2026-119079", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-119079.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119079", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-119079", + "security-tracker.debian.org/tracker/cve-2026-119079" + ], + "PublishedDate": "2026-11-09T19:16:43.023Z", + "LastModifiedDate": "2026-11-24T19:17:51.29Z" + }, + { + "VulnerabilityID": "CVE-2026-71199", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71199", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Alteration of authentication indicators in CAMMAC container", + "Description": "In MIT krb5 release 1.14 and later (since authentication indicator support was added), an authenticated attacker can bypass authentication indicator requirements using an unkeyed checksum in the CAMMAC authdata container.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 8.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71199", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71199.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71199", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71199" + ] + }, + { + "VulnerabilityID": "CVE-2026-71200", + "PkgID": "libkrb5support0@1.20.1-2+deb12u5", + "PkgName": "libkrb5support0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libkrb5support0@1.20.1-2%2Bdeb12u5?arch=amd64\u0026distro=debian-12.15", + "UID": "7c9dcce1cb4022dc" + }, + "InstalledVersion": "1.20.1-2+deb12u5", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-71200", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "krb5: Unauthenticated KDC NULL pointer dereference KDC DoS via crafted PKINIT pre-auth request", + "Description": "If a KDC is configured to allow PKINIT authentication, an unauthenticated attacker can trigger a null pointer dereference, causing the process to terminate.", + "Severity": "HIGH", + "VendorSeverity": { + "alma": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:99624", + "https://access.redhat.com/errata/RHSA-2026:99715", + "https://access.redhat.com/security/cve/CVE-2026-71200", + "https://bugzilla.redhat.com/2478440", + "https://bugzilla.redhat.com/2478445", + "https://bugzilla.redhat.com/2478446", + "https://bugzilla.redhat.com/2478447", + "https://bugzilla.redhat.com/2478448", + "https://bugzilla.redhat.com/2478449", + "https://bugzilla.redhat.com/2478672", + "https://bugzilla.redhat.com/2478684", + "https://bugzilla.redhat.com/2478792", + "https://bugzilla.redhat.com/2479209", + "https://bugzilla.redhat.com/2479231", + "https://bugzilla.redhat.com/2479331", + "https://bugzilla.redhat.com/2479394", + "https://bugzilla.redhat.com/2479403", + "https://bugzilla.redhat.com/2548262", + "https://bugzilla.redhat.com/2548269", + "https://bugzilla.redhat.com/2563453", + "https://bugzilla.redhat.com/2563461", + "https://bugzilla.redhat.com/2569161", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478440", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478445", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478446", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478447", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478448", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478449", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478672", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2478792", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479209", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479231", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479331", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479394", + "https://bugzilla.redhat.com/show_bug.cgi?id=2479403", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548262", + "https://bugzilla.redhat.com/show_bug.cgi?id=2548269", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563453", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563461", + "https://bugzilla.redhat.com/show_bug.cgi?id=2569161", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107364", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107708", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107778", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107884", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-111423", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112314", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112315", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112316", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112317", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112318", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112319", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112320", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112321", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112322", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-112323", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118380", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119079", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71199", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-71200", + "https://errata.almalinux.org/10/ALSA-2026-99624.html", + "https://errata.rockylinux.org/RLSA-2026:99715", + "https://linux.oracle.com/cve/CVE-2026-71200.html", + "https://linux.oracle.com/errata/ELSA-2026-99715.html", + "https://mailman.mit.edu/pipermail/kerberos-announce/2026q4/000212.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-71200", + "https://ubuntu.com/security/notices/USN-9202-1", + "https://www.cve.org/CVERecord?id=CVE-2026-71200" + ] + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "libmount1@2.38.1-5+deb12u3", + "PkgName": "libmount1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libmount1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "b2c4a5b6aeac4f03" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "libmount1@2.38.1-5+deb12u3", + "PkgName": "libmount1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libmount1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "b2c4a5b6aeac4f03" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "libmount1@2.38.1-5+deb12u3", + "PkgName": "libmount1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libmount1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "b2c4a5b6aeac4f03" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2025-69720", + "PkgID": "libncursesw6@6.4-4", + "PkgName": "libncursesw6", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libncursesw6@6.4-4?arch=amd64\u0026distro=debian-12.15", + "UID": "29b2bfe5f852d64f" + }, + "InstalledVersion": "6.4-4", + "Status": "affected", + "Layer": { + "Digest": "sha256:d534b3df1e9ee48785a58a1e8f3ad3105eafe2b0ab25b3d1b958fdfcfb2aa001", + "DiffID": "sha256:cadfff4b36cfd18d3a844aad4bc14f304c6baad6ad1f52cec0a99ee167915833" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-69720", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "ncurses: ncurses: Buffer overflow vulnerability may lead to arbitrary code execution.", + "Description": "The infocmp command-line tool in ncurses before 6.5-20251213 has a stack-based buffer overflow in analyze_string in progs/infocmp.c.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-121", + "CWE-120" + ], + "VendorSeverity": { + "alma": 2, + "azure": 4, + "cbl-mariner": 4, + "julia": 3, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 2, + "rocky": 2, + "ubuntu": 1 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:5913", + "https://access.redhat.com/security/cve/CVE-2025-69720", + "https://bugzilla.redhat.com/2449037", + "https://bugzilla.redhat.com/show_bug.cgi?id=2449037", + "https://cert-portal.siemens.com/productcert/html/ssa-253495.html", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-69720", + "https://errata.almalinux.org/10/ALSA-2026-5913.html", + "https://errata.rockylinux.org/RLSA-2026:5913", + "https://github.com/Cao-Wuhui/CVE-2025-69720", + "https://github.com/advisories/GHSA-9952-mrqj-h4jh", + "https://invisible-island.net/archives/ncurses/6.5", + "https://invisible-island.net/archives/ncurses/6.5/", + "https://invisible-island.net/ncurses", + "https://invisible-island.net/ncurses/", + "https://linux.oracle.com/cve/CVE-2025-69720.html", + "https://linux.oracle.com/errata/ELSA-2026-5913.html", + "https://marc.info/?l=ncurses-bug\u0026m=176539968328570\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176540731801330\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176545557728083\u0026w=2", + "https://nvd.nist.gov/vuln/detail/CVE-2025-69720", + "https://ubuntu.com/security/notices/USN-8503-1", + "https://www.cve.org/CVERecord?id=CVE-2025-69720" + ], + "PublishedDate": "2026-03-19T15:16:21.293Z", + "LastModifiedDate": "2026-06-17T10:00:50.423Z" + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "libsmartcols1@2.38.1-5+deb12u3", + "PkgName": "libsmartcols1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsmartcols1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "92101971da432fa" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "libsmartcols1@2.38.1-5+deb12u3", + "PkgName": "libsmartcols1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsmartcols1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "92101971da432fa" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "libsmartcols1@2.38.1-5+deb12u3", + "PkgName": "libsmartcols1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsmartcols1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "92101971da432fa" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2025-7458", + "PkgID": "libsqlite3-0@3.40.1-2+deb12u2", + "PkgName": "libsqlite3-0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsqlite3-0@3.40.1-2%2Bdeb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "1d1eb50a9122e00d" + }, + "InstalledVersion": "3.40.1-2+deb12u2", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-7458", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "sqlite: SQLite integer overflow", + "Description": "An integer overflow in the sqlite3KeyInfoFromExprList function in SQLite versions 3.39.2 through 3.41.1 allows an attacker with the ability to execute arbitrary SQL statements to cause a denial of service or disclose sensitive information from process memory via a crafted SELECT statement with a large number of expressions in the ORDER BY clause.", + "Severity": "CRITICAL", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "bitnami": 4, + "cbl-mariner": 2, + "nvd": 4, + "redhat": 2 + }, + "CVSS": { + "bitnami": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H", + "V3Score": 9.1 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H", + "V3Score": 9.1 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:L", + "V3Score": 6.1 + } + }, + "References": [ + "https://access.redhat.com/security/cve/CVE-2025-7458", + "https://nvd.nist.gov/vuln/detail/CVE-2025-7458", + "https://sqlite.org/forum/forumpost/16ce2bb7a639e29b", + "https://sqlite.org/src/info/12ad822d9b827777", + "https://www.cve.org/CVERecord?id=CVE-2025-7458" + ], + "PublishedDate": "2025-07-29T13:15:28.953Z", + "LastModifiedDate": "2026-06-17T10:04:59.89Z" + }, + { + "VulnerabilityID": "CVE-2026-11822", + "PkgID": "libsqlite3-0@3.40.1-2+deb12u2", + "PkgName": "libsqlite3-0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsqlite3-0@3.40.1-2%2Bdeb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "1d1eb50a9122e00d" + }, + "InstalledVersion": "3.40.1-2+deb12u2", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-11822", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "sqlite: SQLite: Arbitrary code execution via crafted FTS5 full-text search data", + "Description": "SQLite before 3.53.2 contains an out-of-bounds read vulnerability in the FTS5 full-text search extension that allows attackers to crash the process by supplying a crafted database with a malformed FTS5 leaf page. Attackers can set an oversized term length in the leaf page so that fts5LeafSeek() reads past the end of the page buffer while comparing terms during an FTS5 MATCH query, in applications compiled with SQLITE_ENABLE_FTS5.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-125" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "bitnami": 2, + "oracle-oval": 3, + "photon": 2, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N", + "V40Score": 6.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:58936", + "https://access.redhat.com/security/cve/CVE-2026-11822", + "https://bugzilla.redhat.com/show_bug.cgi?id=2487258", + "https://bugzilla.redhat.com/show_bug.cgi?id=2487269", + "https://cert-portal.siemens.com/productcert/html/ssa-765416.html", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-11822", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-11824", + "https://errata.almalinux.org/9/ALSA-2026-58936.html", + "https://errata.rockylinux.org/RLSA-2026:58936", + "https://linux.oracle.com/cve/CVE-2026-11822.html", + "https://linux.oracle.com/errata/ELSA-2026-61242-0.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-11822", + "https://sqlite.org/releaselog/3_53_2.html", + "https://sqlite.org/src/info/061febcf41ca", + "https://sqlite.org/src/info/4a5ad516ea93", + "https://sqlite.org/src/info/87b653731171", + "https://sqlite.org/src/info/fad98805b7d7", + "https://ubuntu.com/security/notices/USN-8480-1", + "https://www.cve.org/CVERecord?id=CVE-2026-11822", + "https://www.vulncheck.com/advisories/sqlite-before-memory-corruption-in-fts5-extension" + ], + "PublishedDate": "2026-06-09T20:16:32.15Z", + "LastModifiedDate": "2026-10-30T02:17:08.76Z" + }, + { + "VulnerabilityID": "CVE-2026-11824", + "PkgID": "libsqlite3-0@3.40.1-2+deb12u2", + "PkgName": "libsqlite3-0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsqlite3-0@3.40.1-2%2Bdeb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "1d1eb50a9122e00d" + }, + "InstalledVersion": "3.40.1-2+deb12u2", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-11824", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "sqlite: SQLite: Arbitrary code execution and crash via heap-based buffer overflow in FTS5", + "Description": "SQLite before 3.53.2 contains a heap-based buffer overflow vulnerability in the FTS5 full-text search extension that allows attackers to cause a crash or execute arbitrary code by supplying a crafted database with malicious continuation page metadata specifying a szLeaf value smaller than 4. Attackers can trigger an integer underflow in fts5ChunkIterate() causing an inflated remaining byte count during FTS5 MATCH query processing, leading to a heap buffer overflow of attacker-controlled data in applications compiled with SQLITE_ENABLE_FTS5.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-122" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", + "V40Score": 8.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:58936", + "https://access.redhat.com/security/cve/CVE-2026-11824", + "https://bugzilla.redhat.com/show_bug.cgi?id=2487258", + "https://bugzilla.redhat.com/show_bug.cgi?id=2487269", + "https://cert-portal.siemens.com/productcert/html/ssa-765416.html", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-11822", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-11824", + "https://errata.almalinux.org/9/ALSA-2026-58936.html", + "https://errata.rockylinux.org/RLSA-2026:58936", + "https://linux.oracle.com/cve/CVE-2026-11824.html", + "https://linux.oracle.com/errata/ELSA-2026-58938.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-11824", + "https://sqlite.org/releaselog/3_53_2.html", + "https://sqlite.org/src/info/061febcf41ca", + "https://sqlite.org/src/info/4a5ad516ea93", + "https://ubuntu.com/security/notices/USN-8480-1", + "https://www.cve.org/CVERecord?id=CVE-2026-11824", + "https://www.vulncheck.com/advisories/sqlite-before-heap-buffer-overflow-via-fts5-fts5chunkiterate" + ], + "PublishedDate": "2026-06-09T20:16:32.3Z", + "LastModifiedDate": "2026-10-15T02:18:37.653Z" + }, + { + "VulnerabilityID": "CVE-2026-119373", + "PkgID": "libsqlite3-0@3.40.1-2+deb12u2", + "PkgName": "libsqlite3-0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsqlite3-0@3.40.1-2%2Bdeb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "1d1eb50a9122e00d" + }, + "InstalledVersion": "3.40.1-2+deb12u2", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119373", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "sqlite: sqlite: Denial of service via heap-based buffer overflow in FTS5", + "Description": "SQLite before 3.54.0 built with FTS5 contains a heap buffer overflow in fts5MergeRowidLists() that undersizes the output buffer when merging detail=none prefix doclists. Attackers who can populate a detail=none FTS5 table with negative rowids and run a prefix MATCH query can write past the allocation, corrupting heap memory and crashing the process.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-787" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", + "V40Score": 8.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://abraxaslabs.tech/research/sqlite-fts5-rowidmerge", + "https://access.redhat.com/errata/RHSA-2026:96226", + "https://access.redhat.com/security/cve/CVE-2026-119373", + "https://bugzilla.redhat.com/2528759", + "https://bugzilla.redhat.com/2542700", + "https://bugzilla.redhat.com/2542707", + "https://bugzilla.redhat.com/2553656", + "https://bugzilla.redhat.com/2553677", + "https://bugzilla.redhat.com/2553678", + "https://bugzilla.redhat.com/2563607", + "https://bugzilla.redhat.com/2563953", + "https://bugzilla.redhat.com/show_bug.cgi?id=2528759", + "https://bugzilla.redhat.com/show_bug.cgi?id=2542700", + "https://bugzilla.redhat.com/show_bug.cgi?id=2542707", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553656", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553677", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553678", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563607", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563953", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563955", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563978", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-102276", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-102278", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-109383", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-109869", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118764", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119373", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119374", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119379", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-19534", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-87018", + "https://errata.almalinux.org/9/ALSA-2026-96226.html", + "https://errata.rockylinux.org/RLSA-2026:96226", + "https://github.com/sqlite/sqlite", + "https://github.com/sqlite/sqlite/blob/version-3.53.4/ext/fts5/fts5_index.c#L6107", + "https://github.com/sqlite/sqlite/commit/e1c9934f9f11a499029abb020ea715a08970da80", + "https://linux.oracle.com/cve/CVE-2026-119373.html", + "https://linux.oracle.com/errata/ELSA-2026-98102.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119373", + "https://sqlite.org/bugs/info/2026-08-04T08:49:27Z", + "https://sqlite.org/releaselog/3_54_0.html", + "https://sqlite.org/src/info/a7f8c92f62", + "https://www.cve.org/CVERecord?id=CVE-2026-119373", + "https://www.vulncheck.com/advisories/sqlite-before-3.54.0-fts5-heap-buffer-overflow-via-fts5mergerowidlists" + ], + "PublishedDate": "2026-10-30T12:16:36.027Z", + "LastModifiedDate": "2026-11-05T21:18:41.047Z" + }, + { + "VulnerabilityID": "CVE-2026-119374", + "PkgID": "libsqlite3-0@3.40.1-2+deb12u2", + "PkgName": "libsqlite3-0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsqlite3-0@3.40.1-2%2Bdeb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "1d1eb50a9122e00d" + }, + "InstalledVersion": "3.40.1-2+deb12u2", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119374", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "sqlite: sqlite: Arbitrary code execution via corrupted FTS5 index", + "Description": "SQLite before 3.54.0 built with FTS5 contains a heap buffer overflow in fts5DoSecureDelete() that allows attackers to write past the leaf page buffer via crafted footer key offsets. Attackers can supply a database file with a corrupted FTS5 index that, when deleted from with secure-delete enabled, corrupts heap memory and crashes the application.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-787" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", + "V40Score": 8.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://abraxaslabs.tech/research/sqlite-fts5-securedel", + "https://access.redhat.com/errata/RHSA-2026:96226", + "https://access.redhat.com/security/cve/CVE-2026-119374", + "https://bugzilla.redhat.com/2528759", + "https://bugzilla.redhat.com/2542700", + "https://bugzilla.redhat.com/2542707", + "https://bugzilla.redhat.com/2553656", + "https://bugzilla.redhat.com/2553677", + "https://bugzilla.redhat.com/2553678", + "https://bugzilla.redhat.com/2563607", + "https://bugzilla.redhat.com/2563953", + "https://bugzilla.redhat.com/show_bug.cgi?id=2528759", + "https://bugzilla.redhat.com/show_bug.cgi?id=2542700", + "https://bugzilla.redhat.com/show_bug.cgi?id=2542707", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553656", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553677", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553678", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563607", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563953", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563955", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563978", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-102276", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-102278", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-109383", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-109869", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118764", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119373", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119374", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119379", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-19534", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-87018", + "https://errata.almalinux.org/9/ALSA-2026-96226.html", + "https://errata.rockylinux.org/RLSA-2026:96226", + "https://github.com/sqlite/sqlite", + "https://github.com/sqlite/sqlite/blob/version-3.53.4/ext/fts5/fts5_index.c#L5525", + "https://github.com/sqlite/sqlite/commit/d9de6eedbe918c074c7556400fa21df5960704d9", + "https://linux.oracle.com/cve/CVE-2026-119374.html", + "https://linux.oracle.com/errata/ELSA-2026-98102.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119374", + "https://sqlite.org/releaselog/3_54_0.html", + "https://sqlite.org/src/info/9cd4f9e920", + "https://www.cve.org/CVERecord?id=CVE-2026-119374", + "https://www.vulncheck.com/advisories/sqlite-before-3.54.0-heap-buffer-overflow-via-fts5-fts5dosecuredelete" + ], + "PublishedDate": "2026-10-30T12:16:36.187Z", + "LastModifiedDate": "2026-11-03T16:09:06.143Z" + }, + { + "VulnerabilityID": "CVE-2026-119379", + "PkgID": "libsqlite3-0@3.40.1-2+deb12u2", + "PkgName": "libsqlite3-0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsqlite3-0@3.40.1-2%2Bdeb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "1d1eb50a9122e00d" + }, + "InstalledVersion": "3.40.1-2+deb12u2", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-119379", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "sqlite: sqlite: Arbitrary code execution via crafted session changesets", + "Description": "SQLite before 3.54.0 built with the session extension contains a heap buffer overflow vulnerability in sqlite3changeset_apply() that allows attackers to corrupt heap memory by supplying crafted changesets. Attackers can repeat a table name in a second changeset block with a larger column count, causing sessionUpdateFind() to memset past the undersized aUpdateMask allocation.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-787" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "bitnami": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", + "V40Score": 8.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://abraxaslabs.tech/research/sqlite-session-ncol", + "https://access.redhat.com/errata/RHSA-2026:96226", + "https://access.redhat.com/security/cve/CVE-2026-119379", + "https://bugzilla.redhat.com/2528759", + "https://bugzilla.redhat.com/2542700", + "https://bugzilla.redhat.com/2542707", + "https://bugzilla.redhat.com/2553656", + "https://bugzilla.redhat.com/2553677", + "https://bugzilla.redhat.com/2553678", + "https://bugzilla.redhat.com/2563607", + "https://bugzilla.redhat.com/2563953", + "https://bugzilla.redhat.com/show_bug.cgi?id=2528759", + "https://bugzilla.redhat.com/show_bug.cgi?id=2542700", + "https://bugzilla.redhat.com/show_bug.cgi?id=2542707", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553656", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553677", + "https://bugzilla.redhat.com/show_bug.cgi?id=2553678", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563607", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563953", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563955", + "https://bugzilla.redhat.com/show_bug.cgi?id=2563978", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-102276", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-102278", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-109383", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-109869", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-118764", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119373", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119374", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119379", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-19534", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-87018", + "https://errata.almalinux.org/9/ALSA-2026-96226.html", + "https://errata.rockylinux.org/RLSA-2026:96226", + "https://github.com/sqlite/sqlite", + "https://github.com/sqlite/sqlite/blob/version-3.53.4/ext/session/sqlite3session.c#L5619", + "https://github.com/sqlite/sqlite/commit/64459c87cc702d600704fb77ee40ca1782398a52", + "https://linux.oracle.com/cve/CVE-2026-119379.html", + "https://linux.oracle.com/errata/ELSA-2026-98102.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-119379", + "https://sqlite.org/bugs/info/2026-08-16T10:15:25Z", + "https://sqlite.org/releaselog/3_54_0.html", + "https://sqlite.org/src/info/3f57024aecea0f3b", + "https://www.cve.org/CVERecord?id=CVE-2026-119379", + "https://www.vulncheck.com/advisories/sqlite-before-3.54.0-heap-buffer-overflow-via-session-extension-sessionupdatefind" + ], + "PublishedDate": "2026-10-30T12:16:36.967Z", + "LastModifiedDate": "2026-11-03T15:38:24.827Z" + }, + { + "VulnerabilityID": "CVE-2026-16742", + "PkgID": "libsystemd0@252.39-1~deb12u2", + "PkgName": "libsystemd0", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libsystemd0@252.39-1~deb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "12d2fecfe6174ae2" + }, + "InstalledVersion": "252.39-1~deb12u2", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-16742", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "systemd: systemd-homed: Local privilege escalation via missing home-record signature verification", + "Description": "systemd-homed contains a local privilege escalation bug via arbitrary system group addition to a local, logged in, homed-managed user", + "Severity": "HIGH", + "CweIDs": [ + "CWE-269", + "CWE-347" + ], + "VendorSeverity": { + "amazon": 3, + "azure": 2, + "redhat": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H", + "V3Score": 8.8 + } + }, + "References": [ + "https://access.redhat.com/security/cve/CVE-2026-16742", + "https://github.com/systemd/systemd/security/advisories/GHSA-jm29-p7hh-vjhv", + "https://nvd.nist.gov/vuln/detail/CVE-2026-16742", + "https://ubuntu.com/security/notices/USN-8626-1", + "https://www.cve.org/CVERecord?id=CVE-2026-16742" + ], + "PublishedDate": "2026-08-10T14:17:21.277Z", + "LastModifiedDate": "2026-10-23T20:10:00.16Z" + }, + { + "VulnerabilityID": "CVE-2025-69720", + "PkgID": "libtinfo6@6.4-4", + "PkgName": "libtinfo6", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libtinfo6@6.4-4?arch=amd64\u0026distro=debian-12.15", + "UID": "507f10764fb140f0" + }, + "InstalledVersion": "6.4-4", + "Status": "affected", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-69720", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "ncurses: ncurses: Buffer overflow vulnerability may lead to arbitrary code execution.", + "Description": "The infocmp command-line tool in ncurses before 6.5-20251213 has a stack-based buffer overflow in analyze_string in progs/infocmp.c.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-121", + "CWE-120" + ], + "VendorSeverity": { + "alma": 2, + "azure": 4, + "cbl-mariner": 4, + "julia": 3, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 2, + "rocky": 2, + "ubuntu": 1 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:5913", + "https://access.redhat.com/security/cve/CVE-2025-69720", + "https://bugzilla.redhat.com/2449037", + "https://bugzilla.redhat.com/show_bug.cgi?id=2449037", + "https://cert-portal.siemens.com/productcert/html/ssa-253495.html", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-69720", + "https://errata.almalinux.org/10/ALSA-2026-5913.html", + "https://errata.rockylinux.org/RLSA-2026:5913", + "https://github.com/Cao-Wuhui/CVE-2025-69720", + "https://github.com/advisories/GHSA-9952-mrqj-h4jh", + "https://invisible-island.net/archives/ncurses/6.5", + "https://invisible-island.net/archives/ncurses/6.5/", + "https://invisible-island.net/ncurses", + "https://invisible-island.net/ncurses/", + "https://linux.oracle.com/cve/CVE-2025-69720.html", + "https://linux.oracle.com/errata/ELSA-2026-5913.html", + "https://marc.info/?l=ncurses-bug\u0026m=176539968328570\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176540731801330\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176545557728083\u0026w=2", + "https://nvd.nist.gov/vuln/detail/CVE-2025-69720", + "https://ubuntu.com/security/notices/USN-8503-1", + "https://www.cve.org/CVERecord?id=CVE-2025-69720" + ], + "PublishedDate": "2026-03-19T15:16:21.293Z", + "LastModifiedDate": "2026-06-17T10:00:50.423Z" + }, + { + "VulnerabilityID": "CVE-2026-16742", + "PkgID": "libudev1@252.39-1~deb12u2", + "PkgName": "libudev1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libudev1@252.39-1~deb12u2?arch=amd64\u0026distro=debian-12.15", + "UID": "7ecfe352f7224733" + }, + "InstalledVersion": "252.39-1~deb12u2", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-16742", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "systemd: systemd-homed: Local privilege escalation via missing home-record signature verification", + "Description": "systemd-homed contains a local privilege escalation bug via arbitrary system group addition to a local, logged in, homed-managed user", + "Severity": "HIGH", + "CweIDs": [ + "CWE-269", + "CWE-347" + ], + "VendorSeverity": { + "amazon": 3, + "azure": 2, + "redhat": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H", + "V3Score": 8.8 + } + }, + "References": [ + "https://access.redhat.com/security/cve/CVE-2026-16742", + "https://github.com/systemd/systemd/security/advisories/GHSA-jm29-p7hh-vjhv", + "https://nvd.nist.gov/vuln/detail/CVE-2026-16742", + "https://ubuntu.com/security/notices/USN-8626-1", + "https://www.cve.org/CVERecord?id=CVE-2026-16742" + ], + "PublishedDate": "2026-08-10T14:17:21.277Z", + "LastModifiedDate": "2026-10-23T20:10:00.16Z" + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "libuuid1@2.38.1-5+deb12u3", + "PkgName": "libuuid1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libuuid1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "7e589c71e2fd38b4" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "libuuid1@2.38.1-5+deb12u3", + "PkgName": "libuuid1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libuuid1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "7e589c71e2fd38b4" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "libuuid1@2.38.1-5+deb12u3", + "PkgName": "libuuid1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libuuid1@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "7e589c71e2fd38b4" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2026-124851", + "PkgID": "libzstd1@1.5.4+dfsg2-5", + "PkgName": "libzstd1", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/libzstd1@1.5.4%2Bdfsg2-5?arch=amd64\u0026distro=debian-12.15", + "UID": "13207c2537690fea" + }, + "InstalledVersion": "1.5.4+dfsg2-5", + "Status": "affected", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-124851", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "zstd: Zstandard Information Disclosure via Uninitialized Buffer", + "Description": "An information disclosure vulnerability in Zstandard versions 1.5.1 through 1.5.7 allows specially crafted compressed data to expose the contents of an internal buffer through decompressed output. The buffer is 64 KiB in the default configuration and may contain uninitialized memory or literals from earlier decompressions performed using the same decompression context. An attacker who can submit compressed data and observe the resulting output can recover the buffer's contents.", + "Severity": "HIGH", + "VendorSeverity": { + "redhat": 3 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "http://www.openwall.com/lists/oss-security/2026/11/24/1", + "https://access.redhat.com/security/cve/CVE-2026-124851", + "https://nvd.nist.gov/vuln/detail/CVE-2026-124851", + "https://www.cve.org/CVERecord?id=CVE-2026-124851", + "https://www.facebook.com/security/advisories/cve-2026-124851" + ], + "PublishedDate": "2026-11-24T00:17:28.767Z", + "LastModifiedDate": "2026-11-24T11:17:08.923Z" + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "mount@2.38.1-5+deb12u3", + "PkgName": "mount", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/mount@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "f8b12801e8f43d4d" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "mount@2.38.1-5+deb12u3", + "PkgName": "mount", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/mount@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "f8b12801e8f43d4d" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "mount@2.38.1-5+deb12u3", + "PkgName": "mount", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/mount@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "f8b12801e8f43d4d" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2025-69720", + "PkgID": "ncurses-base@6.4-4", + "PkgName": "ncurses-base", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/ncurses-base@6.4-4?arch=all\u0026distro=debian-12.15", + "UID": "9836f95b93f3d6b3" + }, + "InstalledVersion": "6.4-4", + "Status": "affected", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-69720", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "ncurses: ncurses: Buffer overflow vulnerability may lead to arbitrary code execution.", + "Description": "The infocmp command-line tool in ncurses before 6.5-20251213 has a stack-based buffer overflow in analyze_string in progs/infocmp.c.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-121", + "CWE-120" + ], + "VendorSeverity": { + "alma": 2, + "azure": 4, + "cbl-mariner": 4, + "julia": 3, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 2, + "rocky": 2, + "ubuntu": 1 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:5913", + "https://access.redhat.com/security/cve/CVE-2025-69720", + "https://bugzilla.redhat.com/2449037", + "https://bugzilla.redhat.com/show_bug.cgi?id=2449037", + "https://cert-portal.siemens.com/productcert/html/ssa-253495.html", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-69720", + "https://errata.almalinux.org/10/ALSA-2026-5913.html", + "https://errata.rockylinux.org/RLSA-2026:5913", + "https://github.com/Cao-Wuhui/CVE-2025-69720", + "https://github.com/advisories/GHSA-9952-mrqj-h4jh", + "https://invisible-island.net/archives/ncurses/6.5", + "https://invisible-island.net/archives/ncurses/6.5/", + "https://invisible-island.net/ncurses", + "https://invisible-island.net/ncurses/", + "https://linux.oracle.com/cve/CVE-2025-69720.html", + "https://linux.oracle.com/errata/ELSA-2026-5913.html", + "https://marc.info/?l=ncurses-bug\u0026m=176539968328570\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176540731801330\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176545557728083\u0026w=2", + "https://nvd.nist.gov/vuln/detail/CVE-2025-69720", + "https://ubuntu.com/security/notices/USN-8503-1", + "https://www.cve.org/CVERecord?id=CVE-2025-69720" + ], + "PublishedDate": "2026-03-19T15:16:21.293Z", + "LastModifiedDate": "2026-06-17T10:00:50.423Z" + }, + { + "VulnerabilityID": "CVE-2025-69720", + "PkgID": "ncurses-bin@6.4-4", + "PkgName": "ncurses-bin", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/ncurses-bin@6.4-4?arch=amd64\u0026distro=debian-12.15", + "UID": "d53f35453c9fec6d" + }, + "InstalledVersion": "6.4-4", + "Status": "affected", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-69720", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "ncurses: ncurses: Buffer overflow vulnerability may lead to arbitrary code execution.", + "Description": "The infocmp command-line tool in ncurses before 6.5-20251213 has a stack-based buffer overflow in analyze_string in progs/infocmp.c.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-121", + "CWE-120" + ], + "VendorSeverity": { + "alma": 2, + "azure": 4, + "cbl-mariner": 4, + "julia": 3, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 2, + "rocky": 2, + "ubuntu": 1 + }, + "CVSS": { + "julia": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:5913", + "https://access.redhat.com/security/cve/CVE-2025-69720", + "https://bugzilla.redhat.com/2449037", + "https://bugzilla.redhat.com/show_bug.cgi?id=2449037", + "https://cert-portal.siemens.com/productcert/html/ssa-253495.html", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-69720", + "https://errata.almalinux.org/10/ALSA-2026-5913.html", + "https://errata.rockylinux.org/RLSA-2026:5913", + "https://github.com/Cao-Wuhui/CVE-2025-69720", + "https://github.com/advisories/GHSA-9952-mrqj-h4jh", + "https://invisible-island.net/archives/ncurses/6.5", + "https://invisible-island.net/archives/ncurses/6.5/", + "https://invisible-island.net/ncurses", + "https://invisible-island.net/ncurses/", + "https://linux.oracle.com/cve/CVE-2025-69720.html", + "https://linux.oracle.com/errata/ELSA-2026-5913.html", + "https://marc.info/?l=ncurses-bug\u0026m=176539968328570\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176540731801330\u0026w=2", + "https://marc.info/?l=ncurses-bug\u0026m=176545557728083\u0026w=2", + "https://nvd.nist.gov/vuln/detail/CVE-2025-69720", + "https://ubuntu.com/security/notices/USN-8503-1", + "https://www.cve.org/CVERecord?id=CVE-2025-69720" + ], + "PublishedDate": "2026-03-19T15:16:21.293Z", + "LastModifiedDate": "2026-06-17T10:00:50.423Z" + }, + { + "VulnerabilityID": "CVE-2026-9538", + "PkgID": "perl-base@5.36.0-7+deb12u4", + "PkgName": "perl-base", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/perl-base@5.36.0-7%2Bdeb12u4?arch=amd64\u0026distro=debian-12.15", + "UID": "26b660c7b51cfc7e" + }, + "InstalledVersion": "5.36.0-7+deb12u4", + "Status": "fix_deferred", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-9538", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "perl-Archive-Tar: perl-Archive-Tar: Denial of Service via crafted tar header with large entry size", + "Description": "Archive::Tar versions before 3.10 for Perl allow memory exhaustion via attacker controlled entry size field in tar header.\n\n_read_tar() reads each entry's payload with $handle-\u003eread($$data, $block), where $block is derived from the entry's 12-byte size field in the tar header with no upper bound on that value.\n\nA crafted header declaring a multi-gigabyte size causes Perl to allocate a scalar of that size.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-789" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "nvd": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "http://www.openwall.com/lists/oss-security/2026/05/26/4", + "https://access.redhat.com/errata/RHSA-2026:49523", + "https://access.redhat.com/errata/RHSA-2026:49525", + "https://access.redhat.com/security/cve/CVE-2026-9538", + "https://bugzilla.redhat.com/2481315", + "https://bugzilla.redhat.com/show_bug.cgi?id=2481315", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-9538", + "https://errata.almalinux.org/10/ALSA-2026-49523.html", + "https://errata.rockylinux.org/RLSA-2026:49525", + "https://github.com/jib/archive-tar-new/commit/f9af01426038e29d9578825a0cd3626946ab08c7.patch", + "https://linux.oracle.com/cve/CVE-2026-9538.html", + "https://linux.oracle.com/errata/ELSA-2026-49525.html", + "https://lists.security.metacpan.org/cve-announce/msg/40396448/", + "https://metacpan.org/release/BINGOS/Archive-Tar-3.10/changes", + "https://nvd.nist.gov/vuln/detail/CVE-2026-9538", + "https://ubuntu.com/security/notices/USN-8684-1", + "https://www.cve.org/CVERecord?id=CVE-2026-9538" + ], + "PublishedDate": "2026-05-26T02:16:41.15Z", + "LastModifiedDate": "2026-07-23T11:10:00.12Z" + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "util-linux@2.38.1-5+deb12u3", + "PkgName": "util-linux", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/util-linux@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "ab5e38d4b3a64735" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "util-linux@2.38.1-5+deb12u3", + "PkgName": "util-linux", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/util-linux@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "ab5e38d4b3a64735" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "util-linux@2.38.1-5+deb12u3", + "PkgName": "util-linux", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/util-linux@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "ab5e38d4b3a64735" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2026-53613", + "PkgID": "util-linux-extra@2.38.1-5+deb12u3", + "PkgName": "util-linux-extra", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/util-linux-extra@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "92f0ab320705109e" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53613", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: TOCTOU in the mount program via ancestor directory swap on target path", + "Description": "util-linux is a random collection of Linux utilities. In util-linux 2.17 through 2.41.6 and 2.42 through 2.42.3, and in 2.42.4 when the legacy `mount(2)` path is used without `/proc`, restricted non-root `mount` requests validate an `/etc/fstab` target before the mount operation re-resolves that pathname. A local low-privileged user authorized by an fstab `user` or `users` entry whose target has an attacker-writable ancestor can use `renameat2(RENAME_EXCHANGE)` to swap a path component and redirect an authorized mount to a root-owned location, such as mounting attacker-controlled content over `/etc/sudoers.d`, and thereby gain root privileges. Versions 2.41.5 and 2.42.2 pin targets for the new mount API, and 2.42.4 pins legacy targets through `/proc/self/fd`; the documented legacy fallback without `/proc` remains affected.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "alma": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:96212", + "https://access.redhat.com/errata/RHSA-2026:97522", + "https://access.redhat.com/security/cve/CVE-2026-53613", + "https://bugzilla.redhat.com/2494101", + "https://bugzilla.redhat.com/2519646", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://errata.almalinux.org/8/ALSA-2026-96212.html", + "https://errata.rockylinux.org/RLSA-2026:97522", + "https://github.com/util-linux/util-linux/commit/0b010025a0e429bc80355c94db86a843395d49e2", + "https://github.com/util-linux/util-linux/commit/0d3d55975aa3492c62fd345eac38f41cd166c0b0", + "https://github.com/util-linux/util-linux/commit/2c773f336134acf016e639abb6f12ba7341fe4b8", + "https://github.com/util-linux/util-linux/commit/39fef62bf3226abb6bb018fa8750afa0327e84b4", + "https://github.com/util-linux/util-linux/commit/472cc3fb2d4d47cca7aab2e0b59eb3fb8a9359ec", + "https://github.com/util-linux/util-linux/commit/646fb66603d10a7ac337e14f566f1af48e3107c9", + "https://github.com/util-linux/util-linux/commit/708d1b3c51932dc5ba8082c7368187715e6a8d78", + "https://github.com/util-linux/util-linux/commit/78a860982e036f38fe9c0b3344998df5ac2c2ff5", + "https://github.com/util-linux/util-linux/commit/85d16b341f7232c9dbb4884b632e1e956584bee9", + "https://github.com/util-linux/util-linux/commit/a9508d216eb8977979102782672e0470cc9bf2a2", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.5", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.2", + "https://github.com/util-linux/util-linux/releases/tag/v2.42.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-8gj5-72r3-428g", + "https://linux.oracle.com/cve/CVE-2026-53613.html", + "https://linux.oracle.com/errata/ELSA-2026-97522.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53613", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53613" + ], + "PublishedDate": "2026-10-14T15:17:20.41Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-53615", + "PkgID": "util-linux-extra@2.38.1-5+deb12u3", + "PkgName": "util-linux-extra", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/util-linux-extra@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "92f0ab320705109e" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-53615", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: Partition metadata compromise via integer overflow in DOS partition parser", + "Description": "util-linux is a random collection of Linux utilities. Before util-linux 2.41.4, `parse_dos_extended()` in `libblkid/src/partitions/dos.c` computes an extended-partition start sector with 32-bit addition and does not apply the extended-area bounds checks to the first two EBR entries. A local attacker who causes a crafted DOS extended-partition disk image or removable medium to be probed can wrap `cur_start + start` to sector zero and cause libblkid to report a false partition overlapping the MBR. This directly compromises the integrity of the reported partition metadata; disk modification or availability loss requires a separate downstream consumer to act on that metadata. This issue is fixed in 2.41.4.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H", + "V3Score": 8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:98519", + "https://access.redhat.com/errata/RHSA-2026:98630", + "https://access.redhat.com/security/cve/CVE-2026-53615", + "https://bugzilla.redhat.com/2552551", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://errata.almalinux.org/10/ALSA-2026-98630.html", + "https://errata.rockylinux.org/RLSA-2026:98519", + "https://github.com/util-linux/util-linux/commit/05c2dbadf34cc74192287f377904afaaf4061623", + "https://github.com/util-linux/util-linux/commit/a2d858176b609ab5b8535021a3af9cd302d23d31", + "https://github.com/util-linux/util-linux/commit/e9d544d013267ea86b70ee8ff78abd280e6641af", + "https://github.com/util-linux/util-linux/releases/tag/v2.41.4", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-h4rw-gv36-wmp5", + "https://linux.oracle.com/cve/CVE-2026-53615.html", + "https://linux.oracle.com/errata/ELSA-2026-98630.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-53615", + "https://ubuntu.com/security/notices/USN-8702-1", + "https://www.cve.org/CVERecord?id=CVE-2026-53615" + ], + "PublishedDate": "2026-10-14T16:17:46.07Z", + "LastModifiedDate": "2026-10-16T16:00:33.533Z" + }, + { + "VulnerabilityID": "CVE-2026-78410", + "PkgID": "util-linux-extra@2.38.1-5+deb12u3", + "PkgName": "util-linux-extra", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/util-linux-extra@2.38.1-5%2Bdeb12u3?arch=amd64\u0026distro=debian-12.15", + "UID": "92f0ab320705109e" + }, + "InstalledVersion": "2.38.1-5+deb12u3", + "Status": "affected", + "Layer": { + "Digest": "sha256:4ff5f9de2486b203287e33f031e2d1d9af6b3698a089b0222a6734a12975b68b", + "DiffID": "sha256:d15d64a4b94d7b04925aa6b44feb1e1c166d3f3ada39e10ed35984ed42ed7844" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-78410", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "util-linux: util-linux: restricted bind mounts do not pin the source, allowing X-mount.owner/group/mode redirection", + "Description": "A flaw was found in util-linux. Restricted bind mounts take the source path from fstab but do not pin that source before the privileged mount. A local unprivileged user who can replace the authorized source or a writable ancestor can redirect SUID mount(8) to bind another host directory. If the fstab entry also sets X-mount.owner, X-mount.group, or X-mount.mode, root then changes ownership or mode on that redirected inode.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-367" + ], + "VendorSeverity": { + "azure": 3, + "bottlerocket": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 7.8 + } + }, + "References": [ + "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://access.redhat.com/errata/RHSA-2026:63162", + "https://access.redhat.com/errata/RHSA-2026:93461", + "https://access.redhat.com/errata/RHSA-2026:95365", + "https://access.redhat.com/security/cve/CVE-2026-78410", + "https://bugzilla.redhat.com/show_bug.cgi?id=2454956", + "https://bugzilla.redhat.com/show_bug.cgi?id=2494101", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519646", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519647", + "https://bugzilla.redhat.com/show_bug.cgi?id=2519648", + "https://bugzilla.redhat.com/show_bug.cgi?id=2521999", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522497", + "https://bugzilla.redhat.com/show_bug.cgi?id=2522684", + "https://bugzilla.redhat.com/show_bug.cgi?id=2552551", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-13595", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-27456", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53612", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53613", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53614", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53615", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-76642", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78408", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-78410", + "https://errata.rockylinux.org/RLSA-2026:93461", + "https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/advisories/18.0.0/BRSA-ldtjz3bcx3qo.toml", + "https://github.com/util-linux/util-linux/security/advisories/GHSA-rh77-686x-2f2m", + "https://linux.oracle.com/cve/CVE-2026-78410.html", + "https://linux.oracle.com/errata/ELSA-2026-93461.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-78410", + "https://www.cve.org/CVERecord?id=CVE-2026-78410" + ], + "PublishedDate": "2026-09-02T16:17:23.983Z", + "LastModifiedDate": "2026-11-23T16:18:00.23Z" + }, + { + "VulnerabilityID": "CVE-2023-45853", + "PkgID": "zlib1g@1:1.2.13.dfsg-1", + "PkgName": "zlib1g", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/zlib1g@1.2.13.dfsg-1?arch=amd64\u0026distro=debian-12.15\u0026epoch=1", + "UID": "8703e1cdeab22b91" + }, + "InstalledVersion": "1:1.2.13.dfsg-1", + "Status": "will_not_fix", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "SeveritySource": "nvd", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2023-45853", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "zlib: integer overflow and resultant heap-based buffer overflow in zipOpenNewFileInZip4_6", + "Description": "MiniZip in zlib through 1.3 has an integer overflow and resultant heap-based buffer overflow in zipOpenNewFileInZip4_64 via a long filename, comment, or extra field. NOTE: MiniZip is not a supported part of the zlib product. NOTE: pyminizip through 0.2.6 is also vulnerable because it bundles an affected zlib version, and exposes the applicable MiniZip code through its compress API.", + "Severity": "CRITICAL", + "CweIDs": [ + "CWE-190" + ], + "VendorSeverity": { + "amazon": 2, + "azure": 3, + "cbl-mariner": 4, + "ghsa": 4, + "julia": 4, + "nvd": 4, + "photon": 4, + "redhat": 2, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 9.8 + }, + "julia": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 9.8 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 9.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L", + "V3Score": 5.3 + } + }, + "References": [ + "http://www.openwall.com/lists/oss-security/2023/10/20/9", + "http://www.openwall.com/lists/oss-security/2024/01/24/10", + "https://access.redhat.com/security/cve/CVE-2023-45853", + "https://cert-portal.siemens.com/productcert/html/ssa-398330.html", + "https://cert-portal.siemens.com/productcert/html/ssa-470355.html", + "https://cert-portal.siemens.com/productcert/html/ssa-769027.html", + "https://chromium.googlesource.com/chromium/src/+/d709fb23806858847131027da95ef4c548813356", + "https://chromium.googlesource.com/chromium/src/+/de29dd6c7151d3cd37cb4cf0036800ddfb1d8b61", + "https://github.com/madler/zlib/blob/ac8f12c97d1afd9bafa9c710f827d40a407d3266/contrib/README.contrib#L1-L4", + "https://github.com/madler/zlib/commit/73331a6a0481067628f065ffe87bb1d8f787d10c", + "https://github.com/madler/zlib/pull/843", + "https://github.com/pypa/advisory-database/tree/main/vulns/pyminizip/PYSEC-2026-501.yaml", + "https://github.com/smihica/pyminizip", + "https://github.com/smihica/pyminizip/blob/master/zlib-1.2.11/contrib/minizip/zip.c", + "https://lists.debian.org/debian-lts-announce/2023/11/msg00026.html", + "https://nvd.nist.gov/vuln/detail/CVE-2023-45853", + "https://pypi.org/project/pyminizip", + "https://pypi.org/project/pyminizip/#history", + "https://security.gentoo.org/glsa/202401-18", + "https://security.netapp.com/advisory/ntap-20231130-0009", + "https://security.netapp.com/advisory/ntap-20231130-0009/", + "https://ubuntu.com/security/notices/USN-7107-1", + "https://www.cve.org/CVERecord?id=CVE-2023-45853", + "https://www.winimage.com/zLibDll/minizip.html" + ], + "PublishedDate": "2023-10-14T02:15:09.323Z", + "LastModifiedDate": "2026-10-15T00:16:39.75Z" + }, + { + "VulnerabilityID": "CVE-2026-85091", + "PkgID": "zlib1g@1:1.2.13.dfsg-1", + "PkgName": "zlib1g", + "PkgIdentifier": { + "PURL": "pkg:deb/debian/zlib1g@1.2.13.dfsg-1?arch=amd64\u0026distro=debian-12.15\u0026epoch=1", + "UID": "8703e1cdeab22b91" + }, + "InstalledVersion": "1:1.2.13.dfsg-1", + "Status": "affected", + "Layer": { + "Digest": "sha256:a2318d6c47ec9cac5acc500c47c79602bcf953cec711a18bc898911a0984365b", + "DiffID": "sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-85091", + "DataSource": { + "ID": "debian", + "Name": "Debian Security Tracker", + "URL": "https://salsa.debian.org/security-tracker-team/security-tracker" + }, + "Title": "zlib: zlib: Heap buffer overflow in gz_vacate() allows arbitrary code execution", + "Description": "zlib 1.2.11 through 1.3.2 contains a heap buffer overflow: after an underlying write() fails, gz_write() returns without resetting strm.next_in, leaving it pointed at the caller's buffer. A later gz* write call then derives a position from the stale pointer and writes past a heap allocation; any write() failure reaches it, including EPIPE on a blocking descriptor, and in versions before 1.3.1.2 the failed write must be followed by a gzclearerr() call.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-787" + ], + "VendorSeverity": { + "azure": 3, + "redhat": 3, + "ubuntu": 2 + }, + "CVSS": { + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 8.1 + } + }, + "References": [ + "https://access.redhat.com/security/cve/CVE-2026-85091", + "https://gist.github.com/thesmartshadow/e0b9481792afb7c31e86fee1ff084490", + "https://github.com/madler/zlib", + "https://github.com/madler/zlib/blob/v1.3.2/gzwrite.c#L393", + "https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148", + "https://nvd.nist.gov/vuln/detail/CVE-2026-85091", + "https://ubuntu.com/security/notices/USN-8954-1", + "https://www.cve.org/CVERecord?id=CVE-2026-85091", + "https://www.vulncheck.com/advisories/zlib-1.3.1.2-through-1.3.2-heap-buffer-overflow-via-gz-vacate" + ], + "PublishedDate": "2026-09-03T13:06:20.573Z", + "LastModifiedDate": "2026-11-13T15:17:56.49Z" + } + ] + }, + { + "Target": "Python", + "Class": "lang-pkgs", + "Type": "python-pkg", + "Vulnerabilities": [ + { + "VulnerabilityID": "CVE-2022-40897", + "PkgName": "setuptools", + "PkgPath": "opt/venv/lib/python3.11/site-packages/setuptools-65.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/setuptools@65.5.0", + "UID": "6abfaf254d7bda0a" + }, + "InstalledVersion": "65.5.0", + "FixedVersion": "65.5.1", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2022-40897", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "pypa-setuptools: Regular Expression Denial of Service (ReDoS) in package_index.py", + "Description": "Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page. There is a Regular Expression Denial of Service (ReDoS) in package_index.py.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-1333" + ], + "VendorSeverity": { + "alma": 2, + "amazon": 2, + "bitnami": 2, + "cbl-mariner": 2, + "ghsa": 3, + "nvd": 2, + "oracle-oval": 2, + "photon": 2, + "redhat": 2, + "rocky": 2, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 5.9 + }, + "ghsa": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:L/SI:L/SA:N", + "V3Score": 7.5, + "V40Score": 8.7 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 5.9 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 5.9 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2023:0952", + "https://access.redhat.com/security/cve/CVE-2022-40897", + "https://bugzilla.redhat.com/2158559", + "https://bugzilla.redhat.com/show_bug.cgi?id=2158559", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897", + "https://errata.almalinux.org/9/ALSA-2023-0952.html", + "https://errata.rockylinux.org/RLSA-2023:0952", + "https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2022-43012.yaml", + "https://github.com/pypa/setuptools", + "https://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200", + "https://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be", + "https://github.com/pypa/setuptools/compare/v65.5.0...v65.5.1", + "https://github.com/pypa/setuptools/issues/3659", + "https://linux.oracle.com/cve/CVE-2022-40897.html", + "https://linux.oracle.com/errata/ELSA-2024-2987.html", + "https://lists.debian.org/debian-lts-announce/2024/09/msg00018.html", + "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R", + "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R/", + "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H", + "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H/", + "https://nvd.nist.gov/vuln/detail/CVE-2022-40897", + "https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages", + "https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/", + "https://pyup.io/vulnerabilities/CVE-2022-40897/52495", + "https://pyup.io/vulnerabilities/CVE-2022-40897/52495/", + "https://security.netapp.com/advisory/ntap-20230214-0001", + "https://security.netapp.com/advisory/ntap-20230214-0001/", + "https://security.netapp.com/advisory/ntap-20240621-0006", + "https://security.netapp.com/advisory/ntap-20240621-0006/", + "https://setuptools.pypa.io/en/latest", + "https://ubuntu.com/security/notices/USN-5817-1", + "https://www.cve.org/CVERecord?id=CVE-2022-40897" + ], + "PublishedDate": "2022-12-23T00:15:13.987Z", + "LastModifiedDate": "2026-06-17T05:02:12.993Z" + }, + { + "VulnerabilityID": "CVE-2024-6345", + "PkgName": "setuptools", + "PkgPath": "opt/venv/lib/python3.11/site-packages/setuptools-65.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/setuptools@65.5.0", + "UID": "6abfaf254d7bda0a" + }, + "InstalledVersion": "65.5.0", + "FixedVersion": "70.0.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-6345", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "pypa/setuptools: Remote code execution via download functions in the package_index module in pypa/setuptools", + "Description": "A vulnerability in the package_index module of pypa/setuptools versions up to 69.1.1 allows for remote code execution via its download functions. These functions, which are used to download packages from URLs provided by users or retrieved from package index servers, are susceptible to code injection. If these functions are exposed to user-controlled inputs, such as package URLs, they can execute arbitrary commands on the system. The issue is fixed in version 70.0.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-94" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "cbl-mariner": 3, + "ghsa": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V3Vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 8.8 + }, + "ghsa": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", + "V3Score": 8.8, + "V40Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 8.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2024:6726", + "https://access.redhat.com/security/cve/CVE-2024-6345", + "https://bugzilla.redhat.com/2297771", + "https://bugzilla.redhat.com/show_bug.cgi?id=2297771", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-6345", + "https://errata.almalinux.org/9/ALSA-2024-6726.html", + "https://errata.rockylinux.org/RLSA-2024:6726", + "https://github.com/advisories/GHSA-cx63-2mw6-8hw5", + "https://github.com/pypa/setuptools", + "https://github.com/pypa/setuptools/commit/88807c7062788254f654ea8c03427adc859321f0", + "https://github.com/pypa/setuptools/pull/4332", + "https://huntr.com/bounties/d6362117-ad57-4e83-951f-b8141c6e7ca5", + "https://linux.oracle.com/cve/CVE-2024-6345.html", + "https://linux.oracle.com/errata/ELSA-2024-6726.html", + "https://lists.debian.org/debian-lts-announce/2024/09/msg00018.html", + "https://nvd.nist.gov/vuln/detail/CVE-2024-6345", + "https://ubuntu.com/security/notices/USN-7002-1", + "https://www.cve.org/CVERecord?id=CVE-2024-6345" + ], + "PublishedDate": "2024-07-15T01:15:01.73Z", + "LastModifiedDate": "2026-06-17T08:17:49.463Z" + }, + { + "VulnerabilityID": "CVE-2025-47273", + "PkgName": "setuptools", + "PkgPath": "opt/venv/lib/python3.11/site-packages/setuptools-65.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/setuptools@65.5.0", + "UID": "6abfaf254d7bda0a" + }, + "InstalledVersion": "65.5.0", + "FixedVersion": "78.1.1", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-47273", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "setuptools: Path Traversal Vulnerability in setuptools PackageIndex", + "Description": "setuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. A path traversal vulnerability in `PackageIndex` is present in setuptools prior to version 78.1.1. An attacker would be allowed to write files to arbitrary locations on the filesystem with the permissions of the process running the Python code, which could escalate to remote code execution depending on the context. Version 78.1.1 fixes the issue.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-22" + ], + "VendorSeverity": { + "alma": 2, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 2, + "rocky": 2, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P", + "V40Score": 7.7 + }, + "ghsa": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P", + "V40Score": 7.7 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 8.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L", + "V3Score": 7.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2025:10407", + "https://access.redhat.com/errata/RHSA-2025:9940", + "https://access.redhat.com/security/cve/CVE-2025-47273", + "https://advisory.echohq.com/cve/CVE-2025-47273", + "https://bugzilla.redhat.com/2366982", + "https://bugzilla.redhat.com/show_bug.cgi?id=2366982", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-47273", + "https://errata.almalinux.org/10/ALSA-2025-9940.html", + "https://errata.rockylinux.org/RLSA-2025:10407", + "https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2025-49.yaml", + "https://github.com/pypa/setuptools", + "https://github.com/pypa/setuptools/blob/6ead555c5fb29bc57fe6105b1bffc163f56fd558/setuptools/package_index.py#L810C1-L825C88", + "https://github.com/pypa/setuptools/commit/250a6d17978f9f6ac3ac887091f2d32886fbbb0b", + "https://github.com/pypa/setuptools/issues/4946", + "https://github.com/pypa/setuptools/security/advisories/GHSA-5rjg-fvgr-3xxf", + "https://linux.oracle.com/cve/CVE-2025-47273.html", + "https://linux.oracle.com/errata/ELSA-2025-9940.html", + "https://lists.debian.org/debian-lts-announce/2025/05/msg00035.html", + "https://nvd.nist.gov/vuln/detail/CVE-2025-47273", + "https://ubuntu.com/security/notices/USN-7544-1", + "https://ubuntu.com/security/notices/USN-8010-1", + "https://www.cve.org/CVERecord?id=CVE-2025-47273" + ], + "PublishedDate": "2025-05-17T16:15:19.11Z", + "LastModifiedDate": "2026-06-17T09:27:38.827Z" + }, + { + "VulnerabilityID": "CVE-2024-6345", + "PkgName": "setuptools", + "PkgPath": "usr/local/lib/python3.11/site-packages/setuptools-65.5.1.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/setuptools@65.5.1", + "UID": "d283ebd8a092b80b" + }, + "InstalledVersion": "65.5.1", + "FixedVersion": "70.0.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:98d167576f7c01209fbdc09830b859d5c5cec986eced40113c709d05ec6fbb1b", + "DiffID": "sha256:7cb94502409a1280e22fcd64bb6570e5e4fc332725a928c96477994393be09db" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-6345", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "pypa/setuptools: Remote code execution via download functions in the package_index module in pypa/setuptools", + "Description": "A vulnerability in the package_index module of pypa/setuptools versions up to 69.1.1 allows for remote code execution via its download functions. These functions, which are used to download packages from URLs provided by users or retrieved from package index servers, are susceptible to code injection. If these functions are exposed to user-controlled inputs, such as package URLs, they can execute arbitrary commands on the system. The issue is fixed in version 70.0.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-94" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "cbl-mariner": 3, + "ghsa": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V3Vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 8.8 + }, + "ghsa": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", + "V3Score": 8.8, + "V40Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", + "V3Score": 8.8 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2024:6726", + "https://access.redhat.com/security/cve/CVE-2024-6345", + "https://bugzilla.redhat.com/2297771", + "https://bugzilla.redhat.com/show_bug.cgi?id=2297771", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-6345", + "https://errata.almalinux.org/9/ALSA-2024-6726.html", + "https://errata.rockylinux.org/RLSA-2024:6726", + "https://github.com/advisories/GHSA-cx63-2mw6-8hw5", + "https://github.com/pypa/setuptools", + "https://github.com/pypa/setuptools/commit/88807c7062788254f654ea8c03427adc859321f0", + "https://github.com/pypa/setuptools/pull/4332", + "https://huntr.com/bounties/d6362117-ad57-4e83-951f-b8141c6e7ca5", + "https://linux.oracle.com/cve/CVE-2024-6345.html", + "https://linux.oracle.com/errata/ELSA-2024-6726.html", + "https://lists.debian.org/debian-lts-announce/2024/09/msg00018.html", + "https://nvd.nist.gov/vuln/detail/CVE-2024-6345", + "https://ubuntu.com/security/notices/USN-7002-1", + "https://www.cve.org/CVERecord?id=CVE-2024-6345" + ], + "PublishedDate": "2024-07-15T01:15:01.73Z", + "LastModifiedDate": "2026-06-17T08:17:49.463Z" + }, + { + "VulnerabilityID": "CVE-2025-47273", + "PkgName": "setuptools", + "PkgPath": "usr/local/lib/python3.11/site-packages/setuptools-65.5.1.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/setuptools@65.5.1", + "UID": "d283ebd8a092b80b" + }, + "InstalledVersion": "65.5.1", + "FixedVersion": "78.1.1", + "Status": "fixed", + "Layer": { + "Digest": "sha256:98d167576f7c01209fbdc09830b859d5c5cec986eced40113c709d05ec6fbb1b", + "DiffID": "sha256:7cb94502409a1280e22fcd64bb6570e5e4fc332725a928c96477994393be09db" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-47273", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "setuptools: Path Traversal Vulnerability in setuptools PackageIndex", + "Description": "setuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. A path traversal vulnerability in `PackageIndex` is present in setuptools prior to version 78.1.1. An attacker would be allowed to write files to arbitrary locations on the filesystem with the permissions of the process running the Python code, which could escalate to remote code execution depending on the context. Version 78.1.1 fixes the issue.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-22" + ], + "VendorSeverity": { + "alma": 2, + "amazon": 3, + "azure": 3, + "bitnami": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 2, + "photon": 3, + "redhat": 2, + "rocky": 2, + "ubuntu": 2 + }, + "CVSS": { + "bitnami": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P", + "V40Score": 7.7 + }, + "ghsa": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P", + "V40Score": 7.7 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", + "V3Score": 8.8 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L", + "V3Score": 7.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2025:10407", + "https://access.redhat.com/errata/RHSA-2025:9940", + "https://access.redhat.com/security/cve/CVE-2025-47273", + "https://advisory.echohq.com/cve/CVE-2025-47273", + "https://bugzilla.redhat.com/2366982", + "https://bugzilla.redhat.com/show_bug.cgi?id=2366982", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-47273", + "https://errata.almalinux.org/10/ALSA-2025-9940.html", + "https://errata.rockylinux.org/RLSA-2025:10407", + "https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2025-49.yaml", + "https://github.com/pypa/setuptools", + "https://github.com/pypa/setuptools/blob/6ead555c5fb29bc57fe6105b1bffc163f56fd558/setuptools/package_index.py#L810C1-L825C88", + "https://github.com/pypa/setuptools/commit/250a6d17978f9f6ac3ac887091f2d32886fbbb0b", + "https://github.com/pypa/setuptools/issues/4946", + "https://github.com/pypa/setuptools/security/advisories/GHSA-5rjg-fvgr-3xxf", + "https://linux.oracle.com/cve/CVE-2025-47273.html", + "https://linux.oracle.com/errata/ELSA-2025-9940.html", + "https://lists.debian.org/debian-lts-announce/2025/05/msg00035.html", + "https://nvd.nist.gov/vuln/detail/CVE-2025-47273", + "https://ubuntu.com/security/notices/USN-7544-1", + "https://ubuntu.com/security/notices/USN-8010-1", + "https://www.cve.org/CVERecord?id=CVE-2025-47273" + ], + "PublishedDate": "2025-05-17T16:15:19.11Z", + "LastModifiedDate": "2026-06-17T09:27:38.827Z" + }, + { + "VulnerabilityID": "CVE-2025-66418", + "PkgName": "urllib3", + "PkgPath": "opt/venv/lib/python3.11/site-packages/urllib3-2.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/urllib3@2.5.0", + "UID": "7d6fa65b830dbe1c" + }, + "InstalledVersion": "2.5.0", + "FixedVersion": "2.6.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-66418", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "urllib3: urllib3: Unbounded decompression chain leads to resource exhaustion", + "Description": "urllib3 is a user-friendly HTTP client library for Python. Starting in version 1.24 and prior to 2.6.0, the number of links in the decompression chain was unbounded allowing a malicious server to insert a virtually unlimited number of compression steps leading to high CPU usage and massive memory allocation for the decompressed data. This vulnerability is fixed in 2.6.0.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "cbl-mariner": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H", + "V40Score": 8.9 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:1086", + "https://access.redhat.com/errata/RHSA-2026:1087", + "https://access.redhat.com/security/cve/CVE-2025-66418", + "https://bugzilla.redhat.com/2419455", + "https://bugzilla.redhat.com/2419467", + "https://bugzilla.redhat.com/2427726", + "https://bugzilla.redhat.com/show_bug.cgi?id=2419455", + "https://bugzilla.redhat.com/show_bug.cgi?id=2419467", + "https://bugzilla.redhat.com/show_bug.cgi?id=2427726", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-66418", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-66471", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-21441", + "https://errata.almalinux.org/10/ALSA-2026-1086.html", + "https://errata.rockylinux.org/RLSA-2026:1087", + "https://github.com/urllib3/urllib3", + "https://github.com/urllib3/urllib3/commit/24d7b67eac89f94e11003424bcf0d8f7b72222a8", + "https://github.com/urllib3/urllib3/security/advisories/GHSA-gm62-xv2j-4w53", + "https://linux.oracle.com/cve/CVE-2025-66418.html", + "https://linux.oracle.com/errata/ELSA-2026-1254.html", + "https://nvd.nist.gov/vuln/detail/CVE-2025-66418", + "https://ubuntu.com/security/notices/USN-7927-1", + "https://ubuntu.com/security/notices/USN-8010-1", + "https://ubuntu.com/security/notices/USN-8344-1", + "https://www.cve.org/CVERecord?id=CVE-2025-66418", + "https://www.openwall.com/lists/oss-security/2025/12/05/4" + ], + "PublishedDate": "2025-12-05T16:15:51.053Z", + "LastModifiedDate": "2026-11-10T17:17:17.047Z" + }, + { + "VulnerabilityID": "CVE-2025-66471", + "PkgName": "urllib3", + "PkgPath": "opt/venv/lib/python3.11/site-packages/urllib3-2.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/urllib3@2.5.0", + "UID": "7d6fa65b830dbe1c" + }, + "InstalledVersion": "2.5.0", + "FixedVersion": "2.6.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2025-66471", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "urllib3: urllib3 Streaming API improperly handles highly compressed data", + "Description": "urllib3 is a user-friendly HTTP client library for Python. Starting in version 1.0 and prior to 2.6.0, the Streaming API improperly handles highly compressed data. urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When streaming a compressed response, urllib3 can perform decoding or decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). The library must read compressed data from the network and decompress it until the requested chunk size is met. Any resulting decompressed data that exceeds the requested amount is held in an internal buffer for the next read operation. The decompression logic could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This can result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-409" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "cbl-mariner": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H", + "V40Score": 8.9 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:1086", + "https://access.redhat.com/errata/RHSA-2026:1087", + "https://access.redhat.com/security/cve/CVE-2025-66471", + "https://bugzilla.redhat.com/2419455", + "https://bugzilla.redhat.com/2419467", + "https://bugzilla.redhat.com/2427726", + "https://bugzilla.redhat.com/show_bug.cgi?id=2419455", + "https://bugzilla.redhat.com/show_bug.cgi?id=2419467", + "https://bugzilla.redhat.com/show_bug.cgi?id=2427726", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-66418", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-66471", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-21441", + "https://errata.almalinux.org/10/ALSA-2026-1086.html", + "https://errata.rockylinux.org/RLSA-2026:1087", + "https://github.com/advisories/GHSA-2xpw-w6gg-jr37", + "https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2026-1994.yaml", + "https://github.com/urllib3/urllib3", + "https://github.com/urllib3/urllib3/commit/c19571de34c47de3a766541b041637ba5f716ed7", + "https://github.com/urllib3/urllib3/commit/d0fde3672e4a4093f7587858dccfc298eb66e46c", + "https://github.com/urllib3/urllib3/security/advisories/GHSA-2xpw-w6gg-jr37", + "https://linux.oracle.com/cve/CVE-2025-66471.html", + "https://linux.oracle.com/errata/ELSA-2026-9031.html", + "https://nvd.nist.gov/vuln/detail/CVE-2025-66471", + "https://pypi.org/project/urllib3", + "https://ubuntu.com/security/notices/USN-7927-1", + "https://ubuntu.com/security/notices/USN-7927-2", + "https://ubuntu.com/security/notices/USN-7927-3", + "https://ubuntu.com/security/notices/USN-8344-1", + "https://ubuntu.com/security/notices/USN-8344-2", + "https://ubuntu.com/security/notices/USN-8344-3", + "https://www.cve.org/CVERecord?id=CVE-2025-66471", + "https://www.openwall.com/lists/oss-security/2025/12/05/4" + ], + "PublishedDate": "2025-12-05T17:16:04.4Z", + "LastModifiedDate": "2026-09-25T23:10:00.463Z" + }, + { + "VulnerabilityID": "CVE-2026-21441", + "PkgName": "urllib3", + "PkgPath": "opt/venv/lib/python3.11/site-packages/urllib3-2.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/urllib3@2.5.0", + "UID": "7d6fa65b830dbe1c" + }, + "InstalledVersion": "2.5.0", + "FixedVersion": "2.6.3", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-21441", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "urllib3: urllib3 vulnerable to decompression-bomb safeguard bypass when following HTTP redirects (streaming API)", + "Description": "urllib3 is an HTTP client library for Python. urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. urllib3 can perform decoding or decompression based on the HTTP `Content-Encoding` header (e.g., `gzip`, `deflate`, `br`, or `zstd`). When using the streaming API, the library decompresses only the necessary bytes, enabling partial content consumption. Starting in version 1.22 and prior to version 2.6.3, for HTTP redirect responses, the library would read the entire response body to drain the connection and decompress the content unnecessarily. This decompression occurred even before any read methods were called, and configured read limits did not restrict the amount of decompressed data. As a result, there was no safeguard against decompression bombs. A malicious server could exploit this to trigger excessive resource consumption on the client. Applications and libraries are affected when they stream content from untrusted sources by setting `preload_content=False` when they do not disable redirects. Users should upgrade to at least urllib3 v2.6.3, in which the library does not decode content of redirect responses when `preload_content=False`. If upgrading is not immediately possible, disable redirects by setting `redirect=False` for requests to untrusted source.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-409" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "cbl-mariner": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H", + "V3Score": 7.5, + "V40Score": 8.9 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:0981", + "https://access.redhat.com/errata/RHSA-2026:0990", + "https://access.redhat.com/errata/RHSA-2026:10184", + "https://access.redhat.com/errata/RHSA-2026:1038", + "https://access.redhat.com/errata/RHSA-2026:1041", + "https://access.redhat.com/errata/RHSA-2026:1042", + "https://access.redhat.com/errata/RHSA-2026:1086", + "https://access.redhat.com/errata/RHSA-2026:1087", + "https://access.redhat.com/errata/RHSA-2026:1088", + "https://access.redhat.com/errata/RHSA-2026:1089", + "https://access.redhat.com/errata/RHSA-2026:1166", + "https://access.redhat.com/errata/RHSA-2026:1168", + "https://access.redhat.com/errata/RHSA-2026:1176", + "https://access.redhat.com/errata/RHSA-2026:1224", + "https://access.redhat.com/errata/RHSA-2026:1226", + "https://access.redhat.com/errata/RHSA-2026:1239", + "https://access.redhat.com/errata/RHSA-2026:1240", + "https://access.redhat.com/errata/RHSA-2026:1241", + "https://access.redhat.com/errata/RHSA-2026:1254", + "https://access.redhat.com/errata/RHSA-2026:1485", + "https://access.redhat.com/errata/RHSA-2026:14877", + "https://access.redhat.com/errata/RHSA-2026:1504", + "https://access.redhat.com/errata/RHSA-2026:1546", + "https://access.redhat.com/errata/RHSA-2026:1596", + "https://access.redhat.com/errata/RHSA-2026:1599", + "https://access.redhat.com/errata/RHSA-2026:1609", + "https://access.redhat.com/errata/RHSA-2026:1618", + "https://access.redhat.com/errata/RHSA-2026:1619", + "https://access.redhat.com/errata/RHSA-2026:1652", + "https://access.redhat.com/errata/RHSA-2026:1674", + "https://access.redhat.com/errata/RHSA-2026:1676", + "https://access.redhat.com/errata/RHSA-2026:1693", + "https://access.redhat.com/errata/RHSA-2026:1704", + "https://access.redhat.com/errata/RHSA-2026:1706", + "https://access.redhat.com/errata/RHSA-2026:1712", + "https://access.redhat.com/errata/RHSA-2026:1717", + "https://access.redhat.com/errata/RHSA-2026:1726", + "https://access.redhat.com/errata/RHSA-2026:1729", + "https://access.redhat.com/errata/RHSA-2026:1730", + "https://access.redhat.com/errata/RHSA-2026:1734", + "https://access.redhat.com/errata/RHSA-2026:1735", + "https://access.redhat.com/errata/RHSA-2026:1736", + "https://access.redhat.com/errata/RHSA-2026:17456", + "https://access.redhat.com/errata/RHSA-2026:17457", + "https://access.redhat.com/errata/RHSA-2026:17460", + "https://access.redhat.com/errata/RHSA-2026:17461", + "https://access.redhat.com/errata/RHSA-2026:17462", + "https://access.redhat.com/errata/RHSA-2026:17463", + "https://access.redhat.com/errata/RHSA-2026:1791", + "https://access.redhat.com/errata/RHSA-2026:1792", + "https://access.redhat.com/errata/RHSA-2026:1793", + "https://access.redhat.com/errata/RHSA-2026:1794", + "https://access.redhat.com/errata/RHSA-2026:1803", + "https://access.redhat.com/errata/RHSA-2026:1805", + "https://access.redhat.com/errata/RHSA-2026:1942", + "https://access.redhat.com/errata/RHSA-2026:1957", + "https://access.redhat.com/errata/RHSA-2026:19712", + "https://access.redhat.com/errata/RHSA-2026:2106", + "https://access.redhat.com/errata/RHSA-2026:2126", + "https://access.redhat.com/errata/RHSA-2026:2137", + "https://access.redhat.com/errata/RHSA-2026:2139", + "https://access.redhat.com/errata/RHSA-2026:2144", + "https://access.redhat.com/errata/RHSA-2026:2256", + "https://access.redhat.com/errata/RHSA-2026:2456", + "https://access.redhat.com/errata/RHSA-2026:2500", + "https://access.redhat.com/errata/RHSA-2026:25127", + "https://access.redhat.com/errata/RHSA-2026:2563", + "https://access.redhat.com/errata/RHSA-2026:2681", + "https://access.redhat.com/errata/RHSA-2026:2695", + "https://access.redhat.com/errata/RHSA-2026:2717", + "https://access.redhat.com/errata/RHSA-2026:2718", + "https://access.redhat.com/errata/RHSA-2026:2723", + "https://access.redhat.com/errata/RHSA-2026:2728", + "https://access.redhat.com/errata/RHSA-2026:2760", + "https://access.redhat.com/errata/RHSA-2026:2762", + "https://access.redhat.com/errata/RHSA-2026:2764", + "https://access.redhat.com/errata/RHSA-2026:2765", + "https://access.redhat.com/errata/RHSA-2026:28043", + "https://access.redhat.com/errata/RHSA-2026:28441", + "https://access.redhat.com/errata/RHSA-2026:2900", + "https://access.redhat.com/errata/RHSA-2026:2911", + "https://access.redhat.com/errata/RHSA-2026:2919", + "https://access.redhat.com/errata/RHSA-2026:2924", + "https://access.redhat.com/errata/RHSA-2026:2925", + "https://access.redhat.com/errata/RHSA-2026:2926", + "https://access.redhat.com/errata/RHSA-2026:3296", + "https://access.redhat.com/errata/RHSA-2026:33154", + "https://access.redhat.com/errata/RHSA-2026:3406", + "https://access.redhat.com/errata/RHSA-2026:3444", + "https://access.redhat.com/errata/RHSA-2026:3461", + "https://access.redhat.com/errata/RHSA-2026:3462", + "https://access.redhat.com/errata/RHSA-2026:3713", + "https://access.redhat.com/errata/RHSA-2026:3782", + "https://access.redhat.com/errata/RHSA-2026:3869", + "https://access.redhat.com/errata/RHSA-2026:3874", + "https://access.redhat.com/errata/RHSA-2026:3884", + "https://access.redhat.com/errata/RHSA-2026:3960", + "https://access.redhat.com/errata/RHSA-2026:4185", + "https://access.redhat.com/errata/RHSA-2026:41928", + "https://access.redhat.com/errata/RHSA-2026:4215", + "https://access.redhat.com/errata/RHSA-2026:4271", + "https://access.redhat.com/errata/RHSA-2026:4466", + "https://access.redhat.com/errata/RHSA-2026:4467", + "https://access.redhat.com/errata/RHSA-2026:44696", + "https://access.redhat.com/errata/RHSA-2026:51357", + "https://access.redhat.com/errata/RHSA-2026:5459", + "https://access.redhat.com/errata/RHSA-2026:61628", + "https://access.redhat.com/errata/RHSA-2026:6287", + "https://access.redhat.com/errata/RHSA-2026:6292", + "https://access.redhat.com/errata/RHSA-2026:8151", + "https://access.redhat.com/errata/RHSA-2026:8500", + "https://access.redhat.com/errata/RHSA-2026:8501", + "https://access.redhat.com/security/cve/CVE-2026-21441", + "https://bugzilla.redhat.com/2419455", + "https://bugzilla.redhat.com/2419467", + "https://bugzilla.redhat.com/2427726", + "https://bugzilla.redhat.com/show_bug.cgi?id=2419455", + "https://bugzilla.redhat.com/show_bug.cgi?id=2419467", + "https://bugzilla.redhat.com/show_bug.cgi?id=2427726", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-66418", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-66471", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-21441", + "https://errata.almalinux.org/10/ALSA-2026-1086.html", + "https://errata.rockylinux.org/RLSA-2026:1087", + "https://github.com/urllib3/urllib3", + "https://github.com/urllib3/urllib3/commit/8864ac407bba8607950025e0979c4c69bc7abc7b", + "https://github.com/urllib3/urllib3/security/advisories/GHSA-38jv-5279-wg99", + "https://linux.oracle.com/cve/CVE-2026-21441.html", + "https://linux.oracle.com/errata/ELSA-2026-1254.html", + "https://lists.debian.org/debian-lts-announce/2026/01/msg00017.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-21441", + "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-21441.json", + "https://ubuntu.com/security/notices/USN-7955-1", + "https://ubuntu.com/security/notices/USN-7955-2", + "https://ubuntu.com/security/notices/USN-8010-1", + "https://www.cve.org/CVERecord?id=CVE-2026-21441" + ], + "PublishedDate": "2026-01-07T22:15:44.04Z", + "LastModifiedDate": "2026-11-10T17:17:34.413Z" + }, + { + "VulnerabilityID": "CVE-2026-44431", + "PkgName": "urllib3", + "PkgPath": "opt/venv/lib/python3.11/site-packages/urllib3-2.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/urllib3@2.5.0", + "UID": "7d6fa65b830dbe1c" + }, + "InstalledVersion": "2.5.0", + "FixedVersion": "2.7.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-44431", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "urllib3: urllib3: Information disclosure via cross-origin redirects forwarding sensitive headers", + "Description": "urllib3 is an HTTP client library for Python. From 1.23 to before 2.7.0, cross-origin redirects followed from the low-level API via ProxyManager.connection_from_url().urlopen(..., assert_same_host=False) still forward these sensitive headers. This vulnerability is fixed in 2.7.0.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-200" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 2, + "azure": 3, + "ghsa": 3, + "nvd": 2, + "oracle-oval": 2, + "photon": 2, + "redhat": 2, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", + "V40Vector": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N", + "V3Score": 5.3, + "V40Score": 8.2 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", + "V3Score": 5.3 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N", + "V3Score": 5.9 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:28000", + "https://access.redhat.com/errata/RHSA-2026:28158", + "https://access.redhat.com/security/cve/CVE-2026-44431", + "https://advisory.echohq.com/cve/CVE-2026-44431", + "https://bugzilla.redhat.com/2477154", + "https://bugzilla.redhat.com/2477167", + "https://bugzilla.redhat.com/show_bug.cgi?id=2477154", + "https://bugzilla.redhat.com/show_bug.cgi?id=2477167", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-44431", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-44432", + "https://errata.almalinux.org/10/ALSA-2026-28000.html", + "https://errata.rockylinux.org/RLSA-2026:28158", + "https://github.com/urllib3/urllib3", + "https://github.com/urllib3/urllib3/security/advisories/GHSA-qccp-gfcp-xxvc", + "https://linux.oracle.com/cve/CVE-2026-44431.html", + "https://linux.oracle.com/errata/ELSA-2026-49927.html", + "https://lists.debian.org/debian-lts-announce/2026/06/msg00040.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-44431", + "https://ubuntu.com/security/notices/USN-8379-1", + "https://ubuntu.com/security/notices/USN-8811-1", + "https://www.cve.org/CVERecord?id=CVE-2026-44431" + ], + "PublishedDate": "2026-05-13T16:16:57.15Z", + "LastModifiedDate": "2026-11-11T20:10:00.273Z" + }, + { + "VulnerabilityID": "CVE-2026-97687", + "PkgName": "urllib3", + "PkgPath": "opt/venv/lib/python3.11/site-packages/urllib3-2.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/urllib3@2.5.0", + "UID": "7d6fa65b830dbe1c" + }, + "InstalledVersion": "2.5.0", + "FixedVersion": "2.8.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-97687", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "urllib3: urllib3: Traffic interception via HTTPS proxy TLS configuration override", + "Description": "urllib3 is an HTTP client library for Python. From 1.26.0 until 2.8.0, the proxy_ssl_context, proxy_assert_hostname, proxy_assert_fingerprint, ssl_context, cert_reqs, verify_mode, use_forwarding_for_https=True, and CERT_NONE configuration paths fail to remain separated because target-server TLS settings are incorrectly applied to the HTTPS proxy connection. The trigger is that an application uses an HTTPS proxy and configures target-server TLS settings that must remain separate from the proxy TLS handshake, including HTTPS forwarding with target-specific identity or credentials. Applying cert_reqs=CERT_NONE can overwrite proxy_ssl_context.verify_mode in place, and the mutation persists so later connections reusing the same context may connect to the HTTPS proxy without certificate verification. The attack mechanism is that an attacker intercepts and impersonates the HTTPS proxy after the effective proxy policy accepts the attacker's certificate. The impact is that the attacker can observe or modify forwarded traffic or receive a target TLS client certificate, while CONNECT tunneling still preserves the separate end-to-end target TLS connection. This issue is fixed in version 2.8.0.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-295", + "CWE-440" + ], + "VendorSeverity": { + "alma": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N", + "V40Score": 7.6 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N", + "V3Score": 8.1 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", + "V3Score": 7.4 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:85930", + "https://access.redhat.com/errata/RHSA-2026:90494", + "https://access.redhat.com/security/cve/CVE-2026-97687", + "https://advisory.echohq.com/cve/CVE-2026-97687", + "https://bugzilla.redhat.com/2543245", + "https://bugzilla.redhat.com/2543255", + "https://bugzilla.redhat.com/show_bug.cgi?id=2543245", + "https://bugzilla.redhat.com/show_bug.cgi?id=2543255", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97687", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97689", + "https://errata.almalinux.org/10/ALSA-2026-85930.html", + "https://errata.rockylinux.org/RLSA-2026:90494", + "https://github.com/urllib3/urllib3", + "https://github.com/urllib3/urllib3/commit/07408cec79d1856d81bb42c74a904a24fdb9e465", + "https://github.com/urllib3/urllib3/commit/b6447295fff7b38fdffc67e0df9712d60cef3cc3", + "https://github.com/urllib3/urllib3/pull/5093", + "https://github.com/urllib3/urllib3/releases/tag/2.8.0", + "https://github.com/urllib3/urllib3/security/advisories/GHSA-8988-9cw3-xx77", + "https://linux.oracle.com/cve/CVE-2026-97687.html", + "https://linux.oracle.com/errata/ELSA-2026-92474.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-97687", + "https://ubuntu.com/security/notices/USN-8926-1", + "https://www.cve.org/CVERecord?id=CVE-2026-97687" + ], + "PublishedDate": "2026-09-29T16:17:18.517Z", + "LastModifiedDate": "2026-10-13T20:27:23.13Z" + }, + { + "VulnerabilityID": "CVE-2026-97689", + "PkgName": "urllib3", + "PkgPath": "opt/venv/lib/python3.11/site-packages/urllib3-2.5.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/urllib3@2.5.0", + "UID": "7d6fa65b830dbe1c" + }, + "InstalledVersion": "2.5.0", + "FixedVersion": "2.8.0", + "Status": "fixed", + "Layer": { + "Digest": "sha256:967c47dd886a0cfbadbc9d718244b82aa4808a2aeb413b3e92aa3d300b0c84d1", + "DiffID": "sha256:18bedf227256ef9cfb5d8a4403b45090a5fd715ffb1f9d7704aa0a2ab56ba881" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-97689", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "urllib3: urllib3: Denial of Service via unbounded memory allocation in chunk parser", + "Description": "urllib3 is an HTTP client library for Python. From 1.10.3 until 2.8.0, the HTTPResponse.read_chunked and HTTPResponse.stream methods can allocate unbounded memory because the streaming chunk parser buffers the chunk-size field until newline or EOF without a length bound. The trigger is that a malicious server returns Transfer-Encoding: chunked followed by a very long run of bytes without a newline. The attack mechanism is that a malicious HTTP server sends a very long unterminated chunk-size line. The impact is that unbounded memory allocation can exhaust the client process. This issue is fixed in version 2.8.0.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-770" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 3, + "ghsa": 3, + "nvd": 3, + "oracle-oval": 3, + "photon": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H", + "V40Score": 8.9 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", + "V3Score": 7.5 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:85930", + "https://access.redhat.com/errata/RHSA-2026:90494", + "https://access.redhat.com/security/cve/CVE-2026-97689", + "https://advisory.echohq.com/cve/CVE-2026-97689", + "https://bugzilla.redhat.com/2543245", + "https://bugzilla.redhat.com/2543255", + "https://bugzilla.redhat.com/show_bug.cgi?id=2543245", + "https://bugzilla.redhat.com/show_bug.cgi?id=2543255", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97687", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97689", + "https://errata.almalinux.org/10/ALSA-2026-85930.html", + "https://errata.rockylinux.org/RLSA-2026:90494", + "https://github.com/urllib3/urllib3", + "https://github.com/urllib3/urllib3/commit/cd770b059b543be29298ea5c52afb0b1b090f5ed", + "https://github.com/urllib3/urllib3/releases/tag/2.8.0", + "https://github.com/urllib3/urllib3/security/advisories/GHSA-vxq7-64xx-v4gw", + "https://linux.oracle.com/cve/CVE-2026-97689.html", + "https://linux.oracle.com/errata/ELSA-2026-92474.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-97689", + "https://ubuntu.com/security/notices/USN-8926-1", + "https://www.cve.org/CVERecord?id=CVE-2026-97689" + ], + "PublishedDate": "2026-09-29T16:17:18.837Z", + "LastModifiedDate": "2026-10-13T20:20:06.95Z" + }, + { + "VulnerabilityID": "CVE-2026-24049", + "PkgName": "wheel", + "PkgPath": "usr/local/lib/python3.11/site-packages/wheel-0.44.0.dist-info/METADATA", + "PkgIdentifier": { + "PURL": "pkg:pypi/wheel@0.44.0", + "UID": "c19448eb9f96841b" + }, + "InstalledVersion": "0.44.0", + "FixedVersion": "0.46.2", + "Status": "fixed", + "Layer": { + "Digest": "sha256:98d167576f7c01209fbdc09830b859d5c5cec986eced40113c709d05ec6fbb1b", + "DiffID": "sha256:7cb94502409a1280e22fcd64bb6570e5e4fc332725a928c96477994393be09db" + }, + "SeveritySource": "ghsa", + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2026-24049", + "DataSource": { + "ID": "ghsa", + "Name": "GitHub Security Advisory pip", + "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip" + }, + "Title": "wheel: wheel: Privilege Escalation or Arbitrary Code Execution via malicious wheel file unpacking", + "Description": "wheel is a command line tool for manipulating Python wheel files, as defined in PEP 427. In versions 0.40.0 through 0.46.1, the unpack function is vulnerable to file permission modification through mishandling of file permissions after extraction. The logic blindly trusts the filename from the archive header for the chmod operation, even though the extraction process itself might have sanitized the path. Attackers can craft a malicious wheel file that, when unpacked, changes the permissions of critical system files (e.g., /etc/passwd, SSH keys, config files), allowing for Privilege Escalation or arbitrary code execution by modifying now-writable scripts. This issue has been fixed in version 0.46.2.", + "Severity": "HIGH", + "CweIDs": [ + "CWE-22", + "CWE-732" + ], + "VendorSeverity": { + "alma": 3, + "amazon": 3, + "azure": 2, + "cbl-mariner": 2, + "ghsa": 3, + "nvd": 2, + "oracle-oval": 3, + "redhat": 3, + "rocky": 3, + "ubuntu": 2 + }, + "CVSS": { + "ghsa": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H", + "V3Score": 7.1 + }, + "nvd": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N", + "V3Score": 5.5 + }, + "redhat": { + "V3Vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H", + "V3Score": 7.1 + } + }, + "References": [ + "https://access.redhat.com/errata/RHSA-2026:10184", + "https://access.redhat.com/errata/RHSA-2026:13545", + "https://access.redhat.com/errata/RHSA-2026:14020", + "https://access.redhat.com/errata/RHSA-2026:1504", + "https://access.redhat.com/errata/RHSA-2026:17599", + "https://access.redhat.com/errata/RHSA-2026:1902", + "https://access.redhat.com/errata/RHSA-2026:1939", + "https://access.redhat.com/errata/RHSA-2026:1942", + "https://access.redhat.com/errata/RHSA-2026:19712", + "https://access.redhat.com/errata/RHSA-2026:20089", + "https://access.redhat.com/errata/RHSA-2026:2090", + "https://access.redhat.com/errata/RHSA-2026:2106", + "https://access.redhat.com/errata/RHSA-2026:2139", + "https://access.redhat.com/errata/RHSA-2026:2675", + "https://access.redhat.com/errata/RHSA-2026:2681", + "https://access.redhat.com/errata/RHSA-2026:2694", + "https://access.redhat.com/errata/RHSA-2026:2695", + "https://access.redhat.com/errata/RHSA-2026:2710", + "https://access.redhat.com/errata/RHSA-2026:2754", + "https://access.redhat.com/errata/RHSA-2026:2762", + "https://access.redhat.com/errata/RHSA-2026:2823", + "https://access.redhat.com/errata/RHSA-2026:2865", + "https://access.redhat.com/errata/RHSA-2026:2866", + "https://access.redhat.com/errata/RHSA-2026:2900", + "https://access.redhat.com/errata/RHSA-2026:2925", + "https://access.redhat.com/errata/RHSA-2026:3461", + "https://access.redhat.com/errata/RHSA-2026:3462", + "https://access.redhat.com/errata/RHSA-2026:3713", + "https://access.redhat.com/errata/RHSA-2026:3782", + "https://access.redhat.com/errata/RHSA-2026:3958", + "https://access.redhat.com/errata/RHSA-2026:3959", + "https://access.redhat.com/errata/RHSA-2026:3960", + "https://access.redhat.com/errata/RHSA-2026:4185", + "https://access.redhat.com/errata/RHSA-2026:4215", + "https://access.redhat.com/errata/RHSA-2026:4271", + "https://access.redhat.com/errata/RHSA-2026:4942", + "https://access.redhat.com/errata/RHSA-2026:5119", + "https://access.redhat.com/errata/RHSA-2026:61628", + "https://access.redhat.com/errata/RHSA-2026:6192", + "https://access.redhat.com/errata/RHSA-2026:62115", + "https://access.redhat.com/errata/RHSA-2026:6555", + "https://access.redhat.com/errata/RHSA-2026:6562", + "https://access.redhat.com/errata/RHSA-2026:6565", + "https://access.redhat.com/errata/RHSA-2026:7250", + "https://access.redhat.com/security/cve/CVE-2026-24049", + "https://advisory.echohq.com/cve/CVE-2026-24049", + "https://bugzilla.redhat.com/2431959", + "https://bugzilla.redhat.com/show_bug.cgi?id=2431959", + "https://creativecommons.org/licenses/by/4.0/", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-24049", + "https://errata.almalinux.org/10/ALSA-2026-1902.html", + "https://errata.rockylinux.org/RLSA-2026:1939", + "https://github.com/pypa/wheel", + "https://github.com/pypa/wheel/commit/7a7d2de96b22a9adf9208afcc9547e1001569fef", + "https://github.com/pypa/wheel/commit/934fe177ff912c8e03d5ae951d3805e1fd90ba5e", + "https://github.com/pypa/wheel/releases/tag/0.46.2", + "https://github.com/pypa/wheel/security/advisories/GHSA-8rrh-rw8j-w5fx", + "https://linux.oracle.com/cve/CVE-2026-24049.html", + "https://linux.oracle.com/errata/ELSA-2026-2090.html", + "https://nvd.nist.gov/vuln/detail/CVE-2026-24049", + "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-24049.json", + "https://ubuntu.com/security/notices/USN-8221-1", + "https://www.cve.org/CVERecord?id=CVE-2026-24049" + ], + "PublishedDate": "2026-01-22T05:16:23.157Z", + "LastModifiedDate": "2026-09-10T13:17:45.017Z" + } + ] + } + ] +} diff --git a/evidence/14-track1-run.log b/evidence/14-track1-run.log new file mode 100644 index 0000000..3884854 Binary files /dev/null and b/evidence/14-track1-run.log differ diff --git a/evidence/README.md b/evidence/README.md index 8df7001..6fb422e 100644 --- a/evidence/README.md +++ b/evidence/README.md @@ -1,5 +1,39 @@ -# Доказательства +# Доказательства — lab7 -Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки. +Все измерения сделаны 2026-11-27 на Docker Desktop Linux VM (6 CPU / 4 GiB), +проект `lab7`. Токены, пароли, ключи и unseal shares в evidence не выводятся. +Секреты лежат только в gitignored `secrets/`; CA private key — в +`secrets/ca-private/`. -Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно. +| Файл | Что доказывает | Команда | +| --- | --- | --- | +| [01-contract-check.txt](01-contract-check.txt) | offline structure, JSON, Python syntax | `make check` | +| [01-openapi-validation.txt](01-openapi-validation.txt) | OpenAPI 3.1 / JSON Schema | `make validate` | +| [02-public-smoke.txt](02-public-smoke.txt) | публичный smoke через HTTPS | `make test BASE_URL=https://localhost:8443 CA_FILE=certs/ca.crt` | +| [03-external-tls.txt](03-external-tls.txt) | доверенный CA проходит, чужой CA отклонён | `make test-security` | +| [04-mtls-matrix.json](04-mtls-matrix.json) | 33 положительные/отрицательные проверки матрицы (LB→API, broker, Collector, telemetry sidecars, OpenBao, PostgreSQL, S3) | `make mtls` | +| [05-security-checks.log](05-security-checks.log) | ACL 404, logout/expiry, rate limit 429+Retry-After на двух репликах, 413/415 | `make security-checks` | +| [06-argon2.txt](06-argon2.txt) | Argon2id m=19456,t=2,p=1; медиана hash/verify; rehash старого хэша | `docker exec ... python scripts/argon2_bench.py` | +| [07-container-hardening.json](07-container-hardening.json) | user, read_only, cap_drop, no-new-privileges, limits, published ports | `docker inspect` | +| [08-persistence.txt](08-persistence.txt) | restart API + PostgreSQL/MinIO/Rabbit/OpenBao с сохранением volumes/сессии | `make test-persistence ACTION_SCRIPT=scripts/restart.cmd` | +| [09-failover.txt](09-failover.txt) | остановка одной API-реплики, recovery и отсутствие дублей | `make test-failover ACTION_SCRIPT=scripts/stop-one.cmd` | +| [10-telemetry-leak.txt](10-telemetry-leak.txt) | Loki содержит логи, но не содержит уникальный пароль | `python scripts/telem_check.py` | +| [11-grafana.json](11-grafana.json) | Grafana HTTPS, datasources с TLS/mTLS, dashboard в Git | `python scripts/grafana_evidence.py` | +| [12-load.json](12-load.json) | closed-loop POST messages, 30 s, concurrency 4 (IPv4) | `tests/load.py --base-url https://127.0.0.1:8443` | +| [13-trivy-app.json](13-trivy-app.json) | Trivy HIGH/CRITICAL по app image (base OS) | `docker run ... trivy image ...` | +| [14-track1-run.log](14-track1-run.log) | полный вывод track1 | `make track1` | +| [openbao-sealed.txt](openbao-sealed.txt) | sealed OpenBao: работающая реплика жива, новая fail-closed, после unseal healthy | `sh scripts/openbao_seal_test.sh` | +| [track1/summary.json](track1/summary.json) | broad vs least privilege, отзыв identity, ротация 3 secrets, 5/5 ready, 0 дублей, leaf rotation | `make track1` | +| [track1/revocation-log.txt](track1/revocation-log.txt) | worker в restart loop после отзыва identity | inline-сценарий, методика в REPORT §5.2 | + +## Ограничения evidence + +- `localhost` на этом Windows-хосте сначала идёт в IPv6 и даёт ~2 s задержки + на новый TLS handshake; нагрузочный тест поэтому запускался на + `https://127.0.0.1:8443` (тот же сертификат/SAN). Публичный smoke проверен + и через `localhost`. +- Closed-loop load не является open-loop capacity proof; процентили считаются + только по успешным запросам. +- Trivy показывает пакеты base image Debian; применимость разобрана в REPORT. +- `revocation-log.txt` — отдельный срез после отзыва; `track1/summary.json` + содержит основной прогон с ротацией и восстановлением. diff --git a/evidence/openbao-sealed.txt b/evidence/openbao-sealed.txt new file mode 100644 index 0000000..a3b10c3 --- /dev/null +++ b/evidence/openbao-sealed.txt @@ -0,0 +1,11 @@ +# OpenBao sealed, 2026-11-27T12:24:23Z +existing API readiness through LB: 200 +new API container state: running restarts=0 health=starting +new API local /health/ready during seal: URLError +--- new API log lines since seal --- +mtls_identity_accepted +{"ts":"2026-11-27T12:24:24.155Z","level":"info","logger":"messenger","event":"request","request_id":"8f3d2eee87384b25b707df3b185c3ff2","method":"GET","route":"/health/ready","operation":"readiness","matched":true,"status":200,"duration_ms":19.627,"instance_id":"8d029c6c5deb","env":"lab","service.name":"messenger-api","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"8d029c6c5deb","trace_id":"db6120d47e65a5dd44955c43422367ad","span_id":"6bf802ce7a136676"} +mtls_listener_started +--- after unseal --- +readiness through LB: 200 +api-2 state: running health=healthy diff --git a/evidence/track1/revocation-log.txt b/evidence/track1/revocation-log.txt new file mode 100644 index 0000000..6cf1588 --- /dev/null +++ b/evidence/track1/revocation-log.txt @@ -0,0 +1,10 @@ +revocation at 2026-11-27T12:22:59Z +docker state: restarting health=unhealthy restarts=4 +{"ts":"2026-11-27T12:22:55.414Z","level":"info","logger":"messenger.telemetry","event":"telemetry_started","service_name":"messenger-worker","endpoint":"https://internal-gateway:4319","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f"} +{"ts":"2026-11-27T12:22:55.676Z","level":"info","logger":"messenger.worker","event":"worker_startup","worker_id":"5b55b6fa639f","pipeline_version":2,"concurrency":2,"prefetch":2,"lease_seconds":15.0,"max_attempts":5,"queue":"attachment.jobs","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f"} +{"ts":"2026-11-27T12:22:55.708Z","level":"info","logger":"aio_pika.robust_connection","event":"Connection to amqps://messenger-worker:******@internal-gateway:5672/ closed. Reconnecting after 5 seconds.","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f"} +{"ts":"2026-11-27T12:22:55.708Z","level":"error","logger":"messenger","event":"worker_fatal","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f","exception":"Traceback (most recent call last):\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/abc.py\", line 44, in __inner\n return await self.task\n ^^^^^^^^^^^^^^^\nasyncio.exceptions.CancelledError\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/src/messenger/worker.py\", line 615, in _run\n await worker.run()\n File \"/app/src/messenger/worker.py\", line 144, in run\n await self._broker.connect()\n File \"/app/src/messenger/broker.py\", line 125, in connect\n self._connection = await connect_robust(\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/robust_connection.py\", line 334, in connect_robust\n await connection.connect(timeout=timeout)\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/robust_connection.py\", line 180, in connect\n await self.__fail_fast_future\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/robust_connection.py\", line 135, in __connection_factory\n await Connection.connect(self, self.__connect_timeout)\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/connection.py\", line 125, in connect\n self.transport = await UnderlayConnection.connect(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/abc.py\", line 679, in connect\n connection = await cls.make_connection(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/abc.py\", line 667, in make_connection\n connection: aiormq.abc.AbstractConnection = await asyncio.wait_for(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/asyncio/tasks.py\", line 489, in wait_for\n return fut.result()\n ^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/connection.py\", line 920, in connect\n await connection.connect(client_properties or {})\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/base.py\", line 164, in wrap\n return await self.create_task(func(self, *args, **kwargs))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/abc.py\", line 46, in __inner\n raise self._exception from e\n File \"/usr/local/lib/python3.11/asyncio/tasks.py\", line 694, in _wrap_awaitable\n return (yield from awaitable.__await__())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/abc.py\", line 46, in __inner\n raise self._exception from e\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/connection.py\", line 484, in connect\n frame = await self._rpc(\n ^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/connection.py\", line 436, in _rpc\n raise ProbableAuthenticationError(frame.reply_text)\naiormq.exceptions.ProbableAuthenticationError: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile."} +{"ts":"2026-11-27T12:22:58.332Z","level":"info","logger":"messenger.telemetry","event":"telemetry_started","service_name":"messenger-worker","endpoint":"https://internal-gateway:4319","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f"} +{"ts":"2026-11-27T12:22:58.610Z","level":"info","logger":"messenger.worker","event":"worker_startup","worker_id":"5b55b6fa639f","pipeline_version":2,"concurrency":2,"prefetch":2,"lease_seconds":15.0,"max_attempts":5,"queue":"attachment.jobs","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f"} +{"ts":"2026-11-27T12:22:58.644Z","level":"info","logger":"aio_pika.robust_connection","event":"Connection to amqps://messenger-worker:******@internal-gateway:5672/ closed. Reconnecting after 5 seconds.","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f"} +{"ts":"2026-11-27T12:22:58.644Z","level":"error","logger":"messenger","event":"worker_fatal","env":"lab","service.name":"messenger-worker","service.version":"6.0.0","deployment.environment.name":"lab","service.instance.id":"5b55b6fa639f","exception":"Traceback (most recent call last):\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/abc.py\", line 44, in __inner\n return await self.task\n ^^^^^^^^^^^^^^^\nasyncio.exceptions.CancelledError\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/src/messenger/worker.py\", line 615, in _run\n await worker.run()\n File \"/app/src/messenger/worker.py\", line 144, in run\n await self._broker.connect()\n File \"/app/src/messenger/broker.py\", line 125, in connect\n self._connection = await connect_robust(\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/robust_connection.py\", line 334, in connect_robust\n await connection.connect(timeout=timeout)\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/robust_connection.py\", line 180, in connect\n await self.__fail_fast_future\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/robust_connection.py\", line 135, in __connection_factory\n await Connection.connect(self, self.__connect_timeout)\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/connection.py\", line 125, in connect\n self.transport = await UnderlayConnection.connect(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/abc.py\", line 679, in connect\n connection = await cls.make_connection(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aio_pika/abc.py\", line 667, in make_connection\n connection: aiormq.abc.AbstractConnection = await asyncio.wait_for(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/asyncio/tasks.py\", line 489, in wait_for\n return fut.result()\n ^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/connection.py\", line 920, in connect\n await connection.connect(client_properties or {})\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/base.py\", line 164, in wrap\n return await self.create_task(func(self, *args, **kwargs))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/abc.py\", line 46, in __inner\n raise self._exception from e\n File \"/usr/local/lib/python3.11/asyncio/tasks.py\", line 694, in _wrap_awaitable\n return (yield from awaitable.__await__())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/abc.py\", line 46, in __inner\n raise self._exception from e\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/connection.py\", line 484, in connect\n frame = await self._rpc(\n ^^^^^^^^^^^^^^^^\n File \"/opt/venv/lib/python3.11/site-packages/aiormq/connection.py\", line 436, in _rpc\n raise ProbableAuthenticationError(frame.reply_text)\naiormq.exceptions.ProbableAuthenticationError: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile."} diff --git a/evidence/track1/summary.json b/evidence/track1/summary.json new file mode 100644 index 0000000..e3fc062 --- /dev/null +++ b/evidence/track1/summary.json @@ -0,0 +1,48 @@ +{ + "broad_identity": { + "db_ddl_allowed": false, + "db_jobs_select_allowed": true, + "db_users_password_select_allowed": false, + "db_users_table_select_allowed": true, + "identity": "broad", + "rabbit_connect_allowed": true, + "rabbit_publish_allowed": true, + "s3_final_put_allowed": true, + "s3_foreign_prefix_get_allowed": true, + "s3_foreign_prefix_put_allowed": true, + "s3_list_bucket_all_allowed": true, + "s3_staging_put_allowed": true + }, + "certificate_rotation": { + "new_certificate": "ACCEPTED worker port (AMQP Connection.Start)", + "old_certificate": "REJECTED after handshake (revoked/denied identity)", + "rotation_log": "rotated worker leaf: old_serial=2446190e9c7c7567967e8ccd0cea868fabad5d55 new_serial=2446190e9c7c7567967e8ccd0cea868fabad5d56\nold certificate is in secrets/certs/tests/old-worker.crt and revocation list" + }, + "hypothesis": "least privilege ограничивает эффект компрометации worker-а; отзыв и ротация восстанавливают обработку без потери задач", + "least_privilege_worker": { + "db_ddl_allowed": false, + "db_jobs_select_allowed": true, + "db_users_password_select_allowed": false, + "db_users_table_select_allowed": false, + "identity": "worker", + "rabbit_connect_allowed": true, + "rabbit_publish_allowed": false, + "s3_final_put_allowed": true, + "s3_foreign_prefix_get_allowed": false, + "s3_foreign_prefix_put_allowed": false, + "s3_list_bucket_all_allowed": false, + "s3_staging_put_allowed": true + }, + "revocation": { + "attachments_ready_after_restore": 5, + "duplicate_variant_groups": 0, + "queued_after_revoke": 5, + "queued_before": 5, + "rotated": { + "broker": "rotated", + "db": "rotated", + "s3": "rotated" + }, + "worker_state_after_revoke": "restarting" + } +} \ No newline at end of file diff --git a/infra/README.md b/infra/README.md index 5a39e86..44bba52 100644 --- a/infra/README.md +++ b/infra/README.md @@ -1,7 +1,25 @@ -# Инфраструктура студента +# Инфраструктура lab7 -Здесь разместите конфигурации выбранных сервисов; основную топологию — в корневом compose.yaml/stack.yaml. `compose.example.yaml` — только worksheet ролей и намеренно не запускается. `contracts/infrastructure.json` задаёт минимальные роли, не готовые образы/пароли. +Топология и параметры — в корневом compose.yaml. Секреты в Git не хранятся. -В REPORT.md сопоставьте роль → service name → версия/digest → health/readiness → volume → сеть/порт → способ передачи credentials. Приведите bootstrap (schema, bucket, broker topology, а с lab6 provisioning) и безопасное повторение этих команд. +| Role | Service | Version | Health | Volume | Network / port | Credentials | +| --- | --- | --- | --- | --- | --- | --- | +| load_balancer | traefik | v3.5.4 | TCP 8443 | - | edge / 127.0.0.1:8443 | public + lb-client leaf | +| api x2 | api | local 7.0.0 | /health/live and Traefik /health/ready via mTLS | - | edge, app, data / none | AppRole api -> DB/S3/broker | +| worker | worker | local 7.0.0 | worker_health heartbeat | - | app, data / none | AppRole worker | +| relay | relay | local 7.0.0 | worker_health heartbeat | - | app, data / none | AppRole relay | +| postgres | postgres | 16.15 | pg_isready | pgdata | data / none | bootstrap superuser + app roles | +| s3 | minio | digest 14cea493 | https health/live | miniodata | data / none | root only minio-init; scoped users | +| broker | rabbitmq | 4.1.4 | diagnostics ping | rabbitmqdata | broker / none | root bootstrap; api/worker users | +| mtls gateway | internal-gateway | local 7.0.0 | TCP 5671 | - | app, broker, otelnet / none | gateway leaf + client | +| otel_collector | otel-collector | 0.140.0 | health_check 13133 | - | otelnet, telemetry, collectorscrape / none | telemetry-client | +| telemetry_storage | prometheus/loki/tempo | 3.7.3 / 3.6.2 / 2.9.0 | Prometheus health | promdata/lokidata/tempodata | private + telemetry / none | mTLS sidecars | +| grafana | grafana | 12.2.0 | HTTPS /api/health | grafanadata | telemetry, admin / 127.0.0.1:3000 | admin secret + grafana-client | +| openbao | openbao | 2.3.2 | /v1/sys/init | openbaodata | data, admin / 127.0.0.1:8200 | AppRole; root/unseal operator only | -Приложение строится из исходников. Не используйте заранее существующий образ преподавательского сервера вместо своей реализации. Restart hook перезапускает все соответствующие stores с volumes; failover hook останавливает только заданную API-реплику. +Bootstrap: scripts/bootstrap-certs.sh, bootstrap-secrets.sh, db-init.sh (roles +before migrations, grants after), minio-init.sh, openbao_bootstrap.py +(container openbao-bootstrap), bootstrap-rabbit.sh. Restart/failover: +scripts/restart.sh and scripts/stop-one.sh; volumes are not removed. +Stateful PostgreSQL/MinIO/RabbitMQ are an explained exception from +read_only/cap_drop: they need writable volumes and image capabilities. diff --git a/infra/gateway/api.json b/infra/gateway/api.json new file mode 100644 index 0000000..b9be846 --- /dev/null +++ b/infra/gateway/api.json @@ -0,0 +1,16 @@ +{ + "cert_file": "/certs/api-server.crt", + "key_file": "/certs/api-server.key", + "ca_file": "/certs/ca.crt", + "listeners": [ + { + "bind_host": "0.0.0.0", + "bind_port": 8081, + "allow_san": ["lb.messenger.internal"], + "backend_host": "127.0.0.1", + "backend_port": 8080, + "backend_tls": false, + "reject_mode": "http" + } + ] +} diff --git a/infra/gateway/collector-tls.json b/infra/gateway/collector-tls.json new file mode 100644 index 0000000..566bc3d --- /dev/null +++ b/infra/gateway/collector-tls.json @@ -0,0 +1,27 @@ +{ + "cert_file": "/certs/collector-tls.crt", + "key_file": "/certs/collector-tls.key", + "ca_file": "/certs/ca.crt", + "listeners": [ + { + "bind_host": "0.0.0.0", + "bind_port": 8889, + "allow_san": ["prometheus.messenger.internal"], + "backend_host": "otel-collector", + "backend_port": 8889, + "backend_tls": false, + "require_client_cert": true, + "reject_mode": "http" + }, + { + "bind_host": "0.0.0.0", + "bind_port": 8888, + "allow_san": ["prometheus.messenger.internal"], + "backend_host": "otel-collector", + "backend_port": 8888, + "backend_tls": false, + "require_client_cert": true, + "reject_mode": "http" + } + ] +} diff --git a/infra/gateway/internal.json b/infra/gateway/internal.json new file mode 100644 index 0000000..f36e04b --- /dev/null +++ b/infra/gateway/internal.json @@ -0,0 +1,57 @@ +{ + "cert_file": "/certs/gateway-server.crt", + "key_file": "/certs/gateway-server.key", + "ca_file": "/certs/ca.crt", + "revoked_serials_file": "/certs/revoked-serials.txt", + "backend_ca_file": "/certs/ca.crt", + "backend_cert_file": "/certs/gateway-client.crt", + "backend_key_file": "/certs/gateway-client.key", + "backend_server_name": "rabbitmq", + "listeners": [ + { + "bind_host": "0.0.0.0", + "bind_port": 5671, + "allow_san": ["api.messenger.internal", "relay.messenger.internal"], + "backend_host": "rabbitmq", + "backend_port": 5671, + "backend_tls": true, + "reject_mode": "close" + }, + { + "bind_host": "0.0.0.0", + "bind_port": 5672, + "allow_san": ["worker.messenger.internal"], + "backend_host": "rabbitmq", + "backend_port": 5671, + "backend_tls": true, + "reject_mode": "close" + }, + { + "bind_host": "0.0.0.0", + "bind_port": 4318, + "allow_san": ["api.messenger.internal"], + "backend_host": "otel-collector", + "backend_port": 4318, + "backend_tls": false, + "reject_mode": "http" + }, + { + "bind_host": "0.0.0.0", + "bind_port": 4319, + "allow_san": ["worker.messenger.internal"], + "backend_host": "otel-collector", + "backend_port": 4318, + "backend_tls": false, + "reject_mode": "http" + }, + { + "bind_host": "0.0.0.0", + "bind_port": 4320, + "allow_san": ["relay.messenger.internal"], + "backend_host": "otel-collector", + "backend_port": 4318, + "backend_tls": false, + "reject_mode": "http" + } + ] +} diff --git a/infra/gateway/loki-tls.json b/infra/gateway/loki-tls.json new file mode 100644 index 0000000..db0fecf --- /dev/null +++ b/infra/gateway/loki-tls.json @@ -0,0 +1,17 @@ +{ + "cert_file": "/certs/loki-tls.crt", + "key_file": "/certs/loki-tls.key", + "ca_file": "/certs/ca.crt", + "listeners": [ + { + "bind_host": "0.0.0.0", + "bind_port": 8443, + "allow_san": ["otel-collector.messenger.internal", "grafana.messenger.internal"], + "backend_host": "loki", + "backend_port": 3100, + "backend_tls": false, + "require_client_cert": true, + "reject_mode": "http" + } + ] +} diff --git a/infra/gateway/prometheus-tls.json b/infra/gateway/prometheus-tls.json new file mode 100644 index 0000000..6d9eee9 --- /dev/null +++ b/infra/gateway/prometheus-tls.json @@ -0,0 +1,17 @@ +{ + "cert_file": "/certs/prometheus-tls.crt", + "key_file": "/certs/prometheus-tls.key", + "ca_file": "/certs/ca.crt", + "listeners": [ + { + "bind_host": "0.0.0.0", + "bind_port": 8443, + "allow_san": ["grafana.messenger.internal"], + "backend_host": "prometheus", + "backend_port": 9090, + "backend_tls": false, + "require_client_cert": true, + "reject_mode": "http" + } + ] +} diff --git a/infra/gateway/tempo-tls.json b/infra/gateway/tempo-tls.json new file mode 100644 index 0000000..bc1897c --- /dev/null +++ b/infra/gateway/tempo-tls.json @@ -0,0 +1,28 @@ +{ + "cert_file": "/certs/tempo-tls.crt", + "key_file": "/certs/tempo-tls.key", + "ca_file": "/certs/ca.crt", + "listeners": [ + { + "bind_host": "0.0.0.0", + "bind_port": 8443, + "allow_san": ["otel-collector.messenger.internal", "grafana.messenger.internal"], + "backend_host": "tempo", + "backend_port": 3200, + "backend_tls": false, + "require_client_cert": true, + "reject_mode": "http" + }, + { + "bind_host": "0.0.0.0", + "bind_port": 4317, + "allow_san": ["otel-collector.messenger.internal"], + "backend_host": "tempo", + "backend_port": 4317, + "backend_tls": false, + "require_client_cert": true, + "alpn": ["h2"], + "reject_mode": "close" + } + ] +} diff --git a/infra/openbao/README.md b/infra/openbao/README.md index 0850e23..8a0375f 100644 --- a/infra/openbao/README.md +++ b/infra/openbao/README.md @@ -1,7 +1,10 @@ -# OpenBao — реализовать конфигурацию и политики +# OpenBao — реализация -Добавьте non-dev конфигурацию listener/storage/TLS, API/worker policies, bootstrap и rotation scripts. Credentials и unseal material создаются локально; здесь нет готового root token или private key. - -Решение должно показать реальную сервисную аутентификацию и получение нужного secret по ограниченной policy; просто работающий контейнер OpenBao не засчитывается. На 3 статический KV secret допустим. На 4 покажите expiry/renewal/rotation и allow/deny. Путь KV v2 data/metadata и ACL должен соответствовать фактическому mount; не копируйте широкое `path "*"` для приложения. - -Документируйте шаги оператора init/unseal и восстановление после restart. Скрипт не должен печатать tokens/shares или хранить их в Git. См. contracts/trust-matrix.md и REPORT.md. +- config.hcl: file storage, TLS listener, api/cluster address, no dev-mode. +- entrypoint.sh: готовит /openbao/data владельцу openbao и запускает server. +- bootstrap и policies: scripts/openbao_bootstrap.py (KV v2, AppRole, + messenger-api/worker/relay). Root token и unseal shares — только в + gitignored secrets/openbao-init.json. +- Unseal после рестарта: scripts/restart.sh вызывает openbao-bootstrap. +- Приложение: secrets_provider.py, AppRole login, TTL 300/900, policy только + на свой kv/data path. Проверки — scripts/mtls_probe.py и openbao_sealed.txt. diff --git a/infra/openbao/config.hcl b/infra/openbao/config.hcl new file mode 100644 index 0000000..30ae799 --- /dev/null +++ b/infra/openbao/config.hcl @@ -0,0 +1,24 @@ +# OpenBao вне dev-mode: файловое persistent storage и TLS listener. +# Unseal выполняет оператор (scripts/bootstrap-openbao.sh / openbao_bootstrap.py), +# root token существует только в bootstrap и не передаётся приложениям. +ui = false +disable_mlock = true +api_addr = "https://openbao:8200" +cluster_addr = "https://openbao:8201" + +storage "file" { + path = "/openbao/data" +} + +listener "tcp" { + address = "0.0.0.0:8200" + tls_disable = false + tls_cert_file = "/certs/openbao.crt" + tls_key_file = "/certs/openbao.key" + tls_min_version = "tls12" +} + +telemetry { + disable_hostname = true + prometheus_retention_time = "24h" +} diff --git a/infra/openbao/entrypoint.sh b/infra/openbao/entrypoint.sh new file mode 100644 index 0000000..dae4960 --- /dev/null +++ b/infra/openbao/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# OpenBao image запускает сервер от uid 100 (openbao). Named volume создаётся +# root-ом, поэтому каталог данных готовится здесь, до su-exec. +set -eu +mkdir -p /openbao/data +chown -R openbao:openbao /openbao/data +exec docker-entrypoint.sh server -config=/openbao/config.hcl diff --git a/infra/otel/README.md b/infra/otel/README.md index c46fe89..fd34ae2 100644 --- a/infra/otel/README.md +++ b/infra/otel/README.md @@ -1,7 +1,11 @@ -# Конфигурация наблюдаемости — реализовать +# Наблюдаемость — реализация -Добавьте `collector.yaml` с OTLP receivers, processors и exporters выбранной версии Collector. Укажите явные bind endpoints, внутренние сети, memory limits/batch и поведение при backpressure по уровню. Сопоставьте все три pipeline с реально развёрнутыми backend. - -Добавьте конфигурации storage, Grafana provisioning/datasources, provisioning/dashboards и импортируемые dashboard JSON. На 4 — alert rules и runbooks. Пустой dashboard или debug exporter, который только печатает данные в stdout, не заменяют хранилища/доказательства из `contracts/observability.md`. - -Не публикуйте OTLP/metrics/административные ports в общую сеть без необходимости. В lab7 реализуйте TLS/mTLS по trust matrix; экспорт Authorization и message bodies запрещён. +- observability/otel-collector/config.yaml: OTLP HTTP receiver, memory limiter, + tail sampling, exporters to Tempo (mTLS) and Loki (mTLS). +- Collector не публикует порты. internal-gateway даёт mTLS-фронт для API, + worker и relay; collector plaintext только в изолированной lab7_otelnet. +- Prometheus scrape -> collector-tls (mTLS, prometheus-client). Grafana -> + prometheus-tls/loki-tls/tempo-tls с grafana-client. Sidecar-конфиги в + infra/gateway, провижининг — observability/grafana. +- Dashboard messenger-lab7, datasources с tlsAuth; evidence — 11-grafana.json, + 10-telemetry-leak.txt. diff --git a/infra/postgres/entrypoint.sh b/infra/postgres/entrypoint.sh new file mode 100644 index 0000000..7d7d270 --- /dev/null +++ b/infra/postgres/entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Копирует TLS-материал в принадлежащий postgres каталог: PostgreSQL требует +# key 0600 и владельца-пользователя БД. Исходники смонтированы read-only. +set -eu +mkdir -p /var/lib/postgresql/pgcerts +cp /certs/postgres.crt /var/lib/postgresql/pgcerts/server.crt +cp /certs/postgres.key /var/lib/postgresql/pgcerts/server.key +cp /certs/ca.crt /var/lib/postgresql/pgcerts/ca.crt +chown -R postgres:postgres /var/lib/postgresql/pgcerts +chmod 600 /var/lib/postgresql/pgcerts/server.key +exec docker-entrypoint.sh postgres \ + -c ssl=on \ + -c ssl_cert_file=/var/lib/postgresql/pgcerts/server.crt \ + -c ssl_key_file=/var/lib/postgresql/pgcerts/server.key \ + -c ssl_ca_file=/var/lib/postgresql/pgcerts/ca.crt \ + -c ssl_min_protocol_version=TLSv1.2 \ + -c hba_file=/etc/postgresql/pg_hba.conf diff --git a/infra/postgres/pg_hba.conf b/infra/postgres/pg_hba.conf new file mode 100644 index 0000000..e55f14e --- /dev/null +++ b/infra/postgres/pg_hba.conf @@ -0,0 +1,5 @@ +# Только TLS для сетевых подключений. Plaintext host-соединение отклоняется, +# local socket нужен healthcheck-у и операторским psql внутри контейнера. +local all all trust +hostssl all all all scram-sha-256 +hostnossl all all all reject diff --git a/infra/rabbitmq/rabbitmq.conf b/infra/rabbitmq/rabbitmq.conf new file mode 100644 index 0000000..d36a30b --- /dev/null +++ b/infra/rabbitmq/rabbitmq.conf @@ -0,0 +1,13 @@ +# AMQP только через TLS 5671; plaintext listener 5672 отключён. +# RabbitMQ проверяет клиентский сертификат (его предъявляет mTLS-шлюз) по +# внутреннему CA. Учётные данные пользователей дополнительно ограничены +# регулярными выражениями permissions (см. scripts/bootstrap-rabbit.sh). +listeners.tcp = none +listeners.ssl.default = 5671 +ssl_options.cacertfile = /certs/ca.crt +ssl_options.certfile = /certs/rabbitmq.crt +ssl_options.keyfile = /certs/rabbitmq.key +ssl_options.verify = verify_peer +ssl_options.fail_if_no_peer_cert = true + +loopback_users = none diff --git a/infra/traefik/dynamic.yml b/infra/traefik/dynamic.yml new file mode 100644 index 0000000..126eb9d --- /dev/null +++ b/infra/traefik/dynamic.yml @@ -0,0 +1,22 @@ +# Динамическая конфигурация Traefik: публичный сертификат и mTLS transport +# к API-репликам. insecureSkipVerify выключен; LB предъявляет lb-client cert, +# а API проверяет SAN lb.messenger.internal. +http: + serversTransports: + api-mtls: + serverName: api.messenger.internal + rootCAs: + - /certs/ca.crt + certificates: + - certFile: /certs/lb-client.crt + keyFile: /certs/lb-client.key + insecureSkipVerify: false +tls: + certificates: + - certFile: /certs/public.crt + keyFile: /certs/public.key + stores: + default: + defaultCertificate: + certFile: /certs/public.crt + keyFile: /certs/public.key diff --git a/migrations/env.py b/migrations/env.py new file mode 100644 index 0000000..8478d56 --- /dev/null +++ b/migrations/env.py @@ -0,0 +1,58 @@ +"""Окружение Alembic: URL базы берётся из тех же переменных, что и у приложения.""" +from __future__ import annotations + +import asyncio +from logging.config import fileConfig + +from alembic import context +from sqlalchemy import pool +from sqlalchemy.ext.asyncio import async_engine_from_config + +from messenger.config import database_url_from_env +from messenger.schema import METADATA + +config = context.config + +if config.config_file_name is not None: + fileConfig(config.config_file_name) + +# Сравнение идёт ровно с теми объектами, по которым работает приложение: +# расхождение между схемой и миграциями ловится на `alembic check`. +target_metadata = METADATA + + +def run_migrations_offline() -> None: + """Режим без подключения: печатает SQL миграции, удобен для ревью.""" + context.configure( + url=database_url_from_env(), + target_metadata=target_metadata, + literal_binds=True, + compare_type=True, + dialect_opts={"paramstyle": "named"}, + ) + with context.begin_transaction(): + context.run_migrations() + + +def _run_migrations(connection) -> None: + context.configure(connection=connection, target_metadata=target_metadata, compare_type=True) + with context.begin_transaction(): + context.run_migrations() + + +async def run_migrations_online() -> None: + """Драйвер асинхронный (asyncpg), поэтому миграции идут через run_sync.""" + section = config.get_section(config.config_ini_section, {}) + section["sqlalchemy.url"] = database_url_from_env() + engine = async_engine_from_config(section, prefix="sqlalchemy.", poolclass=pool.NullPool) + try: + async with engine.connect() as connection: + await connection.run_sync(_run_migrations) + finally: + await engine.dispose() + + +if context.is_offline_mode(): + run_migrations_offline() +else: + asyncio.run(run_migrations_online()) diff --git a/migrations/script.py.mako b/migrations/script.py.mako new file mode 100644 index 0000000..c6284cb --- /dev/null +++ b/migrations/script.py.mako @@ -0,0 +1,24 @@ +"""${message} + +Revision ID: ${up_revision} +Revises: ${down_revision | comma,n} +Create Date: ${create_date} +""" +from __future__ import annotations + +from alembic import op +import sqlalchemy as sa +${imports if imports else ""} + +revision = ${repr(up_revision)} +down_revision = ${repr(down_revision)} +branch_labels = ${repr(branch_labels)} +depends_on = ${repr(depends_on)} + + +def upgrade() -> None: + ${upgrades if upgrades else "pass"} + + +def downgrade() -> None: + ${downgrades if downgrades else "pass"} diff --git a/migrations/versions/0001_initial_schema.py b/migrations/versions/0001_initial_schema.py new file mode 100644 index 0000000..4cdd21c --- /dev/null +++ b/migrations/versions/0001_initial_schema.py @@ -0,0 +1,103 @@ +"""Начальная схема: пользователи, чаты, участники и сообщения + +Revision ID: 0001_initial_schema +Revises: +Create Date: 2026-10-11 + +DDL написан вручную и повторяет src/messenger/schema.py: имена ограничений +и индексов совпадают, поэтому `alembic check` не находит расхождений между +схемой в базе и описанием, по которому работают запросы. +""" +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +revision = "0001_initial_schema" +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.create_table( + "users", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("username", sa.Text(), nullable=False), + sa.Column("display_name", sa.Text(), nullable=False), + sa.Column("password_hash", sa.Text(), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint( + "char_length(display_name) BETWEEN 1 AND 100", name="ck_users_display_name_length" + ), + sa.CheckConstraint(r"username ~ '^[a-z0-9_]{3,32}$'", name="ck_users_username_format"), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("username", name="uq_users_username"), + ) + + op.create_table( + "chats", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("title", sa.Text(), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint("char_length(title) BETWEEN 1 AND 100", name="ck_chats_title_length"), + sa.PrimaryKeyConstraint("id"), + ) + + op.create_table( + "chat_members", + sa.Column("chat_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.ForeignKeyConstraint( + ["chat_id"], ["chats.id"], name="fk_chat_members_chat", ondelete="CASCADE" + ), + sa.ForeignKeyConstraint( + ["user_id"], ["users.id"], name="fk_chat_members_user", ondelete="RESTRICT" + ), + sa.PrimaryKeyConstraint("chat_id", "user_id"), + ) + op.create_index("ix_chat_members_user_id_chat_id", "chat_members", ["user_id", "chat_id"]) + + op.create_table( + "messages", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("chat_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("sender_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("text", sa.Text(), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint( + "text <> '' AND char_length(text) <= 4000", name="ck_messages_text_length" + ), + sa.ForeignKeyConstraint(["chat_id"], ["chats.id"], name="fk_messages_chat", ondelete="CASCADE"), + sa.ForeignKeyConstraint( + ["sender_id"], ["users.id"], name="fk_messages_sender", ondelete="RESTRICT" + ), + sa.PrimaryKeyConstraint("id"), + ) + # Порядок истории (created_at, id) и keyset-предикат обслуживает один индекс. + op.create_index("ix_messages_chat_id_created_at_id", "messages", ["chat_id", "created_at", "id"]) + + +def downgrade() -> None: + op.drop_index("ix_messages_chat_id_created_at_id", table_name="messages") + op.drop_table("messages") + op.drop_index("ix_chat_members_user_id_chat_id", table_name="chat_members") + op.drop_table("chat_members") + op.drop_table("chats") + op.drop_table("users") diff --git a/migrations/versions/0002_message_idempotency.py b/migrations/versions/0002_message_idempotency.py new file mode 100644 index 0000000..56f714e --- /dev/null +++ b/migrations/versions/0002_message_idempotency.py @@ -0,0 +1,61 @@ +"""Общая идемпотентность отправки сообщения + +Revision ID: 0002_message_idempotency +Revises: 0001_initial_schema +Create Date: 2026-10-30 + +Таблица описана в src/messenger/schema.py; DDL повторяет имена ограничений и +индексов, чтобы alembic check не находил расхождений. +""" +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +revision = "0002_message_idempotency" +down_revision = "0001_initial_schema" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.create_table( + "message_idempotency", + sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("chat_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("idempotency_key", sa.Text(), nullable=False), + sa.Column("request_hash", sa.Text(), nullable=False), + sa.Column("message_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint( + "char_length(idempotency_key) BETWEEN 1 AND 128", + name="ck_message_idempotency_key_length", + ), + sa.ForeignKeyConstraint( + ["chat_id"], ["chats.id"], name="fk_message_idempotency_chat", ondelete="CASCADE" + ), + sa.ForeignKeyConstraint( + ["message_id"], + ["messages.id"], + name="fk_message_idempotency_message", + ondelete="CASCADE", + ), + sa.ForeignKeyConstraint( + ["user_id"], ["users.id"], name="fk_message_idempotency_user", ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("user_id", "chat_id", "idempotency_key"), + ) + op.create_index( + "ix_message_idempotency_created_at", "message_idempotency", ["created_at"] + ) + + +def downgrade() -> None: + op.drop_index("ix_message_idempotency_created_at", table_name="message_idempotency") + op.drop_table("message_idempotency") diff --git a/migrations/versions/0003_attachments.py b/migrations/versions/0003_attachments.py new file mode 100644 index 0000000..d138708 --- /dev/null +++ b/migrations/versions/0003_attachments.py @@ -0,0 +1,128 @@ +"""Вложения и связь сообщений с вложениями + +Revision ID: 0003_attachments +Revises: 0002_message_idempotency +Create Date: 2026-11-06 + +DDL повторяет src/messenger/schema.py, включая имена ограничений и индексов, +поэтому `alembic check` не находит расхождений. Отдельно ослабляется CHECK +текста сообщения: пустая строка теперь допустима только вместе с вложением, +а это правило проверяет API (CHECK не может ссылаться на другую таблицу). +""" +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +revision = "0003_attachments" +down_revision = "0002_message_idempotency" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.create_table( + "attachments", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("chat_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("owner_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("object_key", sa.Text(), nullable=False), + sa.Column("filename", sa.Text(), nullable=False), + sa.Column("content_type", sa.Text(), nullable=False), + sa.Column("size_bytes", sa.BigInteger(), nullable=False), + sa.Column("sha256", sa.Text(), nullable=False), + sa.Column("status", sa.Text(), server_default=sa.text("'pending'"), nullable=False), + sa.Column("error_code", sa.Text(), nullable=True), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column( + "updated_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint( + "char_length(filename) BETWEEN 1 AND 255", name="ck_attachments_filename_length" + ), + sa.CheckConstraint( + "content_type IN ('image/png','image/jpeg')", name="ck_attachments_content_type" + ), + sa.CheckConstraint( + "size_bytes > 0 AND size_bytes <= 10485760", name="ck_attachments_size_bytes" + ), + sa.CheckConstraint("sha256 ~ '^[a-f0-9]{64}$'", name="ck_attachments_sha256"), + sa.CheckConstraint( + "status IN ('pending','ready','failed')", name="ck_attachments_status" + ), + sa.CheckConstraint( + "error_code IS NULL OR char_length(error_code) BETWEEN 1 AND 64", + name="ck_attachments_error_code", + ), + sa.ForeignKeyConstraint( + ["chat_id"], ["chats.id"], name="fk_attachments_chat", ondelete="CASCADE" + ), + sa.ForeignKeyConstraint( + ["owner_id"], ["users.id"], name="fk_attachments_owner", ondelete="RESTRICT" + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("object_key", name="uq_attachments_object_key"), + ) + op.create_index( + "ix_attachments_chat_id_created_at_id", + "attachments", + ["chat_id", "created_at", "id"], + ) + op.create_index("ix_attachments_status_updated_at", "attachments", ["status", "updated_at"]) + + op.create_table( + "message_attachments", + sa.Column("message_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("attachment_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("position", sa.SmallInteger(), nullable=False), + sa.CheckConstraint( + "position >= 0 AND position < 10", name="ck_message_attachments_position" + ), + sa.ForeignKeyConstraint( + ["attachment_id"], + ["attachments.id"], + name="fk_message_attachments_attachment", + ondelete="RESTRICT", + ), + sa.ForeignKeyConstraint( + ["message_id"], + ["messages.id"], + name="fk_message_attachments_message", + ondelete="CASCADE", + ), + sa.PrimaryKeyConstraint("message_id", "attachment_id"), + sa.UniqueConstraint( + "message_id", "position", name="uq_message_attachments_position" + ), + ) + op.create_index( + "ix_message_attachments_attachment_id", + "message_attachments", + ["attachment_id"], + ) + + op.drop_constraint("ck_messages_text_length", "messages", type_="check") + op.create_check_constraint( + "ck_messages_text_length", "messages", "char_length(text) <= 4000" + ) + + +def downgrade() -> None: + op.drop_constraint("ck_messages_text_length", "messages", type_="check") + op.create_check_constraint( + "ck_messages_text_length", "messages", "text <> '' AND char_length(text) <= 4000" + ) + op.drop_index("ix_message_attachments_attachment_id", table_name="message_attachments") + op.drop_table("message_attachments") + op.drop_index("ix_attachments_status_updated_at", table_name="attachments") + op.drop_index("ix_attachments_chat_id_created_at_id", table_name="attachments") + op.drop_table("attachments") diff --git a/migrations/versions/0004_async_pipeline.py b/migrations/versions/0004_async_pipeline.py new file mode 100644 index 0000000..a82baac --- /dev/null +++ b/migrations/versions/0004_async_pipeline.py @@ -0,0 +1,292 @@ +"""Асинхронный pipeline: staging, jobs, outbox, варианты и аудит + +Revision ID: 0004_async_pipeline +Revises: 0003_attachments +Create Date: 2026-11-20 + +DDL повторяет src/messenger/schema.py, включая имена ограничений и индексов. +Существующие lab4-вложения трактуются консервативно: staging_key сбрасывается +в прежний object_key, завершённые ready-строки сохраняются, а незавершённые +pending-строки помечаются failed с безопасным error_code. +""" +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +revision = "0004_async_pipeline" +down_revision = "0003_attachments" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.add_column("attachments", sa.Column("staging_key", sa.Text(), nullable=True)) + op.add_column( + "attachments", + sa.Column("pipeline_version", sa.Integer(), server_default=sa.text("0"), nullable=False), + ) + op.add_column( + "attachments", + sa.Column("ready_at", postgresql.TIMESTAMP(timezone=True), nullable=True), + ) + op.execute("UPDATE attachments SET staging_key = object_key WHERE staging_key IS NULL") + op.alter_column("attachments", "staging_key", nullable=False) + op.create_unique_constraint("uq_attachments_staging_key", "attachments", ["staging_key"]) + + op.drop_constraint("ck_attachments_status", "attachments", type_="check") + op.execute( + "UPDATE attachments SET status = 'failed', error_code = 'legacy_pending' " + "WHERE status = 'pending'" + ) + op.alter_column( + "attachments", "status", server_default=sa.text("'queued'"), existing_type=sa.Text() + ) + op.create_check_constraint( + "ck_attachments_status", + "attachments", + "status IN ('queued','processing','ready','failed')", + ) + op.create_check_constraint( + "ck_attachments_pipeline_version", "attachments", "pipeline_version >= 0" + ) + + op.create_table( + "jobs", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("attachment_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("pipeline_version", sa.Integer(), nullable=False), + sa.Column( + "type", + sa.Text(), + server_default=sa.text("'attachment.process.v1'"), + nullable=False, + ), + sa.Column("state", sa.Text(), server_default=sa.text("'queued'"), nullable=False), + sa.Column("attempts", sa.Integer(), server_default=sa.text("0"), nullable=False), + sa.Column("max_attempts", sa.Integer(), nullable=False), + sa.Column("lease_token", postgresql.UUID(as_uuid=True), nullable=True), + sa.Column("worker_id", sa.Text(), nullable=True), + sa.Column( + "lease_expires_at", postgresql.TIMESTAMP(timezone=True), nullable=True + ), + sa.Column("next_attempt_at", postgresql.TIMESTAMP(timezone=True), nullable=True), + sa.Column("last_error_code", sa.Text(), nullable=True), + sa.Column("replay_of", postgresql.UUID(as_uuid=True), nullable=True), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column( + "updated_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column("finished_at", postgresql.TIMESTAMP(timezone=True), nullable=True), + sa.CheckConstraint("pipeline_version >= 1", name="ck_jobs_pipeline_version"), + sa.CheckConstraint( + "state IN ('queued','processing','ready','failed','superseded')", + name="ck_jobs_state", + ), + sa.CheckConstraint("attempts >= 0", name="ck_jobs_attempts"), + sa.CheckConstraint("max_attempts >= 1", name="ck_jobs_max_attempts"), + sa.CheckConstraint( + "last_error_code IS NULL OR char_length(last_error_code) BETWEEN 1 AND 64", + name="ck_jobs_last_error_code", + ), + sa.ForeignKeyConstraint( + ["attachment_id"], ["attachments.id"], name="fk_jobs_attachment", ondelete="CASCADE" + ), + sa.ForeignKeyConstraint( + ["replay_of"], ["jobs.id"], name="fk_jobs_replay_of", ondelete="SET NULL" + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index("ix_jobs_attachment_id", "jobs", ["attachment_id"]) + op.create_index("ix_jobs_state_next_attempt_at", "jobs", ["state", "next_attempt_at"]) + op.create_index("ix_jobs_lease_expires_at", "jobs", ["lease_expires_at"]) + op.create_index( + "uq_jobs_initial_attachment_version", + "jobs", + ["attachment_id", "pipeline_version"], + unique=True, + postgresql_where=sa.text("replay_of IS NULL"), + ) + + op.create_table( + "outbox", + sa.Column("id", sa.BigInteger(), autoincrement=True, nullable=False), + sa.Column("job_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column( + "available_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column("published_at", postgresql.TIMESTAMP(timezone=True), nullable=True), + sa.Column("attempts", sa.Integer(), server_default=sa.text("0"), nullable=False), + sa.Column("last_error", sa.Text(), nullable=True), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.ForeignKeyConstraint( + ["job_id"], ["jobs.id"], name="fk_outbox_job", ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index("ix_outbox_due", "outbox", ["published_at", "available_at"]) + op.create_index( + "uq_outbox_pending_job", + "outbox", + ["job_id"], + unique=True, + postgresql_where=sa.text("published_at IS NULL"), + ) + + op.create_table( + "variants", + sa.Column("attachment_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("pipeline_version", sa.Integer(), nullable=False), + sa.Column("name", sa.Text(), nullable=False), + sa.Column("content_type", sa.Text(), nullable=False), + sa.Column("object_key", sa.Text(), nullable=False), + sa.Column("size_bytes", sa.BigInteger(), nullable=False), + sa.Column("sha256", sa.Text(), nullable=False), + sa.Column("width", sa.Integer(), nullable=False), + sa.Column("height", sa.Integer(), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint("pipeline_version >= 1", name="ck_variants_pipeline_version"), + sa.CheckConstraint("name IN ('thumbnail','crop','optimized')", name="ck_variants_name"), + sa.CheckConstraint( + "content_type IN ('image/jpeg','image/png','image/webp')", + name="ck_variants_content_type", + ), + sa.CheckConstraint("size_bytes > 0", name="ck_variants_size_bytes"), + sa.CheckConstraint("width > 0 AND height > 0", name="ck_variants_dimensions"), + sa.CheckConstraint("sha256 ~ '^[a-f0-9]{64}$'", name="ck_variants_sha256"), + sa.ForeignKeyConstraint( + ["attachment_id"], + ["attachments.id"], + name="fk_variants_attachment", + ondelete="CASCADE", + ), + sa.PrimaryKeyConstraint("attachment_id", "pipeline_version", "name"), + sa.UniqueConstraint("object_key", name="uq_variants_object_key"), + ) + op.create_index("ix_variants_attachment_id", "variants", ["attachment_id"]) + + op.create_table( + "job_events", + sa.Column("id", sa.BigInteger(), autoincrement=True, nullable=False), + sa.Column("job_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("from_state", sa.Text(), nullable=True), + sa.Column("to_state", sa.Text(), nullable=False), + sa.Column("attempt", sa.Integer(), nullable=True), + sa.Column("error_code", sa.Text(), nullable=True), + sa.Column("worker_id", sa.Text(), nullable=True), + sa.Column("detail", sa.Text(), nullable=True), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.ForeignKeyConstraint( + ["job_id"], ["jobs.id"], name="fk_job_events_job", ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index("ix_job_events_job_id_created_at", "job_events", ["job_id", "created_at"]) + + op.create_table( + "job_replays", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("source_job_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("replay_job_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("requested_by", sa.Text(), nullable=False), + sa.Column("reason", sa.Text(), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint( + "char_length(requested_by) BETWEEN 1 AND 128", + name="ck_job_replays_requested_by", + ), + sa.CheckConstraint("char_length(reason) BETWEEN 1 AND 512", name="ck_job_replays_reason"), + sa.ForeignKeyConstraint( + ["replay_job_id"], + ["jobs.id"], + name="fk_job_replays_replay", + ondelete="CASCADE", + ), + sa.ForeignKeyConstraint( + ["source_job_id"], + ["jobs.id"], + name="fk_job_replays_source", + ondelete="CASCADE", + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("replay_job_id", name="uq_job_replays_replay_job"), + ) + + op.create_table( + "fault_flags", + sa.Column("kind", sa.Text(), nullable=False), + sa.Column("remaining", sa.Integer(), nullable=False), + sa.Column( + "updated_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.CheckConstraint("remaining >= 0", name="ck_fault_flags_remaining"), + sa.PrimaryKeyConstraint("kind"), + ) + + +def downgrade() -> None: + op.drop_table("fault_flags") + op.drop_table("job_replays") + op.drop_index("ix_job_events_job_id_created_at", table_name="job_events") + op.drop_table("job_events") + op.drop_index("ix_variants_attachment_id", table_name="variants") + op.drop_table("variants") + op.drop_index("uq_outbox_pending_job", table_name="outbox") + op.drop_index("ix_outbox_due", table_name="outbox") + op.drop_table("outbox") + op.drop_index("uq_jobs_initial_attachment_version", table_name="jobs") + op.drop_index("ix_jobs_lease_expires_at", table_name="jobs") + op.drop_index("ix_jobs_state_next_attempt_at", table_name="jobs") + op.drop_index("ix_jobs_attachment_id", table_name="jobs") + op.drop_table("jobs") + + op.drop_constraint("ck_attachments_pipeline_version", "attachments", type_="check") + op.drop_constraint("ck_attachments_status", "attachments", type_="check") + op.execute("UPDATE attachments SET status = 'pending' WHERE status = 'failed'") + op.create_check_constraint( + "ck_attachments_status", + "attachments", + "status IN ('pending','ready','failed')", + ) + op.alter_column( + "attachments", "status", server_default=sa.text("'pending'"), existing_type=sa.Text() + ) + op.drop_constraint("uq_attachments_staging_key", "attachments", type_="unique") + op.drop_column("attachments", "ready_at") + op.drop_column("attachments", "pipeline_version") + op.drop_column("attachments", "staging_key") diff --git a/migrations/versions/0005_observability.py b/migrations/versions/0005_observability.py new file mode 100644 index 0000000..1b3da34 --- /dev/null +++ b/migrations/versions/0005_observability.py @@ -0,0 +1,29 @@ +"""W3C trace context для фоновой обработки + +Revision ID: 0005_observability +Revises: 0004_async_pipeline +Create Date: 2026-11-27 + +Job создаётся в транзакции upload-запроса, поэтому traceparent/tracestate +фиксируются вместе с намерением обработки. Relay продолжает этот trace при +публикации, worker — при consume; retry остаётся в том же trace. +""" +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op + +revision = "0005_observability" +down_revision = "0004_async_pipeline" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.add_column("jobs", sa.Column("traceparent", sa.Text(), nullable=True)) + op.add_column("jobs", sa.Column("tracestate", sa.Text(), nullable=True)) + + +def downgrade() -> None: + op.drop_column("jobs", "tracestate") + op.drop_column("jobs", "traceparent") diff --git a/migrations/versions/0006_security.py b/migrations/versions/0006_security.py new file mode 100644 index 0000000..4cfe7db --- /dev/null +++ b/migrations/versions/0006_security.py @@ -0,0 +1,75 @@ +"""Сессии в PostgreSQL и общий для реплик лимит попыток входа + +Revision ID: 0006_security +Revises: 0005_observability +Create Date: 2026-11-27 + +В lab6 сессии жили в Valkey. В lab7 Valkey убран из стенда: сессии перенесены +в PostgreSQL, чтобы не добавлять ещё один TLS-канал и ещё один набор +учётных данных. Токен хранится только как SHA-256. +""" +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +revision = "0006_security" +down_revision = "0005_observability" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.create_table( + "sessions", + sa.Column("token_hash", sa.Text(), nullable=False), + sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column( + "created_at", + postgresql.TIMESTAMP(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column("expires_at", postgresql.TIMESTAMP(timezone=True), nullable=False), + sa.CheckConstraint(r"token_hash ~ '^[a-f0-9]{64}$'", name="ck_sessions_token_hash"), + sa.ForeignKeyConstraint( + ["user_id"], ["users.id"], name="fk_sessions_user", ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("token_hash"), + ) + op.create_index("ix_sessions_expires_at", "sessions", ["expires_at"]) + op.create_index("ix_sessions_user_id", "sessions", ["user_id"]) + + op.create_table( + "login_rate_limits", + sa.Column("bucket", sa.Text(), nullable=False), + sa.Column("window_start", postgresql.TIMESTAMP(timezone=True), nullable=False), + sa.Column("attempts", sa.Integer(), server_default=sa.text("0"), nullable=False), + sa.Column("blocked_until", postgresql.TIMESTAMP(timezone=True), nullable=True), + sa.CheckConstraint("attempts >= 0", name="ck_login_rate_limits_attempts"), + sa.CheckConstraint( + "char_length(bucket) BETWEEN 1 AND 200", name="ck_login_rate_limits_bucket" + ), + sa.PrimaryKeyConstraint("bucket"), + ) + + # Роли создаёт scripts/db-init.sh до миграций. Условие EXISTS делает + # миграцию пригодной и для локального запуска без стенда. + op.execute( + """ + DO $$ + BEGIN + IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'messenger_api') THEN + EXECUTE 'GRANT SELECT, INSERT, UPDATE, DELETE ON sessions, login_rate_limits TO messenger_api'; + END IF; + END $$; + """ + ) + + +def downgrade() -> None: + op.drop_table("login_rate_limits") + op.drop_index("ix_sessions_user_id", table_name="sessions") + op.drop_index("ix_sessions_expires_at", table_name="sessions") + op.drop_table("sessions") diff --git a/observability/grafana/dashboards/messenger-lab7.json b/observability/grafana/dashboards/messenger-lab7.json new file mode 100644 index 0000000..0d9ca4d --- /dev/null +++ b/observability/grafana/dashboards/messenger-lab7.json @@ -0,0 +1,963 @@ +{ + "uid": "messenger-lab7", + "title": "Messenger — Observability (lab7)", + "description": "API/worker сигналы, SLO, очередь, saturation Рё telemetry pipeline. Данные — своего приложения.", + "tags": [ + "lab7", + "messenger", + "otel" + ], + "timezone": "browser", + "schemaVersion": 41, + "version": 1, + "refresh": "10s", + "time": { + "from": "now-30m", + "to": "now" + }, + "editable": false, + "graphTooltip": 1, + "panels": [ + { + "id": 1, + "type": "stat", + "title": "API RPS", + "description": "Р’СЃРµ бизнес-запросы API; health исключён.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 0, + "w": 6, + "h": 4 + }, + "fieldConfig": { + "defaults": { + "unit": "reqps", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 0.02 + }, + { + "color": "red", + "value": 0.05 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value" + }, + "targets": [ + { + "refId": "A", + "expr": "sum(rate(http_server_requests_total{http_route!~\"/health.*\"}[$__rate_interval]))", + "legendFormat": "", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 2, + "type": "stat", + "title": "5xx error ratio", + "description": "5xx / РІСЃРµ бизнес-запросы Р·Р° 5m, health исключён. 4xx РЅРµ РІС…РѕРґСЏС‚ РІ numerator.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 6, + "y": 0, + "w": 6, + "h": 4 + }, + "fieldConfig": { + "defaults": { + "unit": "percentunit", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 0.02 + }, + { + "color": "red", + "value": 0.05 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value" + }, + "targets": [ + { + "refId": "A", + "expr": "sli:messenger_http_error_ratio:5m", + "legendFormat": "", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 3, + "type": "stat", + "title": "API p95 latency", + "description": "p95 РёР· histogram buckets всех API-реплик, РЅРµ среднее.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 0, + "w": 6, + "h": 4 + }, + "fieldConfig": { + "defaults": { + "unit": "s", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 0.02 + }, + { + "color": "red", + "value": 0.05 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value" + }, + "targets": [ + { + "refId": "A", + "expr": "sli:messenger_http_latency_p95:5m", + "legendFormat": "", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 4, + "type": "stat", + "title": "Oldest queued job", + "description": "Возраст старейшей queued-задачи: backlog, РЅРµ latency обработки.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 18, + "y": 0, + "w": 6, + "h": 4 + }, + "fieldConfig": { + "defaults": { + "unit": "s", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 0.02 + }, + { + "color": "red", + "value": 0.05 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value" + }, + "targets": [ + { + "refId": "A", + "expr": "max(queue_oldest_job_age_seconds{queue_name=\"attachment.jobs\"})", + "legendFormat": "", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 5, + "type": "timeseries", + "title": "API requests by route", + "description": "RPS РїРѕ шаблону маршрута, Р° РЅРµ РїРѕ UUID.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 4, + "w": 12, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "reqps", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "sum by (http_route) (rate(http_server_requests_total{http_route!~\"/health.*\"}[$__rate_interval]))", + "legendFormat": "{{http_route}}", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 6, + "type": "timeseries", + "title": "API latency p50 / p95 / p99 (histogram)", + "description": "p50/p95/p99 считаются РёР· histogram buckets; агрегируются РІСЃРµ реплики.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 4, + "w": 12, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "histogram_quantile(0.50, sum by (le) (rate(http_server_duration_seconds_bucket{http_route!~\"/health.*\"}[$__rate_interval])))", + "legendFormat": "p50", + "editorMode": "code", + "range": true + }, + { + "refId": "B", + "expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_duration_seconds_bucket{http_route!~\"/health.*\"}[$__rate_interval])))", + "legendFormat": "p95", + "editorMode": "code", + "range": true + }, + { + "refId": "C", + "expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_duration_seconds_bucket{http_route!~\"/health.*\"}[$__rate_interval])))", + "legendFormat": "p99", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 7, + "type": "timeseries", + "title": "Jobs processed by outcome", + "description": "job type = attachment.process.v1.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 12, + "w": 8, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "ops", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "sum by (job_outcome) (rate(jobs_processed_total[$__rate_interval]))", + "legendFormat": "{{job_outcome}}", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 8, + "type": "timeseries", + "title": "Job duration p95", + "description": "Длительность обработки worker-РѕРј, p95.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 8, + "y": 12, + "w": 8, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "histogram_quantile(0.95, sum by (le, job_outcome) (rate(jobs_duration_seconds_bucket[$__rate_interval])))", + "legendFormat": "{{job_outcome}}", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 9, + "type": "timeseries", + "title": "Queue depth / in-flight", + "description": "queued (лежит РІ PostgreSQL; broker лишь доставляет ссылки).", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 16, + "y": 12, + "w": 4, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "queue_depth{queue_name=\"attachment.jobs\"}", + "legendFormat": "queued", + "editorMode": "code", + "range": true + }, + { + "refId": "B", + "expr": "queue_in_flight{queue_name=\"attachment.jobs\"}", + "legendFormat": "processing", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 10, + "type": "timeseries", + "title": "Time to ready p95", + "description": "РћС‚ устойчивого принятия upload РґРѕ ready.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 20, + "y": 12, + "w": 4, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "histogram_quantile(0.95, sum by (le) (rate(attachment_time_to_ready_seconds_bucket[$__rate_interval])))", + "legendFormat": "p95", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 11, + "type": "timeseries", + "title": "DB pool", + "description": "used/capacity/waiting пула SQLAlchemy РїРѕ каждому процессу API.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 20, + "w": 8, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "db_pool_connections{state=\"used\"}", + "legendFormat": "used", + "editorMode": "code", + "range": true + }, + { + "refId": "B", + "expr": "db_pool_connections{state=\"capacity\"}", + "legendFormat": "capacity", + "editorMode": "code", + "range": true + }, + { + "refId": "C", + "expr": "db_pool_connections{state=\"waiting\"}", + "legendFormat": "waiting", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 12, + "type": "timeseries", + "title": "Worker busy / capacity", + "description": "Saturation worker-Р°: растёт backlog РїСЂРё нехватке слотов.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 8, + "y": 20, + "w": 8, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "percentunit", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "worker_busy / clamp_min(worker_capacity, 1)", + "legendFormat": "busy (0..1)", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 13, + "type": "timeseries", + "title": "Process CPU", + "description": "CPU-секунды процесса РІ секунду; сравните telemetry off/on РІ отчёте.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 16, + "y": 20, + "w": 8, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "cores", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "sum by (service_name) (rate(process_cpu_seconds_total[$__rate_interval]))", + "legendFormat": "{{service_name}}", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 14, + "type": "timeseries", + "title": "Process memory", + "description": "RSS процесса; лимит контейнера РјРѕР¶РЅРѕ сравнить РІ таблице РЅРёР¶Рµ.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 28, + "w": 12, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "bytes", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "process_memory_usage_bytes", + "legendFormat": "{{service_name}}", + "editorMode": "code", + "range": true + }, + { + "refId": "B", + "expr": "process_memory_limit_bytes", + "legendFormat": "{{service_name}} limit", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 15, + "type": "timeseries", + "title": "Collector: spans accepted vs failed export", + "description": "Приём Collector-РѕРј Рё отказы экспорта: потерянные/ограниченные spans РІРёРґРЅС‹ здесь.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 12, + "y": 28, + "w": 12, + "h": 8 + }, + "fieldConfig": { + "defaults": { + "unit": "ops", + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 8 + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "refId": "A", + "expr": "sum(rate(otelcol_receiver_accepted_spans_total[$__rate_interval]))", + "legendFormat": "accepted", + "editorMode": "code", + "range": true + }, + { + "refId": "B", + "expr": "sum(rate(otelcol_exporter_sent_spans_total[$__rate_interval]))", + "legendFormat": "exported", + "editorMode": "code", + "range": true + }, + { + "refId": "C", + "expr": "sum(rate(otelcol_exporter_send_failed_spans_total[$__rate_interval]))", + "legendFormat": "failed export", + "editorMode": "code", + "range": true + } + ] + }, + { + "id": 16, + "type": "logs", + "title": "Structured logs (Loki)", + "description": "JSON-строки СЃ trace_id/span_id; derived field открывает trace РІ Tempo.", + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "x": 0, + "y": 36, + "w": 12, + "h": 10 + }, + "options": { + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": true, + "enableLogDetails": true + }, + "targets": [ + { + "refId": "A", + "expr": "{service_name=~\"messenger-api|messenger-worker\"} | json", + "queryType": "range" + } + ] + }, + { + "id": 17, + "type": "traces", + "title": "Recent traces (Tempo)", + "description": "Реальные server/consumer spans; откройте trace Рё перейдите Рє логам РїРѕ trace_id.", + "datasource": { + "type": "tempo", + "uid": "tempo" + }, + "gridPos": { + "x": 12, + "y": 36, + "w": 12, + "h": 10 + }, + "options": {}, + "targets": [ + { + "refId": "A", + "queryType": "traceql", + "query": "{resource.service.name=~\"messenger-api|messenger-worker\"}" + } + ] + }, + { + "id": 18, + "type": "stat", + "title": "SLO availability (1h)", + "description": "Целевой SLO 99.5% Р·Р° 30 дней; РѕРєРЅРѕ 1h для оперативного контроля.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "x": 0, + "y": 46, + "w": 8, + "h": 5 + }, + "fieldConfig": { + "defaults": { + "unit": "percentunit", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "orange", + "value": 0.995 + }, + { + "color": "green", + "value": 0.999 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value" + }, + "targets": [ + { + "refId": "A", + "expr": "1 - (sum(increase(http_server_requests_total{http_response_status_class=\"5xx\",http_route!~\"/health.*\"}[1h])) / clamp_min(sum(increase(http_server_requests_total{http_route!~\"/health.*\"}[1h])), 1))", + "legendFormat": "", + "editorMode": "code", + "range": true + } + ] + } + ] +} diff --git a/observability/grafana/provisioning/dashboards/dashboards.yaml b/observability/grafana/provisioning/dashboards/dashboards.yaml new file mode 100644 index 0000000..b350b25 --- /dev/null +++ b/observability/grafana/provisioning/dashboards/dashboards.yaml @@ -0,0 +1,13 @@ +apiVersion: 1 + +providers: + - name: messenger-lab7 + orgId: 1 + folder: Messenger + type: file + disableDeletion: false + updateIntervalSeconds: 30 + allowUiUpdates: false + options: + path: /var/lib/grafana/dashboards + foldersFromFilesStructure: false diff --git a/observability/grafana/provisioning/datasources/datasources.yaml b/observability/grafana/provisioning/datasources/datasources.yaml new file mode 100644 index 0000000..3dad5e5 --- /dev/null +++ b/observability/grafana/provisioning/datasources/datasources.yaml @@ -0,0 +1,64 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + uid: prometheus + type: prometheus + access: proxy + url: https://prometheus-tls:8443 + isDefault: true + jsonData: + timeInterval: 5s + tlsAuth: true + tlsAuthWithCACert: true + secureJsonData: + tlsCACert: $__file{/certs/ca.crt} + tlsClientCert: $__file{/certs/grafana-client.crt} + tlsClientKey: $__file{/certs/grafana-client.key} + + - name: Loki + uid: loki + type: loki + access: proxy + url: https://loki-tls:8443 + jsonData: + maxLines: 1000 + tlsAuth: true + tlsAuthWithCACert: true + # JSON-строка лога содержит trace_id; derived field делает её ссылкой + # в Tempo прямо из Explore/Dashboard. + derivedFields: + - name: trace_id + matcherRegex: '"trace_id":"([a-f0-9]{32})"' + url: "$${__value.raw}" + datasourceUid: tempo + secureJsonData: + tlsCACert: $__file{/certs/ca.crt} + tlsClientCert: $__file{/certs/grafana-client.crt} + tlsClientKey: $__file{/certs/grafana-client.key} + + - name: Tempo + uid: tempo + type: tempo + access: proxy + url: https://tempo-tls:8443 + jsonData: + httpMethod: GET + tlsAuth: true + tlsAuthWithCACert: true + # Из trace можно перейти к логам того же trace: строка лога содержит + # trace_id, поэтому filterByTraceID ищет его в теле. + tracesToLogsV2: + datasourceUid: loki + spanStartTimeShift: "-1h" + spanEndTimeShift: "1h" + filterByTraceID: true + filterBySpanID: false + serviceMap: + datasourceUid: prometheus + nodeGraph: + enabled: true + secureJsonData: + tlsCACert: $__file{/certs/ca.crt} + tlsClientCert: $__file{/certs/grafana-client.crt} + tlsClientKey: $__file{/certs/grafana-client.key} \ No newline at end of file diff --git a/observability/loki/loki-config.yaml b/observability/loki/loki-config.yaml new file mode 100644 index 0000000..1d12b06 --- /dev/null +++ b/observability/loki/loki-config.yaml @@ -0,0 +1,55 @@ +# Loki 3.x, single binary, filesystem storage. Логи приходят OTLP от Collector. +auth_enabled: false + +server: + http_listen_port: 3100 + grpc_listen_port: 9096 + log_level: info + +common: + path_prefix: /loki + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules + replication_factor: 1 + ring: + instance_addr: 127.0.0.1 + kvstore: + store: inmemory + +schema_config: + configs: + - from: 2024-01-01 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +storage_config: + tsdb_shipper: + active_index_directory: /loki/tsdb-index + cache_location: /loki/tsdb-cache + cache_ttl: 24h + +limits_config: + retention_period: 168h + reject_old_samples: false + allow_structured_metadata: true + volume_enabled: true + ingestion_rate_mb: 8 + ingestion_burst_size_mb: 16 + +compactor: + working_directory: /loki/compactor + compaction_interval: 10m + retention_enabled: true + delete_request_store: filesystem + +ruler: + storage: + type: local + local: + directory: /loki/rules \ No newline at end of file diff --git a/observability/otel-collector/config-baseline.yaml b/observability/otel-collector/config-baseline.yaml new file mode 100644 index 0000000..88d60c7 --- /dev/null +++ b/observability/otel-collector/config-baseline.yaml @@ -0,0 +1,85 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + +processors: + # Ограничивает RAM Collector-а: при переполнении OTLP-приём отвечает отказом, + # а SDK/клиент ограничивают собственные очереди. Collector не является БД. + memory_limiter: + check_interval: 1s + limit_mib: 320 + spike_limit_mib: 64 + batch: + send_batch_size: 512 + send_batch_max_size: 1024 + timeout: 2s + +exporters: + # Prometheus забирает метрики приложения и Collector-а по внутренней сети. + prometheus: + endpoint: 0.0.0.0:8889 + resource_to_telemetry_conversion: + enabled: true + otlp/tempo: + endpoint: tempo:4317 + tls: + insecure: true + timeout: 3s + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 5s + max_elapsed_time: 30s + sending_queue: + enabled: true + num_consumers: 2 + queue_size: 2000 + # Loki 3.x принимает OTLP нативно; exporter добавляет /v1/logs. + otlphttp/loki: + endpoint: http://loki:3100/otlp + tls: + insecure: true + timeout: 3s + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 5s + max_elapsed_time: 30s + sending_queue: + enabled: true + num_consumers: 2 + queue_size: 2000 + +extensions: + health_check: + endpoint: 0.0.0.0:13133 + +service: + extensions: [health_check] + telemetry: + logs: + level: info + metrics: + readers: + - pull: + exporter: + prometheus: + host: 0.0.0.0 + port: 8888 + pipelines: + traces: + receivers: [otlp] + processors: [memory_limiter, batch] + exporters: [otlp/tempo] + metrics: + receivers: [otlp] + processors: [memory_limiter, batch] + exporters: [prometheus] + logs: + receivers: [otlp] + processors: [memory_limiter, batch] + exporters: [otlphttp/loki] diff --git a/observability/otel-collector/config.yaml b/observability/otel-collector/config.yaml new file mode 100644 index 0000000..ac23d2a --- /dev/null +++ b/observability/otel-collector/config.yaml @@ -0,0 +1,123 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + +processors: + # Ограничивает RAM Collector-а: при переполнении OTLP-приём отвечает отказом, + # а SDK/клиент ограничивают собственные очереди. Collector не является БД. + memory_limiter: + check_interval: 1s + limit_mib: 320 + spike_limit_mib: 64 + # Сбалансированный профиль: сохраняем ВСЕ ошибки и медленные trace-ы, + # остальные — вероятностно 10%. Sampling выполняется после получения + # отдельных сигналов, поэтому редкая ошибка не теряется из-за head sampling. + tail_sampling: + decision_wait: 10s + num_traces: 50000 + expected_new_traces_per_sec: 200 + policies: + - name: errors + type: status_code + status_code: + status_codes: [ERROR] + - name: slow + type: latency + latency: + threshold_ms: 500 + # Upload-ы редкие и нужны для сквозной диагностики: сохраняем их целиком, + # чтобы demo/разбор не зависели от 10% baseline. + - name: uploads + type: string_attribute + string_attribute: + key: http.route + values: + - "/api/v1/chats/{chat_id}/attachments" + - name: baseline + type: probabilistic + probabilistic: + sampling_percentage: 10 + batch: + send_batch_size: 1024 + send_batch_max_size: 2048 + timeout: 5s + +exporters: + # Prometheus забирает метрики приложения и Collector-а по внутренней сети. + prometheus: + endpoint: 0.0.0.0:8889 + resource_to_telemetry_conversion: + enabled: true + otlp/tempo: + # TLS + client certificate к mTLS-шлюзу Tempo. Проверка сервера идёт по + # внутреннему CA и SAN tempo; insecure/plaintext fallback не предусмотрен. + endpoint: tempo-tls:4317 + tls: + insecure: false + ca_file: /certs/ca.crt + cert_file: /certs/telemetry-client.crt + key_file: /certs/telemetry-client.key + server_name_override: tempo + timeout: 3s + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 5s + max_elapsed_time: 30s + sending_queue: + enabled: true + num_consumers: 2 + queue_size: 2000 + # Loki 3.x принимает OTLP нативно; exporter добавляет /v1/logs. + otlphttp/loki: + endpoint: https://loki-tls:8443/otlp + tls: + insecure: false + ca_file: /certs/ca.crt + cert_file: /certs/telemetry-client.crt + key_file: /certs/telemetry-client.key + server_name_override: loki + timeout: 3s + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 5s + max_elapsed_time: 30s + sending_queue: + enabled: true + num_consumers: 2 + queue_size: 2000 + +extensions: + health_check: + endpoint: 0.0.0.0:13133 + +service: + extensions: [health_check] + telemetry: + logs: + level: info + metrics: + readers: + - pull: + exporter: + prometheus: + host: 0.0.0.0 + port: 8888 + pipelines: + traces: + receivers: [otlp] + processors: [memory_limiter, tail_sampling, batch] + exporters: [otlp/tempo] + metrics: + receivers: [otlp] + processors: [memory_limiter, batch] + exporters: [prometheus] + logs: + receivers: [otlp] + processors: [memory_limiter, batch] + exporters: [otlphttp/loki] \ No newline at end of file diff --git a/observability/prometheus/prometheus.yml b/observability/prometheus/prometheus.yml new file mode 100644 index 0000000..307c0c5 --- /dev/null +++ b/observability/prometheus/prometheus.yml @@ -0,0 +1,36 @@ +global: + scrape_interval: 5s + evaluation_interval: 5s + external_labels: + environment: lab + stack: lab7 + +rule_files: + - /etc/prometheus/rules/*.yml + +scrape_configs: + # Метрики приложения приходят из OTel Collector. Scrape идёт по mTLS через + # collector-tls: Prometheus предъявляет prometheus-client, шлюз проверяет SAN. + - job_name: otel-collector-app-metrics + scheme: https + tls_config: + ca_file: /certs/ca.crt + cert_file: /certs/prometheus-client.crt + key_file: /certs/prometheus-client.key + server_name: collector-tls + static_configs: + - targets: ["collector-tls:8889"] + # Self-telemetry Collector-а: приём, очередь, потери экспорта. + - job_name: otel-collector-self + scheme: https + tls_config: + ca_file: /certs/ca.crt + cert_file: /certs/prometheus-client.crt + key_file: /certs/prometheus-client.key + server_name: collector-tls + static_configs: + - targets: ["collector-tls:8888"] + # Loopback внутри контейнера Prometheus: закрытый локальный hop, не сеть. + - job_name: prometheus + static_configs: + - targets: ["127.0.0.1:9090"] diff --git a/observability/prometheus/rules/messenger.yml b/observability/prometheus/rules/messenger.yml new file mode 100644 index 0000000..3f6c882 --- /dev/null +++ b/observability/prometheus/rules/messenger.yml @@ -0,0 +1,81 @@ +groups: + - name: messenger-slo + interval: 15s + rules: + - record: sli:messenger_http_error_ratio:5m + expr: | + sum(rate(http_server_requests_total{http_response_status_class="5xx",http_route!~"/health.*"}[5m])) + / + clamp_min(sum(rate(http_server_requests_total{http_route!~"/health.*"}[5m])), 1e-9) + - record: sli:messenger_http_error_ratio:2m + expr: | + sum(rate(http_server_requests_total{http_response_status_class="5xx",http_route!~"/health.*"}[2m])) + / + clamp_min(sum(rate(http_server_requests_total{http_route!~"/health.*"}[2m])), 1e-9) + - record: sli:messenger_http_latency_p95:5m + expr: | + histogram_quantile( + 0.95, + sum by (le) ( + rate(http_server_duration_seconds_bucket{http_route!~"/health.*"}[5m]) + ) + ) + + - alert: MessengerHighErrorRate + # Окно 2m для быстрой реакции и раннего resolved в учебном стенде; + # SLO на dashboard считается по 5m/1h. + expr: sli:messenger_http_error_ratio:2m > 0.02 + for: 1m + labels: + severity: critical + slo: api-availability + annotations: + summary: "API 5xx error ratio above 2% (1m)" + description: "5xx/все бизнес-запросы за 2m = {{ $value | humanizePercentage }}; исключены /health и 4xx." + runbook_url: "observability/runbooks.md#high-error-rate-messengerhigherrorrate" + + - alert: MessengerQueueLagHigh + expr: max(queue_oldest_job_age_seconds{queue_name="attachment.jobs"}) > 60 + for: 2m + labels: + severity: warning + slo: async-processing + annotations: + summary: "Очередь вложений: старейшая job старше 60 s" + description: "Возраст старейшей queued-задачи {{ $value | humanizeDuration }}; проверьте worker/брокер/БД." + runbook_url: "observability/runbooks.md#queue-lag-messengerqueuelaghigh" + + - alert: MessengerApiLatencyHigh + expr: sli:messenger_http_latency_p95:5m > 1.0 + for: 3m + labels: + severity: warning + slo: api-latency + annotations: + summary: "p95 HTTP latency API выше 1 s (5m)" + description: "p95 = {{ $value | humanizeDuration }}; сравните DB pool и DB spans в trace." + runbook_url: "observability/runbooks.md#latency-messengerapilatencyhigh" + + - alert: MessengerWorkerSaturated + expr: | + max(worker_busy / clamp_min(worker_capacity, 1)) > 0.9 + for: 5m + labels: + severity: warning + annotations: + summary: "Worker занят > 90% слотов" + description: "Backlog растёт из-за нехватки worker-ёмкости, а не из-за ошибок." + runbook_url: "observability/runbooks.md#worker-saturation-messengerworkersaturated" + + - alert: MessengerTelemetryExportFailing + expr: | + sum(rate(otelcol_exporter_send_failed_spans_total[5m])) > 0 + or + sum(rate(otelcol_exporter_send_failed_log_records_total[5m])) > 0 + for: 2m + labels: + severity: warning + annotations: + summary: "Collector не может экспортировать телеметрию" + description: "Проверьте Tempo/Loki и очередь exporter-а; API продолжает работу." + runbook_url: "observability/runbooks.md#telemetry-outage-messengertelemetryexportfailing" \ No newline at end of file diff --git a/observability/runbooks.md b/observability/runbooks.md new file mode 100644 index 0000000..001cd44 --- /dev/null +++ b/observability/runbooks.md @@ -0,0 +1,59 @@ +# Runbooks для алертов лабораторной 6 + +Все команды выполняются из корня репозитория. Стенд: `docker compose`, API — +`http://127.0.0.1:8080`, Grafana — `http://127.0.0.1:3000`. + +Общий порядок: alert → Grafana dashboard "Messenger — Observability" → нужная +панель → trace в Tempo → лог в Loki по `trace_id`/`request_id` → метрики +инфраструктуры. Не начинайте с перезапуска: сначала сохраните состояние. + +## high-error-rate (MessengerHighErrorRate) + +1. Откройте панели "5xx error ratio", "API requests by route" и "API latency". +2. Найдите в Loki `{service_name="messenger-api"} | json | status>=500`; + возьмите `trace_id`. +3. Откройте trace в Tempo. Если долгие/ошибочные DB spans — смотрите + `db_pool_connections{state="waiting"}` и PostgreSQL; если ошибки S3 — + `aws.s3` spans и MinIO. +4. Проверьте, не является ли это 4xx-клиентом: numerator SLO — только 5xx. +5. Проверка восстановления: `sli:messenger_http_error_ratio:5m` < 0.02, + alert переходит в resolved. + +## queue-lag (MessengerQueueLagHigh) + +1. Панели "Oldest queued job", "Queue depth / in-flight", "Worker busy". +2. `docker compose ps worker`; если worker остановлен — запустите + `scripts/start-worker.sh` и наблюдайте снижение возраста. +3. Если worker работает: смотрите `jobs_processed_total{job_outcome="retry"}`, + логи worker `job_retry_scheduled`, trace job с `error.code`. +4. Проверьте RabbitMQ/БД: `docker compose logs rabbitmq postgres`. +5. Resolved: возраст старейшей queued-задачи < 60 s дольше `for`. + +## latency (MessengerApiLatencyHigh) + +1. Сравните p50/p95/p99 и `db_pool_connections` на dashboard. +2. Если p95 растёт вместе с `state="waiting"` и DB spans — причина в БД + (блокировки/медленный запрос), а не в HTTP handler. Воспроизводимая проверка: + `scripts/db-slow.sh 10` (ACCESS EXCLUSIVE lock на `messages`). +3. Если DB spans короткие, а server span длинный — ищите внешний вызов + (S3 span) или CPU saturation процесса. +4. Resolved: p95 < 1 s на окне 5m. + +## worker-saturation (MessengerWorkerSaturated) + +1. `worker_busy / worker_capacity` > 0.9 и растущий queue depth. +2. Проверьте размер изображений и время обработки: Tempo job span, + `jobs_duration_seconds` по outcome. +3. Временное решение — увеличить `WORKER_CONCURRENCY`/реплики worker; + долгосрочное — ограничить размер входных файлов. +4. Resolved: busy < 0.9 и очередь разбирается. + +## telemetry-outage (MessengerTelemetryExportFailing) + +1. `docker compose ps prometheus loki tempo otel-collector`. +2. Проверьте `otelcol_exporter_queue_size` и + `otelcol_exporter_send_failed_*`; API при этом обязан отвечать. +3. Поднимите backend (`scripts/start-telemetry.sh`), дождитесь опустошения + очереди; часть spans/логов за окно отказа может быть потеряна — это + ограниченная буферизация, а не потеря бизнес-данных. +4. Проверьте, что `/health/ready` API не зависит от Collector/Grafana. diff --git a/observability/tempo/tempo.yaml b/observability/tempo/tempo.yaml new file mode 100644 index 0000000..f6883a5 --- /dev/null +++ b/observability/tempo/tempo.yaml @@ -0,0 +1,37 @@ +server: + http_listen_port: 3200 + grpc_listen_port: 9095 + log_level: info + +distributor: + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + +ingester: + # Быстрее делаем свежие trace-ы доступными для поиска в учебном стенде. + max_block_duration: 1m + # Не меньше blocklist_poll, иначе Tempo предупреждает о 404 между flush + # и появлением блока у querier. + complete_block_timeout: 1m + +compactor: + compaction: + block_retention: 24h + +storage: + trace: + # Быстрее делаем завершённые блоки видимыми для поиска. + blocklist_poll: 15s + backend: local + local: + path: /var/tempo/traces + wal: + path: /var/tempo/wal + +usage_report: + reporting_enabled: false \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..40dacd6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,65 @@ +# Рантайм-зависимости лабораторной 6: точное замыкание (top-level и транзитивные), +# получено `pip freeze` после установки на Python 3.11.9: +# pip install fastapi==0.141.1 uvicorn==0.53.0 "sqlalchemy[asyncio]==2.0.44" \ +# asyncpg==0.30.0 alembic==1.16.5 redis==6.4.0 argon2-cffi==25.1.0 \ +# boto3==1.43.125 Pillow==13.0.0 aio-pika==9.5.5 +alembic==1.16.5 +aio-pika==9.5.5 +aiormq==6.8.1 +annotated-doc==0.0.5 +annotated-types==0.8.0 +anyio==4.15.1 +argon2-cffi==25.1.0 +argon2-cffi-bindings==26.1.0 +asyncpg==0.30.0 +boto3==1.43.125 +botocore==1.43.125 +cffi==2.1.1 +click==8.5.0 +exceptiongroup==1.3.2 +fastapi==0.141.1 +greenlet==3.5.6 +h11==0.16.0 +idna==3.20 +jmespath==1.1.0 +Mako==1.4.3 +MarkupSafe==3.0.4 +multidict==7.2.1 +pamqp==3.3.0 +pycparser==3.11 +pydantic==2.14.0 +Pillow==13.0.0 +propcache==0.5.4 +pydantic_core==2.50.0 +python-dateutil==2.9.0.post0 +redis==6.4.0 +SQLAlchemy==2.0.44 +s3transfer==0.19.3 +six==1.17.0 +starlette==1.7.0 +typing-inspection==0.4.4 +typing_extensions==4.16.0 +urllib3==2.5.0 +uvicorn==0.53.0 +yarl==1.25.1 +# OpenTelemetry SDK/инструментация (лабораторная 6): OTLP/HTTP, SQLAlchemy и +# botocore spans; версии зафиксированы вместе с semantic conventions. +opentelemetry-api==1.45.2 +opentelemetry-sdk==1.45.2 +opentelemetry-exporter-otlp-proto-http==1.45.2 +opentelemetry-exporter-otlp-proto-common==1.45.2 +opentelemetry-exporter-otlp-common==0.66b2 +opentelemetry-exporter-http-transport==0.66b2 +opentelemetry-instrumentation==0.66b2 +opentelemetry-instrumentation-sqlalchemy==0.66b2 +opentelemetry-instrumentation-botocore==0.66b2 +opentelemetry-semantic-conventions==0.66b2 +opentelemetry-proto==1.45.2 +packaging==26.4 +wrapt==2.5.2 +certifi==2026.11.20 +charset-normalizer==3.5.3 +googleapis-common-protos==1.76.0 +protobuf==7.36.2 +requests==2.34.2 +opentelemetry-propagator-aws-xray==1.0.2 diff --git a/scripts/api-entrypoint.sh b/scripts/api-entrypoint.sh new file mode 100644 index 0000000..4626bcc --- /dev/null +++ b/scripts/api-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# В контейнере API два процесса: mTLS-шлюз на 8081 и uvicorn на loopback. +# API-порт не публикуется, поэтому единственный вход — шлюз с проверкой +# client certificate и SAN балансировщика. +set -eu +python -m messenger.mtls_gateway --config "${GATEWAY_CONFIG:-/etc/gateway/api.json}" & +GATEWAY_PID=$! +term() { + kill -TERM "$GATEWAY_PID" 2>/dev/null || true +} +trap term TERM INT +python -m messenger & +APP_PID=$! +wait "$APP_PID" +STATUS=$? +term +wait "$GATEWAY_PID" 2>/dev/null || true +exit "$STATUS" diff --git a/scripts/argon2_bench.py b/scripts/argon2_bench.py new file mode 100644 index 0000000..5a86242 --- /dev/null +++ b/scripts/argon2_bench.py @@ -0,0 +1,51 @@ +"""Измерение Argon2id на стенде и проверка rehash-совместимости.""" +from __future__ import annotations + +import json +import statistics +import time + +from argon2 import PasswordHasher + +from messenger.security import _hasher, configure_argon2, password_needs_rehash + + +def main() -> int: + configure_argon2(19456, 2, 1) + password = "Benchmark-password-32-characters" + hash_times = [] + verify_times = [] + stored = "" + for _ in range(5): + started = time.perf_counter() + stored = _hasher.hash(password) + hash_times.append((time.perf_counter() - started) * 1000) + started = time.perf_counter() + assert _hasher.verify(stored, password) + verify_times.append((time.perf_counter() - started) * 1000) + old = PasswordHasher(time_cost=1, memory_cost=8192, parallelism=1) + old_hash = old.hash(password) + result = { + "algorithm": stored.split("$")[1], + "version": stored.split("$")[2], + "parameters": stored.split("$")[3], + "hash_ms": { + "runs": len(hash_times), + "median": round(statistics.median(hash_times), 2), + "min": round(min(hash_times), 2), + "max": round(max(hash_times), 2), + }, + "verify_ms": { + "median": round(statistics.median(verify_times), 2), + "min": round(min(verify_times), 2), + "max": round(max(verify_times), 2), + }, + "old_hash_needs_rehash": bool(password_needs_rehash(old_hash)), + "owasp_minimum_memory_kib": 19456, + } + print(json.dumps(result, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/bootstrap-certs.sh b/scripts/bootstrap-certs.sh new file mode 100644 index 0000000..f7cf3cb --- /dev/null +++ b/scripts/bootstrap-certs.sh @@ -0,0 +1,143 @@ +#!/bin/sh +# Локальный PKI стенда lab7. Скрипт создаёт ключи ВНЕ Git и раскладывает по +# каталогам ровно те файлы, которые нужны конкретному процессу. +# +# secrets/ca-private/ private key CA (никогда не монтируется в контейнеры) +# certs/ca.crt публичный CA для клиентов и make test CA_FILE=... +# secrets/certs/ material только этого процесса +# +# Повторный запуск не перезаписывает существующий PKI: ротация делается +# отдельным осознанным действием оператора. +set -eu +# Git-Bash/MSYS иначе превращает /CN=... в C:/msys64/CN=... +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" + +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" + +CERT_DIR="${CERT_DIR:-certs}" +OUT="${CERTS_OUT:-secrets/certs}" +CA_PRIVATE="${CA_PRIVATE_DIR:-secrets/ca-private}" +DAYS="${CERT_DAYS:-397}" +CA_DAYS="${CA_DAYS:-3650}" + +if [ -f "$OUT/ca.crt" ]; then + echo "PKI already exists at $OUT; refusing to overwrite (use CERTS_OUT to rotate separately)" + exit 0 +fi + +command -v openssl >/dev/null 2>&1 || { echo "openssl is required" >&2; exit 2; } +umask 077 +mkdir -p "$CERT_DIR" "$OUT" "$CA_PRIVATE" "$OUT"/{traefik,api,worker,relay,gateway,postgres,minio,rabbitmq,otel,openbao,telemetry,tests} +chmod 700 "$CA_PRIVATE" +chmod 755 "$OUT" "$OUT"/*/ 2>/dev/null || true + +gen_ca() { + name=$1 + subj=$2 + openssl genrsa -out "$CA_PRIVATE/$name.key" 4096 >/dev/null 2>&1 + openssl req -x509 -new -key "$CA_PRIVATE/$name.key" -sha256 -days "$CA_DAYS" \ + -subj "$subj" \ + -addext "basicConstraints=critical,CA:TRUE" \ + -addext "keyUsage=critical,keyCertSign,cRLSign" \ + -addext "subjectKeyIdentifier=hash" \ + -out "$OUT/$name.crt" + chmod 600 "$CA_PRIVATE/$name.key" +} + +leaf() { + name=$1 + san=$2 + ca=$3 + eku=$4 + keydir=$5 + mkdir -p "$keydir" + openssl genrsa -out "$keydir/$name.key" 2048 >/dev/null 2>&1 + openssl req -new -key "$keydir/$name.key" -subj "/CN=$name" -out "$keydir/$name.csr" + cat > "$keydir/$name.ext" </dev/null 2>&1 + rm -f "$keydir/$name.csr" "$keydir/$name.ext" + chmod 644 "$keydir/$name.key" +} + +gen_ca internal-ca "/CN=MTUSI Lab7 Internal CA/O=MTUSI HighLoad" +gen_ca foreign-ca "/CN=MTUSI Lab7 Foreign CA/O=Untrusted" + +# Публичный ingress: клиент проверяет цепочку и hostname localhost. +leaf public "DNS:localhost,DNS:messenger.localhost,DNS:traefik,IP:127.0.0.1" internal-ca serverAuth "$OUT/traefik" +# LB → API: клиентский сертификат балансировщика. +leaf lb-client "DNS:lb.messenger.internal" internal-ca clientAuth "$OUT/traefik" +# API server: цель mTLS-соединения от балансировщика. +leaf api-server "DNS:api.messenger.internal,DNS:api,IP:127.0.0.1" internal-ca serverAuth "$OUT/api" +# Рабочие identity. +leaf api-client "DNS:api.messenger.internal" internal-ca clientAuth "$OUT/api" +leaf worker-client "DNS:worker.messenger.internal" internal-ca clientAuth "$OUT/worker" +leaf relay-client "DNS:relay.messenger.internal" internal-ca clientAuth "$OUT/relay" +# Шлюз: собственная identity и server cert для внутренних listener-ов. +leaf gateway-server "DNS:internal-gateway,DNS:gateway" internal-ca serverAuth "$OUT/gateway" +leaf gateway-client "DNS:gateway.messenger.internal" internal-ca clientAuth "$OUT/gateway" +# Отрицательные проверки: тот же CA, но чужая identity; и чужой CA. +leaf foreign-client "DNS:foreign.messenger.internal" internal-ca clientAuth "$OUT/tests" +leaf foreign-ca-client "DNS:api.messenger.internal" foreign-ca clientAuth "$OUT/tests" +# Backend server certificates. +leaf postgres "DNS:postgres,IP:127.0.0.1" internal-ca serverAuth "$OUT/postgres" +leaf minio "DNS:minio,IP:127.0.0.1" internal-ca serverAuth "$OUT/minio" +# MinIO ищет в --certs-dir именно public.crt/private.key. +cp "$OUT/minio/minio.crt" "$OUT/minio/public.crt" +cp "$OUT/minio/minio.key" "$OUT/minio/private.key" +leaf rabbitmq "DNS:rabbitmq,IP:127.0.0.1" internal-ca serverAuth "$OUT/rabbitmq" +leaf otel-collector "DNS:otel-collector,IP:127.0.0.1" internal-ca serverAuth "$OUT/otel" +leaf openbao "DNS:openbao,IP:127.0.0.1" internal-ca serverAuth "$OUT/openbao" +# Telemetry backends / UI (TLS termination и проверка сервера). +leaf prometheus "DNS:prometheus,IP:127.0.0.1" internal-ca serverAuth "$OUT/telemetry" +leaf loki "DNS:loki,IP:127.0.0.1" internal-ca serverAuth "$OUT/telemetry" +leaf tempo "DNS:tempo,IP:127.0.0.1" internal-ca serverAuth "$OUT/telemetry" +leaf grafana "DNS:grafana,DNS:localhost,IP:127.0.0.1" internal-ca serverAuth "$OUT/telemetry" +# Клиенты телеметрии: Collector → Loki/Tempo и Prometheus → Collector, +# Grafana → datasources. У каждой связи отдельная identity. +leaf telemetry-client "DNS:otel-collector.messenger.internal" internal-ca clientAuth "$OUT/telemetry" +leaf prometheus-client "DNS:prometheus.messenger.internal" internal-ca clientAuth "$OUT/telemetry" +leaf grafana-client "DNS:grafana.messenger.internal" internal-ca clientAuth "$OUT/telemetry" +# mTLS-шлюзы перед telemetry backends: отдельный server cert на listener. +leaf prometheus-tls "DNS:prometheus-tls,DNS:prometheus" internal-ca serverAuth "$OUT/telemetry" +leaf loki-tls "DNS:loki-tls,DNS:loki" internal-ca serverAuth "$OUT/telemetry" +leaf tempo-tls "DNS:tempo-tls,DNS:tempo" internal-ca serverAuth "$OUT/telemetry" +leaf collector-tls "DNS:collector-tls,DNS:otel-collector" internal-ca serverAuth "$OUT/telemetry" + +cp "$OUT/internal-ca.crt" "$OUT/ca.crt" +cp "$OUT/internal-ca.crt" "$CERT_DIR/ca.crt" + +# Раскладываем только необходимое каждому процессу. +cp "$OUT/internal-ca.crt" "$OUT/traefik/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/api/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/worker/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/relay/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/gateway/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/postgres/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/minio/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/rabbitmq/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/otel/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/openbao/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/telemetry/ca.crt" +cp "$OUT/internal-ca.crt" "$OUT/tests/ca.crt" + +chmod 644 "$OUT"/*.crt "$OUT"/*/ca.crt "$CERT_DIR/ca.crt" 2>/dev/null || true +find "$OUT" -name '*.key' -exec chmod 644 {} \; 2>/dev/null || true +chmod 644 "$OUT"/traefik/*.crt "$OUT"/api/*.crt "$OUT"/worker/*.crt "$OUT"/relay/*.crt \ + "$OUT"/gateway/*.crt "$OUT"/postgres/*.crt "$OUT"/minio/*.crt "$OUT"/rabbitmq/*.crt \ + "$OUT"/otel/*.crt "$OUT"/openbao/*.crt "$OUT"/telemetry/*.crt "$OUT"/tests/*.crt 2>/dev/null || true + +echo "PKI created:" +echo " public CA for clients: $CERT_DIR/ca.crt" +echo " runtime material: $OUT/" +echo " CA private keys: $CA_PRIVATE/ (mode 700, not mounted)" diff --git a/scripts/bootstrap-rabbit.sh b/scripts/bootstrap-rabbit.sh new file mode 100644 index 0000000..9bf0cf8 --- /dev/null +++ b/scripts/bootstrap-rabbit.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Создаёт двух AMQP-пользователей с минимальными permissions и удаляет guest. +# Пароли читаются из secrets/ и не печатаются. Скрипт идемпотентен. +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" + +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" + +API_USER=$(tr -d '\r\n' < secrets/rabbitmq_api_user) +API_PW=$(tr -d '\r\n' < secrets/rabbitmq_api_password) +WORKER_USER=$(tr -d '\r\n' < secrets/rabbitmq_worker_user) +WORKER_PW=$(tr -d '\r\n' < secrets/rabbitmq_worker_password) + +docker compose exec -T rabbitmq rabbitmqctl add_user "$API_USER" "$API_PW" >/dev/null 2>&1 || true +docker compose exec -T rabbitmq rabbitmqctl add_user "$WORKER_USER" "$WORKER_PW" >/dev/null 2>&1 || true +# configure: объявление exchange/queue/DLQ; write/read ограничены своими именами. +docker compose exec -T rabbitmq rabbitmqctl set_permissions -p / "$API_USER" \ + '^attachment\.(jobs|dlx|dlq)$' '^attachment\.(jobs|dlx|dlq)$' '^attachment\.(jobs|dlx|dlq)$' >/dev/null +# Worker — consumer, а не producer: только passive declare/read своей очереди. +# publish/bind/dlq для него запрещены; топологию объявляет relay/API. +docker compose exec -T rabbitmq rabbitmqctl set_permissions -p / "$WORKER_USER" \ + '^attachment\.jobs$' '' '^attachment\.jobs$' >/dev/null +docker compose exec -T rabbitmq rabbitmqctl set_user_tags -p / "$API_USER" >/dev/null +docker compose exec -T rabbitmq rabbitmqctl set_user_tags -p / "$WORKER_USER" >/dev/null +docker compose exec -T rabbitmq rabbitmqctl delete_user guest >/dev/null 2>&1 || true + +echo "rabbitmq users and permissions are ready" diff --git a/scripts/bootstrap-secrets.sh b/scripts/bootstrap-secrets.sh new file mode 100644 index 0000000..2a5eee2 --- /dev/null +++ b/scripts/bootstrap-secrets.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# Генерирует локальные пароли/ключи стенда. Ничего не печатает и не +# перезаписывает: файлы лежат в secrets/ (gitignored) с mode 644 (каталог 700). +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" + +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" +DIR="${SECRETS_DIR:-secrets}" +mkdir -p "$DIR" +umask 077 + +rand_hex() { openssl rand -hex "${1:-24}"; } +rand_user() { printf 'lab7-%s-%s' "$1" "$(openssl rand -hex 4)"; } + +put() { + path=$1 + value=$2 + if [ -f "$path" ]; then + echo "keep $path" + else + printf '%s' "$value" > "$path" + chmod 644 "$path" + echo "create $path" + fi +} + +put "$DIR/postgres_password" "$(rand_hex 24)" +PG_PW=$(tr -d '\r\n' < "$DIR/postgres_password") +put "$DIR/migrate_database_url" "postgresql+asyncpg://messenger:$PG_PW@postgres:5432/messenger" +put "$DIR/db_api_password" "$(rand_hex 24)" +put "$DIR/db_worker_password" "$(rand_hex 24)" +put "$DIR/db_relay_password" "$(rand_hex 24)" +put "$DIR/rabbitmq_root_user" "lab7-root" +put "$DIR/rabbitmq_root_password" "$(rand_hex 24)" +put "$DIR/rabbitmq_api_user" "messenger-api" +put "$DIR/rabbitmq_api_password" "$(rand_hex 24)" +put "$DIR/rabbitmq_worker_user" "messenger-worker" +put "$DIR/rabbitmq_worker_password" "$(rand_hex 24)" +put "$DIR/minio_root_user" "lab7-minio-root" +put "$DIR/minio_root_password" "$(rand_hex 24)" +put "$DIR/s3_api_access_key" "$(rand_user s3api)" +put "$DIR/s3_api_secret_key" "$(rand_hex 24)" +put "$DIR/s3_worker_access_key" "$(rand_user s3worker)" +put "$DIR/s3_worker_secret_key" "$(rand_hex 24)" +put "$DIR/cursor_secret" "$(rand_hex 32)" +put "$DIR/grafana_admin_password" "$(rand_hex 16)" +mkdir -p "$DIR/bao_runtime" +for role in api worker relay; do + # Placeholders нужны, чтобы docker compose config не падал до bootstrap; + # openbao_bootstrap.py перезапишет их настоящими role_id/secret_id. + [ -f "$DIR/bao_runtime/${role}_role_id" ] || : > "$DIR/bao_runtime/${role}_role_id" + [ -f "$DIR/bao_runtime/${role}_secret_id" ] || : > "$DIR/bao_runtime/${role}_secret_id" +done +chmod 755 "$DIR/bao_runtime" +chmod 644 "$DIR/bao_runtime"/* 2>/dev/null || true + +if [ ! -f .env ]; then + cat > .env < int: + parser = argparse.ArgumentParser() + parser.add_argument("--cert", required=True) + parser.add_argument("--key", required=True) + parser.add_argument("--host", default="internal-gateway") + parser.add_argument("--port", type=int, default=5672) + args = parser.parse_args() + ctx = ssl.create_default_context(cafile="/certs/ca.crt") + ctx.check_hostname = True + ctx.verify_mode = ssl.CERT_REQUIRED + ctx.load_cert_chain(args.cert, args.key) + try: + with socket.create_connection((args.host, args.port), timeout=5) as raw: + with ctx.wrap_socket(raw, server_hostname="internal-gateway") as tls: + tls.sendall(b"AMQP\x00\x00\x09\x01") + tls.settimeout(3) + try: + data = tls.recv(64) + except (socket.timeout, ConnectionError): + data = b"" + except (ssl.SSLError, OSError) as exc: + print(f"REJECTED handshake: {exc.__class__.__name__}") + return 0 + if data: + print("ACCEPTED worker port (AMQP Connection.Start)") + return 0 + print("REJECTED after handshake (revoked/denied identity)") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/db-init.sh b/scripts/db-init.sh new file mode 100644 index 0000000..55ce171 --- /dev/null +++ b/scripts/db-init.sh @@ -0,0 +1,80 @@ +#!/bin/sh +# Идемпотентная настройка PostgreSQL. +# roles — до миграций: три LOGIN-роли с паролями, без прав на таблицы; +# grants — после миграций: минимальные права на существующие таблицы. +# Разделение нужно потому, что миграция 0006 сама выдаёт API права на новые +# таблицы, а роль должна существовать уже на момент миграции. +set -eu + +MODE="${1:-roles}" +read_secret() { tr -d '\r\n' < "$1"; } + +export PGPASSWORD=$(read_secret /run/secrets/postgres_password) +API_PW=$(read_secret /run/secrets/db_api_password) +WORKER_PW=$(read_secret /run/secrets/db_worker_password) +RELAY_PW=$(read_secret /run/secrets/db_relay_password) + +run_psql() { + psql -v ON_ERROR_STOP=1 -h postgres -U messenger -d messenger \ + -v api_pw="$API_PW" -v worker_pw="$WORKER_PW" -v relay_pw="$RELAY_PW" "$@" +} + +if [ "$MODE" = "roles" ]; then + run_psql <<'SQL' +DO $$ +BEGIN + IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'messenger_api') THEN + CREATE ROLE messenger_api LOGIN; + END IF; + IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'messenger_worker') THEN + CREATE ROLE messenger_worker LOGIN; + END IF; + IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'messenger_relay') THEN + CREATE ROLE messenger_relay LOGIN; + END IF; +END $$; + +ALTER ROLE messenger_api WITH LOGIN PASSWORD :'api_pw' NOSUPERUSER NOCREATEDB NOCREATEROLE; +ALTER ROLE messenger_worker WITH LOGIN PASSWORD :'worker_pw' NOSUPERUSER NOCREATEDB NOCREATEROLE; +ALTER ROLE messenger_relay WITH LOGIN PASSWORD :'relay_pw' NOSUPERUSER NOCREATEDB NOCREATEROLE; + +REVOKE ALL ON SCHEMA public FROM PUBLIC; +GRANT USAGE ON SCHEMA public TO messenger_api, messenger_worker, messenger_relay; +GRANT CONNECT ON DATABASE messenger TO messenger_api, messenger_worker, messenger_relay; +SQL + echo "database roles are ready" + exit 0 +fi + +if [ "$MODE" != "grants" ]; then + echo "usage: db-init.sh [roles|grants]" >&2 + exit 2 +fi + +run_psql <<'SQL' +-- API: бизнес-таблицы, сессии и лимит входа; DDL нет. +GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO messenger_api; +GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO messenger_api; +-- API читает только ревизию схемы для readiness; менять её он не может. +GRANT SELECT ON alembic_version TO messenger_api; + +-- Worker: только очередь/вложения/варианты/аудит. users, sessions, +-- messages, chats и login_rate_limits недоступны даже на SELECT. +GRANT SELECT, INSERT, UPDATE, DELETE ON + attachments, variants, jobs, outbox, job_events, fault_flags + TO messenger_worker; +GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO messenger_worker; +REVOKE ALL ON users, sessions, login_rate_limits, chats, chat_members, + messages, message_idempotency, message_attachments + FROM messenger_worker; + +-- Relay: только transactional outbox + jobs + чтение attachments для reaper. +GRANT SELECT, INSERT, UPDATE, DELETE ON jobs, outbox, job_events, fault_flags, + attachments TO messenger_relay; +GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO messenger_relay; +REVOKE ALL ON users, sessions, login_rate_limits, chats, chat_members, + messages, message_idempotency, message_attachments, variants + FROM messenger_relay; +SQL + +echo "database grants are ready" diff --git a/scripts/grafana_evidence.py b/scripts/grafana_evidence.py new file mode 100644 index 0000000..62bc886 --- /dev/null +++ b/scripts/grafana_evidence.py @@ -0,0 +1,51 @@ +"""Снимок Grafana provisioning (datasources/dashboard) без секретов.""" +from __future__ import annotations + +import base64 +import json +import ssl +import urllib.request +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +password = (ROOT / "secrets" / "grafana_admin_password").read_text(encoding="utf-8").strip() +ctx = ssl.create_default_context(cafile=str(ROOT / "certs" / "ca.crt")) + + +def get(path: str): + request = urllib.request.Request("https://127.0.0.1:3000" + path) + request.add_header( + "Authorization", "Basic " + base64.b64encode(f"admin:{password}".encode()).decode() + ) + with urllib.request.urlopen(request, context=ctx, timeout=10) as response: + return json.loads(response.read()) + + +def main() -> int: + health = get("/api/health") + datasources = get("/api/datasources") + dashboards = get("/api/search?type=dash-db") + summary = { + "health": health, + "datasources": [ + { + "name": item["name"], + "uid": item.get("uid"), + "type": item["type"], + "url": item["url"], + "tlsAuth": (item.get("jsonData") or {}).get("tlsAuth", False), + "tlsAuthWithCACert": (item.get("jsonData") or {}).get("tlsAuthWithCACert", False), + } + for item in datasources + ], + "dashboards": [{"uid": item.get("uid"), "title": item.get("title")} for item in dashboards], + } + (ROOT / "evidence" / "11-grafana.json").write_text( + json.dumps(summary, indent=2, ensure_ascii=False), encoding="utf-8" + ) + print(json.dumps(summary, indent=2, ensure_ascii=False)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/loki_query.py b/scripts/loki_query.py new file mode 100644 index 0000000..3e516cd --- /dev/null +++ b/scripts/loki_query.py @@ -0,0 +1,45 @@ +"""Поиск чувствительной строки в Loki через mTLS-шлюз (без печати самой строки).""" +from __future__ import annotations + +import json +import ssl +import sys +import urllib.parse +import urllib.request + +CA = "/certs/ca.crt" +CERT = "/certs/telemetry/telemetry-client.crt" +KEY = "/certs/telemetry/telemetry-client.key" +needle = sys.stdin.read().strip() +ctx = ssl.create_default_context(cafile=CA) +ctx.check_hostname = True +ctx.verify_mode = ssl.CERT_REQUIRED +ctx.load_cert_chain(CERT, KEY) + + +def count(query: str) -> tuple[int, int]: + url = "https://loki-tls:8443/loki/api/v1/query_range?" + urllib.parse.urlencode( + {"query": query, "limit": "100"} + ) + request = urllib.request.Request(url) + request.add_header("Accept", "application/json") + with urllib.request.urlopen(request, context=ctx, timeout=10) as response: + body = json.loads(response.read()) + streams = (body.get("data") or {}).get("result") or [] + entries = sum(len(stream.get("values") or []) for stream in streams) + return len(streams), entries + + +total_streams, total_entries = count('{service_name=~".+"}') +needle_streams, needle_entries = count('{service_name=~".+"} |= "' + needle.replace('"', '') + '"') +print( + json.dumps( + { + "total_streams": total_streams, + "total_entries": total_entries, + "sensitive_streams": needle_streams, + "sensitive_entries": needle_entries, + "leaked": needle_entries > 0, + } + ) +) diff --git a/scripts/minio-init.sh b/scripts/minio-init.sh new file mode 100644 index 0000000..8e93166 --- /dev/null +++ b/scripts/minio-init.sh @@ -0,0 +1,82 @@ +#!/bin/sh +# Приватный bucket и два scoped S3-пользователя: API и worker. +# Root-учётка MinIO используется только здесь, в bootstrap, и не попадает в API. +set -eu + +read_secret() { tr -d '\r\n' < "$1"; } + +export MC_CONFIG_DIR="${MC_CONFIG_DIR:-/tmp/.mc}" +ROOT_USER=$(read_secret /run/secrets/minio_root_user) +ROOT_PASSWORD=$(read_secret /run/secrets/minio_root_password) +API_KEY=$(read_secret /run/secrets/s3_api_access_key) +API_SECRET=$(read_secret /run/secrets/s3_api_secret_key) +WORKER_KEY=$(read_secret /run/secrets/s3_worker_access_key) +WORKER_SECRET=$(read_secret /run/secrets/s3_worker_secret_key) + +# Проверка TLS-сертификата MinIO идёт по внутреннему CA; --insecure не используется. +export SSL_CERT_FILE="${S3_CA_FILE:-/certs/ca.crt}" + +mc alias set local "https://minio:9000" "$ROOT_USER" "$ROOT_PASSWORD" >/dev/null +mc mb --ignore-existing local/messenger-attachments >/dev/null +mc anonymous set none local/messenger-attachments >/dev/null + +cat > /tmp/api-policy.json < /tmp/worker-policy.json </dev/null 2>&1 || true +mc admin user add local "$WORKER_KEY" "$WORKER_SECRET" >/dev/null 2>&1 || true +mc admin policy create local messenger-api-rw /tmp/api-policy.json >/dev/null 2>&1 || true +mc admin policy create local messenger-worker-rw /tmp/worker-policy.json >/dev/null 2>&1 || true +mc admin policy attach local messenger-api-rw --user "$API_KEY" >/dev/null 2>&1 || true +mc admin policy attach local messenger-worker-rw --user "$WORKER_KEY" >/dev/null 2>&1 || true +mc admin policy disable local consoleAdmin --user "$API_KEY" >/dev/null 2>&1 || true +mc admin policy disable local consoleAdmin --user "$WORKER_KEY" >/dev/null 2>&1 || true + +rm -f /tmp/api-policy.json /tmp/worker-policy.json +echo "minio bucket, users and scoped policies are ready" diff --git a/scripts/mtls_probe.py b/scripts/mtls_probe.py new file mode 100644 index 0000000..614d4f8 --- /dev/null +++ b/scripts/mtls_probe.py @@ -0,0 +1,387 @@ +"""Отрицательные и положительные проверки матрицы доверия lab7. + +Запускается внутри security-probe (сеть стенда, сертификаты и AppRole files +смонтированы read-only). Секреты не печатаются: только имена проверок, +ожидаемый/наблюдаемый класс результата и HTTP-код там, где он есть. +""" +from __future__ import annotations + +import argparse +import asyncio +import http.client +import json +import socket +import ssl +import sys +import urllib.error +import urllib.request +from pathlib import Path + +CERTS = Path("/certs") +BAO = Path("/bao") +RESULTS: list[dict] = [] + + +def record(name: str, ok: bool, detail: str) -> None: + RESULTS.append({"name": name, "ok": bool(ok), "detail": detail}) + print(("PASS " if ok else "FAIL ") + name + ": " + detail, flush=True) + + +def context(ca: Path, cert: Path | None = None, key: Path | None = None) -> ssl.SSLContext: + ctx = ssl.create_default_context(cafile=str(ca)) + ctx.check_hostname = True + ctx.verify_mode = ssl.CERT_REQUIRED + if cert is not None: + ctx.load_cert_chain(str(cert), str(key) if key else None) + return ctx + + +def read_file(path: Path) -> str: + return path.read_text(encoding="utf-8").strip() + + +def http_call( + host: str, + port: int, + path: str, + ctx: ssl.SSLContext, + *, + timeout: float = 5.0, + body: bytes | None = None, + method: str = "GET", + headers: dict[str, str] | None = None, +) -> tuple[int, bytes]: + conn = http.client.HTTPSConnection(host, port, context=ctx, timeout=timeout) + conn.request(method, path, body=body, headers=headers or {}) + response = conn.getresponse() + data = response.read() + conn.close() + return response.status, data + + +def expect_http(name: str, call, expected: set[int], detail: str) -> None: + try: + status, _ = call() + record(name, status in expected, f"HTTP {status}; {detail}") + except ssl.SSLError as exc: + record(name, False, f"TLS error instead of HTTP: {exc.__class__.__name__}") + except OSError as exc: + record(name, False, f"network error: {exc.__class__.__name__}") + + +def expect_denied(name: str, call, detail: str) -> None: + """Отрицательная проверка: либо TLS/handshake, либо HTTP 403.""" + try: + status, _ = call() + record(name, status == 403, f"HTTP {status}; {detail}") + except (ssl.SSLError, OSError) as exc: + record(name, True, f"connection rejected: {exc.__class__.__name__}; {detail}") + + +def expect_tls_failure(name: str, ca: Path, host: str, port: int, cert: Path | None = None, key: Path | None = None, hostname: str | None = None) -> None: + try: + ctx = context(ca, cert, key) + with socket.create_connection((host, port), timeout=5) as raw: + with ctx.wrap_socket(raw, server_hostname=hostname or host): + pass + record(name, False, "handshake unexpectedly succeeded") + except ssl.SSLError as exc: + record(name, True, f"TLS rejected: {exc.reason or exc.__class__.__name__}") + except OSError as exc: + record(name, False, f"unexpected network error: {exc.__class__.__name__}") + + +def expect_tls_ok(name: str, ca: Path, host: str, port: int, cert: Path | None = None, key: Path | None = None, hostname: str | None = None) -> socket.socket | None: + try: + ctx = context(ca, cert, key) + raw = socket.create_connection((host, port), timeout=5) + return ctx.wrap_socket(raw, server_hostname=hostname or host) + except (ssl.SSLError, OSError) as exc: + record(name, False, f"TLS failed: {exc.__class__.__name__}") + return None + + +def external_tls() -> None: + ca = CERTS / "ca.crt" + try: + with urllib.request.urlopen("https://traefik:8443/health/ready", context=context(ca), timeout=5) as response: + record("external_tls_trusted", response.status == 200, f"HTTP {response.status}") + except Exception as exc: # noqa: BLE001 + record("external_tls_trusted", False, type(exc).__name__) + try: + urllib.request.urlopen("https://traefik:8443/health/ready", context=context(CERTS / "foreign-ca.crt"), timeout=5) + record("external_tls_untrusted_ca", False, "untrusted CA accepted") + except urllib.error.URLError as exc: + reason = getattr(exc, "reason", exc) + record("external_tls_untrusted_ca", isinstance(reason, ssl.SSLError), f"rejected: {type(reason).__name__}") + except ssl.SSLError as exc: + record("external_tls_untrusted_ca", True, f"rejected: {exc.__class__.__name__}") + try: + ctx = context(ca) + with socket.create_connection(("traefik", 8443), timeout=5) as raw: + with ctx.wrap_socket(raw, server_hostname="wrong.messenger.internal"): + pass + record("external_tls_wrong_hostname", False, "wrong hostname accepted") + except ssl.SSLError as exc: + record("external_tls_wrong_hostname", True, f"rejected: {exc.reason or exc.__class__.__name__}") + + +def api_mtls() -> None: + ca = CERTS / "ca.crt" + expect_denied( + "api_no_client_cert", + lambda: http_call("api", 8081, "/health/ready", context(ca)), + "no client certificate", + ) + expect_denied( + "api_foreign_ca_client", + lambda: http_call("api", 8081, "/health/ready", context(ca, CERTS / "tests" / "foreign-ca-client.crt", CERTS / "tests" / "foreign-ca-client.key")), + "client signed by foreign CA", + ) + # Доверенный CA, но чужая identity: TLS проходит, шлюз обязан вернуть 403. + expect_http( + "api_trusted_ca_wrong_identity", + lambda: http_call("api", 8081, "/health/ready", context(ca, CERTS / "tests" / "foreign-client.crt", CERTS / "tests" / "foreign-client.key")), + {403}, + "foreign.messenger.internal must be denied", + ) + expect_http( + "api_lb_identity_allowed", + lambda: http_call("api", 8081, "/health/ready", context(ca, CERTS / "traefik" / "lb-client.crt", CERTS / "traefik" / "lb-client.key")), + {200}, + "lb.messenger.internal ready", + ) + + +def exchange_amqp(host: str, port: int, cert: Path | None = None, key: Path | None = None) -> bytes: + ctx = context(CERTS / "ca.crt", cert, key) + with socket.create_connection((host, port), timeout=5) as raw: + with ctx.wrap_socket(raw, server_hostname="internal-gateway") as tls: + tls.sendall(b"AMQP\x00\x00\x09\x01") + tls.settimeout(3) + try: + return tls.recv(64) + except (socket.timeout, ConnectionError): + return b"" + + +def broker_mtls() -> None: + ca = CERTS / "ca.crt" + expect_denied( + "broker_no_client_cert", + lambda: (lambda data=exchange_amqp("internal-gateway", 5671): (403 if not data else 200, data))(), + "no client certificate", + ) + api_cert = CERTS / "api" / "api-client.crt" + api_key = CERTS / "api" / "api-client.key" + worker_cert = CERTS / "worker" / "worker-client.crt" + worker_key = CERTS / "worker" / "worker-client.key" + expect_http( + "broker_wrong_identity_on_producer", + lambda: (lambda data=exchange_amqp("internal-gateway", 5671, worker_cert, worker_key): (403, data))(), + {403}, + "worker identity on producer port must be closed", + ) + expect_http( + "broker_api_on_consumer_port", + lambda: (lambda data=exchange_amqp("internal-gateway", 5672, api_cert, api_key): (403, data))(), + {403}, + "api identity on consumer port must be closed", + ) + try: + data = exchange_amqp("internal-gateway", 5671, api_cert, api_key) + # RabbitMQ после protocol header отвечает AMQP-фреймом Connection.Start + # (первый байт 0x01), а не эхом заголовка; важен непустой ответ. + record("broker_api_identity_allowed", bool(data), f"AMQP Connection.Start bytes={len(data)}") + except Exception as exc: # noqa: BLE001 + record("broker_api_identity_allowed", False, type(exc).__name__) + + +def otel_mtls() -> None: + ca = CERTS / "ca.crt" + api_cert = CERTS / "api" / "api-client.crt" + api_key = CERTS / "api" / "api-client.key" + worker_cert = CERTS / "worker" / "worker-client.crt" + worker_key = CERTS / "worker" / "worker-client.key" + expect_http( + "collector_api_identity_allowed", + lambda: http_call("internal-gateway", 4318, "/v1/traces", context(ca, api_cert, api_key)), + {200, 202, 400, 404, 405}, + "api identity reaches collector", + ) + expect_http( + "collector_worker_on_api_port", + lambda: http_call("internal-gateway", 4318, "/v1/traces", context(ca, worker_cert, worker_key)), + {403}, + "worker identity on api port must be denied", + ) + expect_http( + "collector_worker_identity_allowed", + lambda: http_call("internal-gateway", 4319, "/v1/traces", context(ca, worker_cert, worker_key)), + {200, 202, 400, 404, 405}, + "worker identity reaches collector", + ) + + +def telemetry_mtls() -> None: + ca = CERTS / "ca.crt" + collector = context(ca, CERTS / "telemetry" / "telemetry-client.crt", CERTS / "telemetry" / "telemetry-client.key") + grafana = context(ca, CERTS / "telemetry" / "grafana-client.crt", CERTS / "telemetry" / "grafana-client.key") + foreign = context(ca, CERTS / "tests" / "foreign-client.crt", CERTS / "tests" / "foreign-client.key") + expect_http("loki_collector_allowed", lambda: http_call("loki-tls", 8443, "/metrics", collector), {200}, "collector reads Loki") + expect_http("loki_foreign_identity_denied", lambda: http_call("loki-tls", 8443, "/ready", foreign), {403}, "foreign identity denied") + expect_http("prometheus_grafana_allowed", lambda: http_call("prometheus-tls", 8443, "/-/ready", grafana), {200}, "Grafana reads Prometheus") + expect_http("prometheus_collector_denied", lambda: http_call("prometheus-tls", 8443, "/-/ready", collector), {403}, "collector cert on Grafana port denied") + expect_http("collector_metrics_prometheus_allowed", lambda: http_call("collector-tls", 8889, "/metrics", context(ca, CERTS / "telemetry" / "prometheus-client.crt", CERTS / "telemetry" / "prometheus-client.key")), {200}, "Prometheus scrapes collector over mTLS") + expect_http("collector_metrics_grafana_denied", lambda: http_call("collector-tls", 8889, "/metrics", grafana), {403}, "Grafana cert on scrape port denied") + + +def openbao_call(addr: str, path: str, token: str | None, payload: dict | None = None, method: str = "GET") -> tuple[int, dict]: + body = None if payload is None else json.dumps(payload).encode() + request = urllib.request.Request("https://" + addr + path, data=body, method=method) + request.add_header("Content-Type", "application/json") + if token: + request.add_header("X-Vault-Token", token) + try: + with urllib.request.urlopen(request, context=context(CERTS / "ca.crt"), timeout=5) as response: + return response.status, json.loads(response.read() or b"{}") + except urllib.error.HTTPError as exc: + return exc.code, {} + + +def login(role: str) -> str: + role_id = read_file(BAO / f"{role}_role_id") + secret_id = read_file(BAO / f"{role}_secret_id") + status, body = openbao_call("openbao:8200", "/v1/auth/approle/login", None, {"role_id": role_id, "secret_id": secret_id}, "POST") + if status != 200 or not (body.get("auth") or {}).get("client_token"): + raise RuntimeError(f"AppRole {role} login failed: {status}") + return str(body["auth"]["client_token"]) + + +def openbao_policy() -> None: + api_token = login("api") + worker_token = login("worker") + status, _ = openbao_call("openbao:8200", "/v1/kv/data/messenger/api", api_token) + record("openbao_api_own_secret_allowed", status == 200, f"HTTP {status}") + status, _ = openbao_call("openbao:8200", "/v1/kv/data/messenger/worker", api_token) + record("openbao_api_foreign_secret_denied", status == 403, f"HTTP {status}") + status, _ = openbao_call("openbao:8200", "/v1/sys/policies/acl/messenger-api", api_token, {"policy": 'path "secret/*" { capabilities = ["read"] }'}, "PUT") + record("openbao_api_policy_write_denied", status == 403, f"HTTP {status}") + status, _ = openbao_call("openbao:8200", "/v1/sys/policies/acl", api_token) + record("openbao_api_policy_list_denied", status == 403, f"HTTP {status}") + status, _ = openbao_call("openbao:8200", "/v1/kv/data/messenger/api", worker_token) + record("openbao_worker_foreign_secret_denied", status == 403, f"HTTP {status}") + + +async def db_checks() -> None: + import asyncpg + + ca = CERTS / "ca.crt" + api_token = login("api") + worker_token = login("worker") + _, api_body = openbao_call("openbao:8200", "/v1/kv/data/messenger/api", api_token) + _, worker_body = openbao_call("openbao:8200", "/v1/kv/data/messenger/worker", worker_token) + api_url = str((api_body.get("data") or {}).get("data", {}).get("DATABASE_URL", "")) + worker_url = str((worker_body.get("data") or {}).get("data", {}).get("DATABASE_URL", "")) + ctx = context(ca) + api_url = api_url.replace("postgresql+asyncpg://", "postgresql://") + worker_url = worker_url.replace("postgresql+asyncpg://", "postgresql://") + api_conn = await asyncpg.connect(api_url, ssl=ctx, timeout=5) + try: + await api_conn.fetchval("SELECT 1") + record("postgres_api_tls_allowed", True, "verified TLS + SELECT 1") + finally: + await api_conn.close() + worker_conn = await asyncpg.connect(worker_url, ssl=ctx, timeout=5) + try: + await worker_conn.fetchval("SELECT count(*) FROM jobs") + record("postgres_worker_jobs_allowed", True, "worker reads jobs") + denied = False + try: + await worker_conn.fetch("SELECT username, password_hash FROM users LIMIT 1") + except asyncpg.InsufficientPrivilegeError: + denied = True + record("postgres_worker_users_denied", denied, "users/password_hash denied") + denied = False + try: + await worker_conn.execute("CREATE TABLE lab7_probe_forbidden (id int)") + except asyncpg.InsufficientPrivilegeError: + denied = True + record("postgres_worker_ddl_denied", denied, "CREATE TABLE denied") + finally: + await worker_conn.close() + # Plaintext host connection must be rejected by pg_hba (hostnossl reject). + plain_denied = False + try: + plain = await asyncpg.connect(api_url, ssl=False, timeout=5) + await plain.close() + except (asyncpg.PostgresError, OSError): + plain_denied = True + record("postgres_plaintext_rejected", plain_denied, "ssl=False rejected") + + +def s3_checks() -> None: + import boto3 + from botocore.exceptions import ClientError + + ca = CERTS / "ca.crt" + token = login("api") + _, body = openbao_call("openbao:8200", "/v1/kv/data/messenger/api", token) + data = (body.get("data") or {}).get("data", {}) + endpoint = str(data.get("S3_ENDPOINT", "https://minio:9000")) + client = boto3.client( + "s3", + endpoint_url=endpoint, + region_name="us-east-1", + aws_access_key_id=str(data["S3_ACCESS_KEY_ID"]), + aws_secret_access_key=str(data["S3_SECRET_ACCESS_KEY"]), + verify=str(ca), + ) + try: + client.list_objects_v2(Bucket="messenger-attachments", Prefix="attachments/staging/", MaxKeys=1) + record("s3_api_tls_allowed", True, "TLS + ListBucket staging") + except Exception as exc: # noqa: BLE001 + record("s3_api_tls_allowed", False, type(exc).__name__) + denied = False + try: + client.put_object(Bucket="messenger-attachments", Key="attachments/other/forbidden", Body=b"x") + except ClientError as exc: + denied = exc.response.get("Error", {}).get("Code") == "AccessDenied" + record("s3_api_foreign_prefix_denied", denied, "attachments/other/* denied") + try: + bad = boto3.client( + "s3", + endpoint_url=endpoint, + region_name="us-east-1", + aws_access_key_id=str(data["S3_ACCESS_KEY_ID"]), + aws_secret_access_key=str(data["S3_SECRET_ACCESS_KEY"]), + verify=str(CERTS / "foreign-ca.crt"), + ) + bad.list_objects_v2(Bucket="messenger-attachments", Prefix="attachments/staging/", MaxKeys=1) + record("s3_untrusted_ca_rejected", False, "untrusted CA accepted") + except Exception as exc: # noqa: BLE001 + record("s3_untrusted_ca_rejected", True, type(exc).__name__) + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--json-out", default="") + args = parser.parse_args() + external_tls() + api_mtls() + broker_mtls() + otel_mtls() + telemetry_mtls() + openbao_policy() + asyncio.run(db_checks()) + s3_checks() + failed = [item for item in RESULTS if not item["ok"]] + summary = {"checks": RESULTS, "passed": len(RESULTS) - len(failed), "failed": len(failed)} + print(json.dumps(summary, ensure_ascii=False, sort_keys=True)) + if args.json_out: + Path(args.json_out).write_text(json.dumps(summary, ensure_ascii=False, indent=2, sort_keys=True), encoding="utf-8") + return 0 if not failed else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/openbao_bootstrap.py b/scripts/openbao_bootstrap.py new file mode 100644 index 0000000..92a9983 --- /dev/null +++ b/scripts/openbao_bootstrap.py @@ -0,0 +1,246 @@ +"""Инициализация OpenBao и выдача scoped AppRole для сервисов. + +Скрипт запускается один раз в контейнере bootstrap и использует root token +только здесь. Unseal-ключи и root token сохраняются в secrets/openbao-init.json +(mode 644, gitignored) и не попадают в образ/логи/отчёт. Повторный запуск +проверяет, что OpenBao уже инициализирован, и только unseal-ит его. + +Политики: + messenger-api -> read kv/data/messenger/api + messenger-worker -> read kv/data/messenger/worker + messenger-relay -> read kv/data/messenger/relay +Ни одна роль не может читать чужой path или писать политики. +""" +from __future__ import annotations + +import json +import os +import ssl +import sys +import time +import urllib.error +import urllib.request +from pathlib import Path + +ADDR = os.environ.get("BAO_ADDR", "https://openbao:8200").rstrip("/") +CA = os.environ.get("BAO_CACERT", "/certs/ca.crt") +BOOT = Path(os.environ.get("BOOTSTRAP_DIR", "/bootstrap")) +INIT_FILE = BOOT / "openbao-init.json" +SECRETS = BOOT + +TOKEN_TTL = int(os.environ.get("BAO_TOKEN_TTL_SECONDS", "300")) +TOKEN_MAX_TTL = int(os.environ.get("BAO_TOKEN_MAX_TTL_SECONDS", "900")) +SECRET_ID_TTL = int(os.environ.get("BAO_SECRET_ID_TTL_SECONDS", "86400")) + + +def log(event: str, **fields: object) -> None: + """Печатает только несекретные поля.""" + print(json.dumps({"event": event, **fields}, sort_keys=True), flush=True) + + +def read_secret(name: str) -> str: + value = (SECRETS / name).read_text(encoding="utf-8").strip() + if not value: + raise RuntimeError(f"{name} is empty") + return value + + +class Bao: + def __init__(self) -> None: + self.token: str | None = None + self.context = ssl.create_default_context(cafile=CA) + self.context.check_hostname = True + self.context.verify_mode = ssl.CERT_REQUIRED + + def request(self, method: str, path: str, payload: dict | None = None) -> dict: + body = None if payload is None else json.dumps(payload).encode("utf-8") + request = urllib.request.Request(ADDR + path, data=body, method=method) + request.add_header("Content-Type", "application/json") + if self.token: + request.add_header("X-Vault-Token", self.token) + try: + with urllib.request.urlopen(request, timeout=10, context=self.context) as response: + raw = response.read().decode("utf-8") + return json.loads(raw) if raw else {} + except urllib.error.HTTPError as exc: + detail = exc.read().decode("utf-8", "replace")[:300] + raise RuntimeError(f"OpenBao HTTP {exc.code} {method} {path}: {detail}") from None + except urllib.error.URLError as exc: + raise RuntimeError(f"OpenBao unavailable: {exc.reason}") from None + + def wait_ready(self, timeout: float = 120.0) -> None: + deadline = time.time() + timeout + while time.time() < deadline: + try: + # /v1/sys/init отвечает и до init, и в sealed-состоянии. + self.request("GET", "/v1/sys/init") + return + except RuntimeError: + time.sleep(2) + raise RuntimeError("OpenBao did not become reachable") + + def init_or_load(self) -> None: + status = self.request("GET", "/v1/sys/init") + if not status.get("initialized"): + response = self.request( + "POST", + "/v1/sys/init", + {"secret_shares": 5, "secret_threshold": 3}, + ) + INIT_FILE.write_text(json.dumps(response), encoding="utf-8") + os.chmod(INIT_FILE, 0o644) + log("openbao_initialized", shares=5, threshold=3) + data = json.loads(INIT_FILE.read_text(encoding="utf-8")) + self.root_token = str(data["root_token"]) + keys = [str(key) for key in data["keys_base64"]] + health = self.request("GET", "/v1/sys/seal-status") + if health.get("sealed"): + for key in keys[:3]: + self.request("POST", "/v1/sys/unseal", {"key": key}) + log("openbao_unsealed") + self.token = self.root_token + + def enable(self, path: str, payload: dict) -> None: + try: + self.request("POST", f"/v1/sys/{path}", payload) + log("openbao_mount_enabled", path=path) + except RuntimeError as exc: + if "already in use" in str(exc) or "path is already in use" in str(exc): + return + raise + + def put_policy(self, name: str, body: str) -> None: + self.request("PUT", f"/v1/sys/policies/acl/{name}", {"policy": body}) + log("openbao_policy_written", name=name) + + def write_kv(self, path: str, data: dict[str, str]) -> None: + self.request("POST", f"/v1/kv/data/{path}", {"data": data}) + log("openbao_secret_written", path=path, keys=sorted(data)) + + def role(self, name: str, policy: str) -> None: + self.request( + "POST", + f"/v1/auth/approle/role/{name}", + { + "token_policies": [policy], + "token_ttl": TOKEN_TTL, + "token_max_ttl": TOKEN_MAX_TTL, + "secret_id_ttl": SECRET_ID_TTL, + "secret_id_num_uses": 0, + "bind_secret_id": True, + }, + ) + out = BOOT / "bao_runtime" + existing_role = out / f"{name}_role_id" + existing_secret = out / f"{name}_secret_id" + if ( + existing_role.is_file() + and existing_secret.is_file() + and existing_role.read_text(encoding="utf-8").strip() + and existing_secret.read_text(encoding="utf-8").strip() + ): + # Повторный bootstrap (например, после unseal) не должен менять + # действующие credentials работающих процессов. + log("openbao_approle_kept", name=name) + return + role_id = self.request("GET", f"/v1/auth/approle/role/{name}/role-id")["data"]["role_id"] + secret_id = self.request( + "POST", + f"/v1/auth/approle/role/{name}/secret-id", + {"ttl": f"{SECRET_ID_TTL}s"}, + )["data"]["secret_id"] + out.mkdir(mode=0o755, parents=True, exist_ok=True) + (out / f"{name}_role_id").write_text(role_id, encoding="utf-8") + (out / f"{name}_secret_id").write_text(secret_id, encoding="utf-8") + os.chmod(out / f"{name}_role_id", 0o644) + os.chmod(out / f"{name}_secret_id", 0o644) + log("openbao_approle_created", name=name, token_ttl=TOKEN_TTL) + + +def main() -> int: + bao = Bao() + bao.wait_ready() + bao.init_or_load() + bao.enable("mounts/kv", {"type": "kv", "options": {"version": "2"}}) + try: + bao.enable("auth/approle", {"type": "approle"}) + except RuntimeError as exc: + if "path is already in use" not in str(exc): + raise + + api_pw = read_secret("db_api_password") + worker_pw = read_secret("db_worker_password") + relay_pw = read_secret("db_relay_password") + api_s3_key = read_secret("s3_api_access_key") + api_s3_secret = read_secret("s3_api_secret_key") + worker_s3_key = read_secret("s3_worker_access_key") + worker_s3_secret = read_secret("s3_worker_secret_key") + rabbit_api_user = read_secret("rabbitmq_api_user") + rabbit_api_password = read_secret("rabbitmq_api_password") + rabbit_worker_user = read_secret("rabbitmq_worker_user") + rabbit_worker_password = read_secret("rabbitmq_worker_password") + cursor_secret = read_secret("cursor_secret") + + bao.put_policy( + "messenger-api", + 'path "kv/data/messenger/api" { capabilities = ["read"] }\n' + 'path "kv/metadata/messenger/api" { capabilities = ["read"] }\n', + ) + bao.put_policy( + "messenger-worker", + 'path "kv/data/messenger/worker" { capabilities = ["read"] }\n' + 'path "kv/metadata/messenger/worker" { capabilities = ["read"] }\n', + ) + bao.put_policy( + "messenger-relay", + 'path "kv/data/messenger/relay" { capabilities = ["read"] }\n' + 'path "kv/metadata/messenger/relay" { capabilities = ["read"] }\n', + ) + + common_s3 = "https://minio:9000" + bao.write_kv( + "messenger/api", + { + "DATABASE_URL": f"postgresql+asyncpg://messenger_api:{api_pw}@postgres:5432/messenger", + "S3_ENDPOINT": common_s3, + "S3_ACCESS_KEY_ID": api_s3_key, + "S3_SECRET_ACCESS_KEY": api_s3_secret, + "BROKER_URL": f"amqps://{rabbit_api_user}:{rabbit_api_password}@internal-gateway:5671/", + "CURSOR_SECRET": cursor_secret, + }, + ) + bao.write_kv( + "messenger/worker", + { + "DATABASE_URL": f"postgresql+asyncpg://messenger_worker:{worker_pw}@postgres:5432/messenger", + "S3_ENDPOINT": common_s3, + "S3_ACCESS_KEY_ID": worker_s3_key, + "S3_SECRET_ACCESS_KEY": worker_s3_secret, + "BROKER_URL": f"amqps://{rabbit_worker_user}:{rabbit_worker_password}@internal-gateway:5672/", + }, + ) + bao.write_kv( + "messenger/relay", + { + "DATABASE_URL": f"postgresql+asyncpg://messenger_relay:{relay_pw}@postgres:5432/messenger", + "S3_ENDPOINT": common_s3, + "S3_ACCESS_KEY_ID": worker_s3_key, + "S3_SECRET_ACCESS_KEY": worker_s3_secret, + "BROKER_URL": f"amqps://{rabbit_api_user}:{rabbit_api_password}@internal-gateway:5671/", + "CURSOR_SECRET": cursor_secret, + }, + ) + + bao.role("api", "messenger-api") + bao.role("worker", "messenger-worker") + bao.role("relay", "messenger-relay") + log("openbao_bootstrap_complete") + return 0 + + +if __name__ == "__main__": + try: + raise SystemExit(main()) + except Exception as exc: # noqa: BLE001 - оператору нужен только тип/сообщение + log("openbao_bootstrap_failed", error=type(exc).__name__, detail=str(exc)[:300]) + raise SystemExit(1) diff --git a/scripts/openbao_seal_test.sh b/scripts/openbao_seal_test.sh new file mode 100644 index 0000000..873d8f0 --- /dev/null +++ b/scripts/openbao_seal_test.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# Проверка поведения при sealed OpenBao: работающие реплики продолжают servить, +# новая реплика fail-closed не становится ready, после unseal восстанавливается. +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" +CURL_OPTS="" +case "$(uname -s 2>/dev/null || true)" in + MINGW*|MSYS*|CYGWIN*) CURL_OPTS="--ssl-no-revoke" ;; +esac + +mkdir -p evidence +ROOT_TOKEN=$(python -c "import json;print(json.load(open('secrets/openbao-init.json'))['root_token'])") +curl $CURL_OPTS --cacert certs/ca.crt -fsS -X PUT -H "X-Vault-Token: $ROOT_TOKEN" https://127.0.0.1:8200/v1/sys/seal >/dev/null +sleep 2 +{ + echo "# OpenBao sealed, $(date -u +%Y-%m-%dT%H:%M:%SZ)" + echo -n "existing API readiness through LB: " + curl $CURL_OPTS --cacert certs/ca.crt -s -o /dev/null -w '%{http_code}\n' https://localhost:8443/health/ready || true +} > evidence/openbao-sealed.txt +docker stop lab7-api-2 >/dev/null +: > /tmp/api2-before-start.log +docker start lab7-api-2 >/dev/null +sleep 18 +{ + echo "new API container state: $(docker inspect -f '{{.State.Status}} restarts={{.RestartCount}} health={{if .State.Health}}{{.State.Health.Status}}{{end}}' lab7-api-2)" + echo -n "new API local /health/ready during seal: " + docker exec lab7-api-2 python -c "import urllib.request,urllib.error; +try: + print(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status) +except Exception as e: + print(type(e).__name__)" 2>&1 || true + echo "--- new API log lines since seal ---" + docker logs --since 20s lab7-api-2 2>&1 | tail -n 6 +} >> evidence/openbao-sealed.txt +docker compose --env-file .env run --rm --no-deps openbao-bootstrap >/dev/null +sleep 12 +{ + echo "--- after unseal ---" + echo -n "readiness through LB: " + curl $CURL_OPTS --cacert certs/ca.crt -s -o /dev/null -w '%{http_code}\n' https://localhost:8443/health/ready || true + echo "api-2 state: $(docker inspect -f '{{.State.Status}} health={{if .State.Health}}{{.State.Health.Status}}{{end}}' lab7-api-2)" +} >> evidence/openbao-sealed.txt +cat evidence/openbao-sealed.txt diff --git a/scripts/restart.cmd b/scripts/restart.cmd new file mode 100644 index 0000000..95774c9 --- /dev/null +++ b/scripts/restart.cmd @@ -0,0 +1,5 @@ +@echo off +rem Windows wrapper for the public resilience test, which executes ACTION_SCRIPT +rem directly. The implementation is restart.sh (POSIX); this only invokes sh. +sh "%~dp0restart.sh" +exit /b %ERRORLEVEL% diff --git a/scripts/restart.sh b/scripts/restart.sh new file mode 100644 index 0000000..2301bd8 --- /dev/null +++ b/scripts/restart.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Перезапуск API и всех stateful-сервисов без удаления volumes. +# OpenBao после рестарта sealed, поэтому bootstrap повторно unseal-ит его, +# не меняя действующие AppRole credentials (см. openbao_bootstrap.py). +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" +project=${COMPOSE_PROJECT_NAME:-lab7} + +for service in postgres minio rabbitmq openbao; do + for container in $(docker ps -q \ + --filter "label=com.docker.compose.project=$project" \ + --filter "label=com.docker.compose.service=$service"); do + printf 'restarting %s (%s)\n' "$service" "$container" + docker restart "$container" >/dev/null + done +done + +# unseal + повторная проверка политик; повторный запуск не ротирует credentials. +docker compose --env-file .env run --rm --no-deps openbao-bootstrap >/dev/null + +for service in api worker relay; do + for container in $(docker ps -q \ + --filter "label=com.docker.compose.project=$project" \ + --filter "label=com.docker.compose.service=$service"); do + printf 'restarting %s (%s)\n' "$service" "$container" + docker restart "$container" >/dev/null + done +done + +i=0 +while [ "$i" -lt 60 ]; do + if "$ROOT/scripts/wait-ready.sh" >/dev/null 2>&1; then + printf 'stack ready after restart\n' + exit 0 + fi + i=$((i + 1)) + sleep 2 +done +printf 'stack did not become ready within 120s\n' >&2 +exit 1 diff --git a/scripts/restore.cmd b/scripts/restore.cmd new file mode 100644 index 0000000..a74c852 --- /dev/null +++ b/scripts/restore.cmd @@ -0,0 +1,3 @@ +@echo off +sh "%~dp0restore.sh" +exit /b %ERRORLEVEL% diff --git a/scripts/restore.sh b/scripts/restore.sh new file mode 100644 index 0000000..a2df2b1 --- /dev/null +++ b/scripts/restore.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Возвращает остановленную вручную API-реплику. Остальные сервисы не трогает. +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" +docker compose --env-file .env up -d api +# Compose не всегда стартует вручную остановленный контейнер; start по id +# гарантирует, что обе реплики снова участвуют в балансировке. +for container in $(docker ps -aq \ + --filter "label=com.docker.compose.project=lab7" \ + --filter "label=com.docker.compose.service=api"); do + docker start "$container" >/dev/null 2>&1 || true +done diff --git a/scripts/rotate-worker-cert.sh b/scripts/rotate-worker-cert.sh new file mode 100644 index 0000000..af238eb --- /dev/null +++ b/scripts/rotate-worker-cert.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# Ротация leaf-сертификата worker без пересборки образов и отзыв старой identity +# через локальный revocation list mTLS-шлюза. CA остаётся тем же; новый leaf +# имеет тот же SAN, поэтому меняется только serial/key. +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" + +CA_CERT="secrets/certs/internal-ca.crt" +CA_KEY="secrets/ca-private/internal-ca.key" +DIR="secrets/certs/worker" +OLD_CERT="$DIR/worker-client.crt" +OLD_KEY="$DIR/worker-client.key" +REVOKED="secrets/certs/gateway/revoked-serials.txt" + +[ -f "$OLD_CERT" ] || { echo "worker cert not found" >&2; exit 2; } +OLD_SERIAL=$(openssl x509 -in "$OLD_CERT" -noout -serial | cut -d= -f2 | tr 'A-F' 'a-f') +cp "$OLD_CERT" "secrets/certs/tests/old-worker.crt" +cp "$OLD_KEY" "secrets/certs/tests/old-worker.key" + +openssl genrsa -out "$DIR/worker-client.key.new" 2048 >/dev/null 2>&1 +openssl req -new -key "$DIR/worker-client.key.new" -subj "/CN=worker-client" -out "$DIR/worker-client.csr" +cat > "$DIR/worker-client.ext" </dev/null 2>&1 +mv "$DIR/worker-client.crt.new" "$OLD_CERT" +mv "$DIR/worker-client.key.new" "$OLD_KEY" +rm -f "$DIR/worker-client.csr" "$DIR/worker-client.ext" +NEW_SERIAL=$(openssl x509 -in "$OLD_CERT" -noout -serial | cut -d= -f2 | tr 'A-F' 'a-f') + +# Старый serial попадает в revocation list; шлюз перечитывает файл при старте. +if ! grep -qx "$OLD_SERIAL" "$REVOKED" 2>/dev/null; then + printf '%s\n' "$OLD_SERIAL" >> "$REVOKED" +fi + +docker compose --env-file .env up -d --force-recreate --no-deps internal-gateway worker >/dev/null +sh scripts/wait-ready.sh >/dev/null +printf 'rotated worker leaf: old_serial=%s new_serial=%s\n' "$OLD_SERIAL" "$NEW_SERIAL" +printf 'old certificate is in %s and revocation list\n' "secrets/certs/tests/old-worker.crt" diff --git a/scripts/security_checks.py b/scripts/security_checks.py new file mode 100644 index 0000000..c115294 --- /dev/null +++ b/scripts/security_checks.py @@ -0,0 +1,147 @@ +"""Негативные проверки ACL, logout/expiry, лимита входа и размера запроса.""" +from __future__ import annotations + +import base64 +import hashlib +import json +import subprocess +import sys +import time +import uuid +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tests")) +from client import Client # noqa: E402 + +CA = str(ROOT / "certs" / "ca.crt") +client = Client("https://localhost:8443", CA) +results = [] + + +def record(name: str, ok: bool, detail: str) -> None: + results.append({"name": name, "ok": ok, "detail": detail}) + print(("PASS " if ok else "FAIL ") + name + ": " + detail) + + +def psql(sql: str) -> None: + subprocess.run( + ["docker", "exec", "lab7-postgres-1", "psql", "-U", "messenger", "-d", "messenger", "-v", "ON_ERROR_STOP=1", "-c", sql], + check=True, + capture_output=True, + text=True, + ) + + +def main() -> int: + alice, bob, eve, chat = client.bootstrap() + att, _ = client.attachment(alice, chat) + att = client.wait_ready(alice, att) + + # Чужой не видит ни чат, ни вложение, ни историю. + for name, method, path in ( + ("acl_foreign_history", "GET", f"/api/v1/chats/{chat['id']}/messages"), + ("acl_foreign_attachment", "GET", f"/api/v1/attachments/{att['id']}"), + ("acl_foreign_attachment_content", "GET", f"/api/v1/attachments/{att['id']}/content"), + ): + response = client.call(method, path, 404, actor=eve, schema="Error") + record(name, response["status"] == 404, f"HTTP {response['status']}") + + # Поддельный X-User-Id не меняет владельца Bearer-сессии. + sent = client.call( + "POST", + f"/api/v1/chats/{chat['id']}/messages", + 201, + actor=alice, + body={"text": "identity check"}, + headers={"Idempotency-Key": uuid.uuid4().hex, "X-User-Id": eve["id"]}, + schema="Message", + )["json"] + record("acl_fake_x_user_id_ignored", sent["sender_id"] == alice["id"], "sender is Bearer owner") + + # Logout и повторное использование отозванного токена. + client.call("DELETE", "/api/v1/auth/sessions/current", 204, actor=alice) + response = client.call("GET", "/api/v1/users/me", 401, actor=alice, schema="Error") + record("session_logout_revoked", response["status"] == 401, "revoked token -> 401") + + # Expiry: TTL абсолютный, поэтому проверяем его переводом expires_at в прошлое. + login = client.call( + "POST", + "/api/v1/auth/sessions", + 201, + headers={"Authorization": "Basic " + base64.b64encode( + (alice["registration"]["username"] + ":" + alice["registration"]["password"]).encode() + ).decode()}, + schema="Session", + )["json"] + token_hash = hashlib.sha256(login["token"].encode()).hexdigest() + psql(f"UPDATE sessions SET expires_at = now() - interval '1 second' WHERE token_hash = '{token_hash}'") + expired = client.call("GET", "/api/v1/users/me", 401, actor={"id": alice["id"], "token": login["token"]}, schema="Error") + record("session_expiry_enforced", expired["status"] == 401, "expired token -> 401") + + # Лимит входа: неизвестный username, одинаковый 401, затем 429 + Retry-After. + username = "ghost_" + uuid.uuid4().hex[:10] + credential = base64.b64encode((username + ":wrong-password-value").encode()).decode() + limited = None + instances = set() + for index in range(12): + response = client.call( + "POST", + "/api/v1/auth/sessions", + 401 if index < 10 else 429, + headers={"Authorization": "Basic " + credential}, + schema="Error", + ) + instances.add(response["headers"].get("X-Instance-Id")) + if response["status"] == 429: + limited = response + break + ok = limited is not None and bool(limited["headers"].get("Retry-After")) + record( + "login_rate_limit_429", + ok, + f"attempts={index + 1}, retry_after={limited['headers'].get('Retry-After') if limited else None}, instances={len(instances)}", + ) + # Проверяем, что блокировка видна другой реплике: повтор сразу после 429. + if limited is not None: + second = client.call( + "POST", "/api/v1/auth/sessions", 429, + headers={"Authorization": "Basic " + credential}, schema="Error", + ) + record("login_rate_limit_shared", second["status"] == 429, "second replica also 429") + + # Размер запроса: 10 MiB + 1 байт должен дать 413 до декодирования. + oversized = b"\x89PNG\r\n\x1a\n" + b"0" * (10_485_760 + 1 - 8) + try: + client.call( + "POST", + f"/api/v1/chats/{chat['id']}/attachments?filename=big.png", + 413, + actor=bob, + raw=oversized, + headers={"Content-Type": "image/png"}, + schema="Error", + ) + record("upload_size_limit_413", True, "10 MiB + 1 rejected") + except Exception as exc: # noqa: BLE001 + record("upload_size_limit_413", False, type(exc).__name__) + + # Неверный MIME по содержимому -> 415. + response = client.call( + "POST", + f"/api/v1/chats/{chat['id']}/attachments?filename=fake.png", + 415, + actor=bob, + raw=b"not-an-image", + headers={"Content-Type": "image/png"}, + schema="Error", + ) + record("upload_mime_by_content_415", response["status"] == 415, "fake PNG rejected") + + failed = [item for item in results if not item["ok"]] + print(json.dumps({"checks": results, "passed": len(results) - len(failed), "failed": len(failed)}, ensure_ascii=False, sort_keys=True)) + return 0 if not failed else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/stop-one.cmd b/scripts/stop-one.cmd new file mode 100644 index 0000000..ef06598 --- /dev/null +++ b/scripts/stop-one.cmd @@ -0,0 +1,4 @@ +@echo off +rem Windows wrapper for failover hook; implementation is stop-one.sh. +sh "%~dp0stop-one.sh" +exit /b %ERRORLEVEL% diff --git a/scripts/stop-one.sh b/scripts/stop-one.sh new file mode 100644 index 0000000..aac4742 --- /dev/null +++ b/scripts/stop-one.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Останавливает ровно одну API-реплику по X-Instance-Id (= hostname контейнера) +# и оставляет её остановленной. Восстановление — scripts/restore.sh. +set -eu +project=${COMPOSE_PROJECT_NAME:-lab7} +target=${TARGET_INSTANCE_ID:-} +if [ -z "$target" ]; then + printf 'TARGET_INSTANCE_ID is required\n' >&2 + exit 2 +fi +for container in $(docker ps -q \ + --filter "label=com.docker.compose.project=$project" \ + --filter "label=com.docker.compose.service=api"); do + hostname=$(docker inspect -f '{{.Config.Hostname}}' "$container" 2>/dev/null || true) + if [ "$hostname" = "$target" ]; then + printf 'stopping instance %s container %s\n' "$target" "$container" + docker stop --time 3 "$container" >/dev/null + exit 0 + fi +done +printf 'target instance %s not found among running api containers\n' "$target" >&2 +exit 4 diff --git a/scripts/telem_check.py b/scripts/telem_check.py new file mode 100644 index 0000000..811ed3a --- /dev/null +++ b/scripts/telem_check.py @@ -0,0 +1,10 @@ +import json, subprocess, sys, time +sys.path.insert(0, r"C:\Users\denis\Desktop\HighLoad\mtusi2026lab7\tests") +from client import Client +c=Client("https://localhost:8443", r"C:\Users\denis\Desktop\HighLoad\mtusi2026lab7\certs\ca.crt") +u=c.user("telemetry") +p=u["registration"]["password"] +time.sleep(6) +r=subprocess.run(["docker","compose","--env-file",".env","exec","-T","security-probe","python","/app/scripts/loki_query.py"],input=p,text=True,capture_output=True) +print(r.stdout.strip()) +print(r.stderr.strip()) diff --git a/scripts/track1.py b/scripts/track1.py new file mode 100644 index 0000000..fd687fe --- /dev/null +++ b/scripts/track1.py @@ -0,0 +1,299 @@ +"""Track 1: компрометация worker-а, least privilege, отзыв identity и восстановление. + +Сценарий: + 1. создаёт на стенде намеренно over-broad identity (DB/S3/broker) и измеряет, + что с ними может сделать «скомпрометированный» worker; + 2. измеряет те же операции с реальными least-privilege credentials worker-а; + 3. останавливает worker, ставит в очередь N новых upload-ов, отзывает identity + (DB NOLOGIN, MinIO disable/delete, RabbitMQ delete), показывает, что задачи + сохранились, а worker не может подключиться; + 4. ротирует DB/S3/broker credentials, обновляет OpenBao, восстанавливает + обработку и проверяет, что все N задач стали ready без дублей; + 5. ротирует leaf-сертификат worker-а и проверяет отзыв старого serial. + +Все секреты остаются в secrets/ и OpenBao; в JSON/вывод не попадают. +""" +from __future__ import annotations + +import json +import os +import ssl +import subprocess +import sys +import time +import urllib.request +import uuid +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tests")) +from client import Client # noqa: E402 + +CA = ROOT / "certs" / "ca.crt" +SECRETS = ROOT / "secrets" +OUT = ROOT / "evidence" / "track1" +BASE_URL = "https://localhost:8443" + + +def sh(cmd: list[str], *, check: bool = True) -> subprocess.CompletedProcess: + result = subprocess.run(cmd, cwd=ROOT, text=True, capture_output=True) + if check and result.returncode != 0: + raise RuntimeError(f"command failed: {' '.join(cmd[:3])}: {result.stderr[-500:]}") + return result + + +def compose(*args: str, check: bool = True) -> subprocess.CompletedProcess: + return sh(["docker", "compose", "--env-file", ".env", *args], check=check) + + +def psql(sql: str) -> str: + result = sh( + ["docker", "exec", "lab7-postgres-1", "psql", "-U", "messenger", "-d", "messenger", "-v", "ON_ERROR_STOP=1", "-Atc", sql], + check=False, + ) + if result.returncode != 0: + raise RuntimeError("psql failed: " + result.stderr[:1200].replace("\n", " | ")) + return result.stdout.strip() + + +def mc(script: str) -> str: + # Root-учётка MinIO доступна только внутри bootstrap-команды. + wrapper = ( + 'export MC_CONFIG_DIR=/tmp/mc-track1; export SSL_CERT_FILE=/certs/ca.crt; ' + 'mc alias set local https://minio:9000 "$(cat /run/secrets/minio_root_user)" ' + '"$(cat /run/secrets/minio_root_password)" >/dev/null 2>&1; ' + script + ) + return sh(["docker", "compose", "--env-file", ".env", "exec", "-T", "minio", "sh", "-c", wrapper]).stdout + + +def rabbit(*args: str) -> str: + return sh(["docker", "compose", "--env-file", ".env", "exec", "-T", "rabbitmq", "rabbitmqctl", *args]).stdout + + +def ensure_rabbit_user(user: str, password: str) -> None: + """Идемпотентно: создать пользователя или сменить ему пароль.""" + result = sh( + ["docker", "compose", "--env-file", ".env", "exec", "-T", "rabbitmq", "rabbitmqctl", "add_user", user, password], + check=False, + ) + if result.returncode != 0: + if "already exists" not in result.stderr: + raise RuntimeError("rabbit user setup failed") + rabbit("change_password", user, password) + + +def read_secret(name: str) -> str: + return (SECRETS / name).read_text(encoding="utf-8").strip() + + +def write_secret(name: str, value: str) -> None: + (SECRETS / name).write_text(value, encoding="utf-8") + + +def bao_put_worker(values: dict[str, str]) -> None: + init = json.loads((SECRETS / "openbao-init.json").read_text(encoding="utf-8")) + ctx = ssl.create_default_context(cafile=str(CA)) + body = json.dumps({"data": values}).encode() + request = urllib.request.Request( + "https://127.0.0.1:8200/v1/kv/data/messenger/worker", data=body, method="POST" + ) + request.add_header("Content-Type", "application/json") + request.add_header("X-Vault-Token", str(init["root_token"])) + with urllib.request.urlopen(request, context=ctx, timeout=5) as response: + if response.status != 200: + raise RuntimeError("OpenBao KV update failed") + + +def run_probe(identity: str, env: dict[str, str] | None = None) -> dict: + args = ["docker", "compose", "--env-file", ".env", "exec", "-T"] + for key, value in (env or {}).items(): + args.extend(["-e", f"{key}={value}"]) + args.extend(["security-probe", "python", "/app/scripts/track1_probe.py", "--identity", identity]) + result = sh(args) + return json.loads(result.stdout.strip().splitlines()[-1]) + + +def setup_broad() -> dict[str, str]: + suffix = uuid.uuid4().hex[:8] + db_pw = uuid.uuid4().hex + s3_key = f"track1-broad-{suffix}" + s3_secret = uuid.uuid4().hex + rabbit_user = f"track1-broad-{suffix}" + rabbit_pw = uuid.uuid4().hex + sql = f""" + DO $$ + BEGIN + IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'messenger_worker_broad') THEN + CREATE ROLE messenger_worker_broad LOGIN; + END IF; + END $$; + ALTER ROLE messenger_worker_broad WITH LOGIN PASSWORD '{db_pw}' NOSUPERUSER NOCREATEDB NOCREATEROLE; + GRANT CONNECT ON DATABASE messenger TO messenger_worker_broad; + GRANT USAGE ON SCHEMA public TO messenger_worker_broad; + GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO messenger_worker_broad; + GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO messenger_worker_broad; + """ + psql(sql) + mc( + f'mc admin user add local {s3_key} {s3_secret} >/dev/null 2>&1 || true; ' + f'mc admin policy attach local consoleAdmin --user {s3_key} >/dev/null 2>&1 || true' + ) + rabbit("add_user", rabbit_user, rabbit_pw) + rabbit("set_permissions", "-p", "/", rabbit_user, ".*", ".*", ".*") + return { + "BROAD_DATABASE_URL": f"postgresql+asyncpg://messenger_worker_broad:{db_pw}@postgres:5432/messenger", + "BROAD_S3_ACCESS_KEY": s3_key, + "BROAD_S3_SECRET_KEY": s3_secret, + "BROAD_BROKER_URL": f"amqps://{rabbit_user}:{rabbit_pw}@internal-gateway:5671/", + "_db_pw": db_pw, + "_s3_key": s3_key, + "_s3_secret": s3_secret, + "_rabbit_user": rabbit_user, + "_rabbit_pw": rabbit_pw, + } + + +def cleanup_broad(broad: dict[str, str]) -> None: + psql("DROP OWNED BY messenger_worker_broad; DROP ROLE IF EXISTS messenger_worker_broad") + mc( + f'mc admin user remove local {broad["_s3_key"]} >/dev/null 2>&1 || true' + ) + rabbit("delete_user", broad["_rabbit_user"]) + + +def rotate_worker() -> dict[str, str]: + new_db_pw = uuid.uuid4().hex + new_s3_secret = uuid.uuid4().hex + new_rabbit_pw = uuid.uuid4().hex + psql(f"ALTER ROLE messenger_worker WITH LOGIN PASSWORD '{new_db_pw}'") + mc( + f'mc admin user remove local {read_secret("s3_worker_access_key")} >/dev/null 2>&1 || true; ' + f'mc admin user add local {read_secret("s3_worker_access_key")} {new_s3_secret} >/dev/null; ' + f'mc admin policy attach local messenger-worker-rw --user {read_secret("s3_worker_access_key")} >/dev/null' + ) + rabbit("change_password", read_secret("rabbitmq_worker_user"), new_rabbit_pw) + write_secret("db_worker_password", new_db_pw) + write_secret("s3_worker_secret_key", new_s3_secret) + write_secret("rabbitmq_worker_password", new_rabbit_pw) + values = { + "DATABASE_URL": f"postgresql+asyncpg://messenger_worker:{new_db_pw}@postgres:5432/messenger", + "S3_ENDPOINT": "https://minio:9000", + "S3_ACCESS_KEY_ID": read_secret("s3_worker_access_key"), + "S3_SECRET_ACCESS_KEY": new_s3_secret, + "BROKER_URL": f"amqps://{read_secret('rabbitmq_worker_user')}:{new_rabbit_pw}@internal-gateway:5672/", + } + bao_put_worker(values) + return {"db": "rotated", "s3": "rotated", "broker": "rotated"} + + +def main() -> int: + OUT.mkdir(parents=True, exist_ok=True) + client = Client(BASE_URL, str(CA)) + alice, _, _, chat = client.bootstrap() + + broad = setup_broad() + try: + broad_result = run_probe("broad", {k: v for k, v in broad.items() if not k.startswith("_")}) + least_result = run_probe("worker") + finally: + try: + cleanup_broad(broad) + except Exception: + pass + + # Ставим в очередь N задач при остановленном worker-е. + compose("stop", "worker") + queued_ids = [] + for _ in range(5): + att, _content = client.attachment(alice, chat) + queued_ids.append(att["id"]) + queued_before = int(psql("SELECT count(*) FROM jobs WHERE state='queued'")) + + # Отзыв identity worker-а. + psql("ALTER ROLE messenger_worker NOLOGIN") + mc(f'mc admin user disable local {read_secret("s3_worker_access_key")} >/dev/null 2>&1 || true') + sh(["docker","compose","--env-file",".env","exec","-T","rabbitmq","rabbitmqctl","delete_user",read_secret("rabbitmq_worker_user")], check=False) + + compose("start", "worker") + time.sleep(8) + status = sh(["docker", "inspect", "-f", "{{.State.Status}}", "lab7-worker-1"]).stdout.strip() + queued_after_revoke = int(psql("SELECT count(*) FROM jobs WHERE state='queued'")) + + # Возвращаем RabbitMQ-пользователя с прежним паролем, чтобы ротация + # изменила его контролируемо, а не создавала с нуля. + ensure_rabbit_user(read_secret("rabbitmq_worker_user"), read_secret("rabbitmq_worker_password")) + rotated = rotate_worker() + # Восстанавливаем RabbitMQ-пользователя и S3 policy после disable/delete. + ensure_rabbit_user(read_secret("rabbitmq_worker_user"), read_secret("rabbitmq_worker_password")) + rabbit( + "set_permissions", + "-p", + "/", + read_secret("rabbitmq_worker_user"), + r"^attachment\.jobs$", + "", + r"^attachment\.jobs$", + ) + mc( + f'mc admin enable local {read_secret("s3_worker_access_key")} >/dev/null 2>&1 || true; ' + f'mc admin policy attach local messenger-worker-rw --user {read_secret("s3_worker_access_key")} >/dev/null' + ) + compose("up", "-d", "--force-recreate", "--no-deps", "worker") + sh(["sh", "scripts/wait-ready.sh"]) + ready = [client.wait_ready(alice, {"id": attachment_id}) for attachment_id in queued_ids] + duplicate_count = int( + psql( + "SELECT count(*) FROM (" + "SELECT attachment_id, pipeline_version, name, count(*) AS n " + "FROM variants GROUP BY 1,2,3 HAVING count(*) > 1) AS d" + ) + ) + + # Ротация leaf-сертификата и проверка отзыва старого serial. + rotation = sh(["sh", "scripts/rotate-worker-cert.sh"]) + old_probe = sh( + [ + "docker", "compose", "--env-file", ".env", "exec", "-T", "security-probe", + "python", "/app/scripts/cert_probe.py", "--cert", "/certs/tests/old-worker.crt", + "--key", "/certs/tests/old-worker.key", + ] + ).stdout.strip() + new_probe = sh( + [ + "docker", "compose", "--env-file", ".env", "exec", "-T", "security-probe", + "python", "/app/scripts/cert_probe.py", "--cert", "/certs/worker/worker-client.crt", + "--key", "/certs/worker/worker-client.key", + ] + ).stdout.strip() + + summary = { + "hypothesis": "least privilege ограничивает эффект компрометации worker-а; отзыв и ротация восстанавливают обработку без потери задач", + "broad_identity": broad_result, + "least_privilege_worker": least_result, + "revocation": { + "queued_before": queued_before, + "queued_after_revoke": queued_after_revoke, + "worker_state_after_revoke": status, + "rotated": rotated, + "attachments_ready_after_restore": len(ready), + "duplicate_variant_groups": duplicate_count, + }, + "certificate_rotation": { + "old_certificate": old_probe, + "new_certificate": new_probe, + "rotation_log": rotation.stdout.strip(), + }, + } + (OUT / "summary.json").write_text(json.dumps(summary, ensure_ascii=False, indent=2, sort_keys=True), encoding="utf-8") + print(json.dumps(summary, ensure_ascii=False, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + try: + raise SystemExit(main()) + except Exception as exc: # noqa: BLE001 - evidence script prints only type/message + import traceback + print(f"TRACK1 FAILED: {type(exc).__name__}: {exc}") + print(traceback.format_exc()) + raise SystemExit(1) diff --git a/scripts/track1_probe.py b/scripts/track1_probe.py new file mode 100644 index 0000000..5fbb7cd --- /dev/null +++ b/scripts/track1_probe.py @@ -0,0 +1,193 @@ +"""Проба прав worker-а (Track 1): что доступно и что запрещено. + +Режимы: + --identity worker — реальные credentials worker-а из OpenBao AppRole; + --identity broad — специально созданные over-broad credentials (baseline). + +Печатает только JSON с булевыми фактами; значения секретов не выводятся. +""" +from __future__ import annotations + +import argparse +import asyncio +import json +import os +import ssl +import urllib.error +import urllib.request +from pathlib import Path + +CERTS = Path("/certs") +BAO = Path("/bao") +CA = str(CERTS / "ca.crt") + + +class Bao: + def __init__(self) -> None: + self.token: str | None = None + self.ctx = ssl.create_default_context(cafile=CA) + + def call(self, path: str, payload: dict | None = None, method: str = "GET") -> tuple[int, dict]: + body = None if payload is None else json.dumps(payload).encode() + request = urllib.request.Request("https://openbao:8200" + path, data=body, method=method) + request.add_header("Content-Type", "application/json") + if self.token: + request.add_header("X-Vault-Token", self.token) + try: + with urllib.request.urlopen(request, context=self.ctx, timeout=5) as response: + return response.status, json.loads(response.read() or b"{}") + except urllib.error.HTTPError as exc: + return exc.code, {} + + def service_secrets(self, role: str) -> dict[str, str]: + role_id = (BAO / f"{role}_role_id").read_text(encoding="utf-8").strip() + secret_id = (BAO / f"{role}_secret_id").read_text(encoding="utf-8").strip() + status, body = self.call( + "/v1/auth/approle/login", {"role_id": role_id, "secret_id": secret_id}, "POST" + ) + if status != 200: + raise RuntimeError(f"AppRole login failed: {status}") + self.token = str(body["auth"]["client_token"]) + status, body = self.call(f"/v1/kv/data/messenger/{role}") + if status != 200: + raise RuntimeError(f"KV read failed: {status}") + return {str(k): str(v) for k, v in ((body.get("data") or {}).get("data") or {}).items()} + + +def s3_checks(identity: dict[str, str], endpoint: str) -> dict[str, bool]: + import boto3 + from botocore.exceptions import ClientError + + bucket = "messenger-attachments" + client = boto3.client( + "s3", + endpoint_url=endpoint, + region_name="us-east-1", + aws_access_key_id=identity["access_key"], + aws_secret_access_key=identity["secret_key"], + verify=CA, + ) + result: dict[str, bool] = {} + + def allowed(fn) -> bool: + try: + fn() + return True + except ClientError as exc: + code = exc.response.get("Error", {}).get("Code", "") + return code not in {"AccessDenied", "AllAccessDisabled"} + except Exception: + return False + + result["s3_staging_put_allowed"] = allowed( + lambda: client.put_object(Bucket=bucket, Key="attachments/staging/probe", Body=b"probe") + ) + result["s3_final_put_allowed"] = allowed( + lambda: client.put_object(Bucket=bucket, Key="attachments/final/probe", Body=b"probe") + ) + result["s3_foreign_prefix_put_allowed"] = allowed( + lambda: client.put_object(Bucket=bucket, Key="attachments/other/probe", Body=b"probe") + ) + result["s3_foreign_prefix_get_allowed"] = allowed( + lambda: client.get_object(Bucket=bucket, Key="attachments/other/probe") + ) + result["s3_list_bucket_all_allowed"] = allowed( + lambda: client.list_objects_v2(Bucket=bucket, Prefix="attachments/", MaxKeys=1) + ) + return result + + +async def db_checks(url: str) -> dict[str, bool]: + import asyncpg + + ctx = ssl.create_default_context(cafile=CA) + conn = await asyncpg.connect(url.replace("postgresql+asyncpg://", "postgresql://"), ssl=ctx, timeout=5) + result = {} + try: + try: + await conn.fetchval("SELECT count(*) FROM jobs") + result["db_jobs_select_allowed"] = True + except Exception: + result["db_jobs_select_allowed"] = False + for name, sql in ( + ("db_users_password_select_allowed", "SELECT usename, passwd FROM pg_shadow LIMIT 1"), + ("db_users_table_select_allowed", "SELECT username, password_hash FROM users LIMIT 1"), + ("db_ddl_allowed", "CREATE TABLE lab7_track1_forbidden (id int)"), + ): + try: + await conn.execute(sql) + result[name] = True + except Exception: + result[name] = False + finally: + await conn.close() + return result + + +async def rabbit_checks(url: str, producer: bool, cert: Path, key: Path) -> dict[str, bool]: + import aio_pika + + ctx = ssl.create_default_context(cafile=CA) + ctx.check_hostname = True + ctx.verify_mode = ssl.CERT_REQUIRED + ctx.load_cert_chain(str(cert), str(key)) + result = {"rabbit_connect_allowed": False, "rabbit_publish_allowed": False} + try: + connection = await aio_pika.connect_robust(url, ssl_context=ctx, timeout=5) + result["rabbit_connect_allowed"] = True + channel = await connection.channel() + try: + exchange = await channel.get_exchange("attachment.jobs") + await exchange.publish( + aio_pika.Message(body=b'{"probe":1}', delivery_mode=aio_pika.DeliveryMode.PERSISTENT), + routing_key="attachment.process.v1", + ) + result["rabbit_publish_allowed"] = True + except Exception: + result["rabbit_publish_allowed"] = False + await connection.close() + except Exception: + pass + return result + + +async def run() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--identity", choices=["worker", "broad"], required=True) + parser.add_argument("--json-out", default="") + args = parser.parse_args() + if args.identity == "worker": + bao = Bao() + secrets = bao.service_secrets("worker") + db_url = secrets["DATABASE_URL"] + s3 = { + "access_key": secrets["S3_ACCESS_KEY_ID"], + "secret_key": secrets["S3_SECRET_ACCESS_KEY"], + } + endpoint = secrets.get("S3_ENDPOINT", "https://minio:9000") + rabbit_url = secrets["BROKER_URL"] + rabbit_cert = CERTS / "worker" / "worker-client.crt" + rabbit_key = CERTS / "worker" / "worker-client.key" + else: + db_url = os.environ["BROAD_DATABASE_URL"] + s3 = { + "access_key": os.environ["BROAD_S3_ACCESS_KEY"], + "secret_key": os.environ["BROAD_S3_SECRET_KEY"], + } + endpoint = os.environ.get("BROAD_S3_ENDPOINT", "https://minio:9000") + rabbit_url = os.environ["BROAD_BROKER_URL"] + rabbit_cert = CERTS / "api" / "api-client.crt" + rabbit_key = CERTS / "api" / "api-client.key" + + result = {"identity": args.identity} + result.update(s3_checks(s3, endpoint)) + result.update(await db_checks(db_url)) + result.update(await rabbit_checks(rabbit_url, producer=args.identity == "broad", cert=rabbit_cert, key=rabbit_key)) + print(json.dumps(result, sort_keys=True)) + if args.json_out: + Path(args.json_out).write_text(json.dumps(result, indent=2, sort_keys=True), encoding="utf-8") + return 0 + + +if __name__ == "__main__": + raise SystemExit(asyncio.run(run())) diff --git a/scripts/wait-data.sh b/scripts/wait-data.sh new file mode 100644 index 0000000..8a755ca --- /dev/null +++ b/scripts/wait-data.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Ждёт health data-сервисов и доступность TLS OpenBao (до init он отвечает 200 на /v1/sys/init). +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" +CURL_OPTS="" +case "$(uname -s 2>/dev/null || true)" in + MINGW*|MSYS*|CYGWIN*) CURL_OPTS="--ssl-no-revoke" ;; +esac + +for svc in postgres minio rabbitmq; do + i=0 + while [ "$i" -lt 120 ]; do + state=$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}' "lab7-$svc-1" 2>/dev/null || true) + [ "$state" = "healthy" ] && break + i=$((i + 1)) + sleep 1 + done + [ "$state" = "healthy" ] || { echo "$svc did not become healthy" >&2; exit 1; } + echo "$svc healthy" +done +i=0 +while [ "$i" -lt 120 ]; do + if curl $CURL_OPTS --cacert certs/ca.crt -fsS https://127.0.0.1:8200/v1/sys/init >/dev/null 2>&1; then + echo "openbao reachable" + exit 0 + fi + i=$((i + 1)) + sleep 1 +done +echo "openbao did not become reachable" >&2 +exit 1 diff --git a/scripts/wait-ready.sh b/scripts/wait-ready.sh new file mode 100644 index 0000000..b91d532 --- /dev/null +++ b/scripts/wait-ready.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Ожидание HTTPS readiness через Traefik с проверкойCA. --insecure не используется. +set -eu +export MSYS_NO_PATHCONV=1 +export MSYS2_ARG_CONV_EXCL="*" +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" +URL="${READY_URL:-https://localhost:8443/health/ready}" +# Относительный путь понимают и Linux curl, и Windows schannel curl. +CA="${CA_FILE:-certs/ca.crt}" +LIMIT="${READY_TIMEOUT_SECONDS:-180}" +# Windows schannel не умеет проверять revocation локального CA без CRL; +# отключаем только проверку revocation, но не проверку цепочки/hostname. +CURL_OPTS="" +case "$(uname -s 2>/dev/null || true)" in + MINGW*|MSYS*|CYGWIN*) CURL_OPTS="--ssl-no-revoke" ;; +esac +i=0 +while [ "$i" -lt "$LIMIT" ]; do + if curl $CURL_OPTS -fsS --cacert "$CA" "$URL" >/dev/null 2>&1; then + printf 'ready: %s\n' "$URL" + exit 0 + fi + i=$((i + 1)) + sleep 1 +done +printf 'not ready after %ss: %s\n' "$LIMIT" "$URL" >&2 +exit 1 diff --git a/security/THREAT_MODEL.md b/security/THREAT_MODEL.md index 31da287..fc01648 100644 --- a/security/THREAT_MODEL.md +++ b/security/THREAT_MODEL.md @@ -1,19 +1,78 @@ -# Модель угроз — заполнить +# Модель угроз — lab7 -## Активы и акторы +Стенд: `lab7` Docker Compose. Защищаемые активы: пароли и сессии пользователей, +сообщения/вложения, service identities (CA/leaf, OpenBao AppRole, DB/S3/Rabbit +учётки), telemetry и административные интерфейсы. -TODO: пользовательские credentials/сессии, сообщения/вложения, service identities, CA/secrets, telemetry. Акторы: участник чата, посторонний пользователь, внешний клиент, скомпрометированный сервис, оператор. Опишите доступ атакующего и границы учебного стенда. +Акторы: внешний клиент, участник чата, посторонний аутентифицированный +пользователь, скомпрометированный API/worker/relay, оператор стенда, атакующий +с доступом к Docker-хосту. Стенд учебный: физический доступ к хосту и root +Docker-хоста вне модели. ## Границы доверия -TODO: схема и ссылка на заполненную contracts/trust-matrix.md; публичные/внутренние интерфейсы, процессы, секреты и их выдача. +``` +Интернет/клиент + │ TLS 1.2+, CA+hostname, Bearer + ▼ +Traefik :8443 ── mTLS (lb identity) ──► API gateway :8081 ── loopback ──► API :8080 + (единственный публичный вход) │ + ├─ TLS verify-full ─► PostgreSQL (роли api/worker/relay) + ├─ TLS + CA ────────► MinIO (scoped users) + ├─ mTLS ─► internal-gateway ─TLS─► RabbitMQ + ├─ mTLS ─► internal-gateway ─────► OTel Collector + └─ TLS + AppRole ──► OpenBao (KV, scoped policy) +Worker/relay: те же TLS/mTLS-границы; telemetry sidecars (collector-tls, +prometheus-tls, loki-tls, tempo-tls) проверяют SAN клиента. Grafana и +Prometheus/Loki/Tempo — внутренняя сеть; Grafana опубликована только на +127.0.0.1 с TLS и admin auth. +``` -| Угроза и конкретный путь | Нарушаемый инвариант | Контроль | Отрицательный тест | Остаточное ограничение | -| --- | --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | TODO | +Полная матрица: [contracts/trust-matrix.md](../contracts/trust-matrix.md). +Публичный API-порт реплик не публикуется; health API доступен только на +loopback внутри контейнера. Docker socket смонтирован только в Traefik +(read-only) для service discovery; API/worker его не видят. -На 4 минимум 6 конкретных угроз. Не заменяйте сценарии словами «SQL injection», «безопасный Docker», «mTLS включён» без пути и проверки. +## Угрозы, контроли и отрицательные проверки + +| # | Угроза и конкретный путь | Нарушаемый инвариант | Контроль | Отрицательный тест | Остаточное ограничение | +| --- | --- | --- | --- | --- | --- | +| 1 | Клиент подключается к поддельному/чужому TLS endpoint или игнорирует hostname | Конфиденциальность пароля/токена, аутентичность ingress | Публичный CA, SAN localhost/127.0.0.1, обязательный HTTPS; клиентские тесты не имеют `--insecure` | `tests/security.py`: пустой/чужой CA → CERTIFICATE_VERIFY_FAILED; `mtls_probe.py: external_tls_wrong_hostname` | Локальный CA не в системном trust store; клиент обязан передать `CA_FILE` | +| 2 | Прямое подключение к API-реплике без client certificate или с сертификатом чужого CA | Изоляция backend от публичной сети | API-порт не публикуется; gateway `CERT_REQUIRED`, TLS 1.2+; Traefik — единственный вход | `mtls_probe.py: api_no_client_cert, api_foreign_ca_client` → отказ | Docker-хост с root может зайти в сеть; это вне модели | +| 3 | Сертификат, подписанный доверенным CA, но с чужой identity (worker вместо LB) | LB→API authorization | Явный allowlist SAN `lb.messenger.internal`; не только проверка цепочки | `api_trusted_ca_wrong_identity` → HTTP 403; `api_lb_identity_allowed` → 200 | SAN-allowlist статичен; новая LB identity требует обновления конфига | +| 4 | Worker публикует задания в очередь или читает чужой bucket-prefix | Целостность очереди, least privilege | Worker — consumer-only: passive queue read, без publish/bind; MinIO policy только staging/final; DB role без users | `track1_probe.py: rabbit_publish_allowed=false, s3_foreign_prefix_*=false, db_users_table_select_allowed=false`; broad baseline — true | Worker имеет rw на final (нужен для публикации вариантов); компрометация может портить свои объекты | +| 5 | Посторонний пользователь читает чат/вложение или подделывает `X-User-Id` | ACL сообщений и файлов | Владелец только из Bearer-сессии; membership проверяется на каждом запросе; чужой объект → 404 | `scripts/security_checks.py`: eve → 404 на history/attachment/content; fake X-User-Id → sender = Bearer owner | Учебный API не имеет DELETE/изменения membership | +| 6 | Перебор паролей и дорогой Argon2id login DoS | Доступность входа, конфиденциальность учёток | Общий для реплик счётчик в PostgreSQL, 429 + Retry-After, семафор KDF (2), Argon2id m=19 MiB/t=2/p=1 | `security_checks.py`: 11-я попытка → 429, Retry-After=60; вторая реплика тоже 429; `evidence/06-argon2.txt` | Атакующий с многими username может распределить попытки; глобального бюджета на весь стенд нет | +| 7 | Компрометация worker identity: доступ к БД/секретам/очереди | Least privilege, сохранность задач | Scoped DB role, scoped S3 user, consumer-only Rabbit, AppRole с policy только worker path; worker CPU/RAM/time limits | `track1.py` (broad vs least), `track1_probe.py`; worker 1 CPU/512 MiB, job timeout 60 s | Worker всё ещё читает jobs/attachments и пишет final-объекты — это его задача | +| 8 | Утечка пароля/токена/секрета в логи, traces или метрики | Конфиденциальность credentials | JSON-логи только с route template/request_id; нет тел/заголовков; OTel attributes без user/chat/text; Loki-запрос на уникальный пароль | `scripts/telem_check.py`: 100 лог-записей, 0 вхождений пароля; `evidence/10-telemetry-leak.txt` | Логи приложения могут содержать username/request_id; это не секрет | +| 9 | Кража/подмена CA или leaf, старый сертификат после ротации | Аутентичность mTLS | CA key вне контейнеров; leaf rotation + локальный revocation list; gateway перечитывает serial при старте | `rotate-worker-cert.sh` + `cert_probe.py`: old → REJECTED, new → ACCEPTED | Нет OCSP/CRL distribution point; revocation list обновляется скриптом и требует рестарта gateway | +| 10 | OpenBao sealed/недоступен, приложение откатывается на plaintext/static secret | Fail-closed, конфиденциальность | Нет fallback: `SECRETS_FROM_BAO=1`; при sealed новая реплика не получает secrets; AppRole token TTL/renewal | `scripts/openbao_seal_test.sh`: existing API ready, new API local readiness URLError; после unseal healthy | Уже работающая реплика продолжает использовать ранее полученные секреты до рестарта | ## Lifecycle и инциденты -TODO: bootstrap, expiry/renewal, revoke/rotation, компрометация identity, sealed OpenBao и восстановление. Указать владельца CA/unseal и способ защиты bootstrap credentials. Сопоставить scan findings с реальной применимостью и исправлением/остаточным риском. +- **Bootstrap.** `scripts/bootstrap-certs.sh` создаёт CA/leaf в gitignored + `secrets/`. `scripts/bootstrap-secrets.sh` — DB/S3/Rabbit пароли. + `scripts/openbao_bootstrap.py` инициализирует OpenBao (5 shares/3 threshold), + unseal-ит, создаёт KV/AppRole/policies и пишет role_id/secret_id. Root token и + unseal keys остаются у оператора в `secrets/openbao-init.json` (644 внутри каталога 700). +- **Renewal.** AppRole token TTL 300 с, max 900 с; `secrets_provider.py` продлевает + `auth/token/renew-self`, при отказе повторно логинится. SecretID TTL 3600 с. +- **Revocation/rotation.** `track1.py` отзывает DB (NOLOGIN), MinIO (disable) и + Rabbit (delete) identity, показывает сохранность 5 задач, ротирует три секрета, + обновляет OpenBao и восстанавливает ready. `rotate-worker-cert.sh` меняет leaf + и добавляет старый serial в `revoked-serials.txt`; gateway перечитывает файл + при старте. +- **Sealed OpenBao.** `openbao_seal_test.sh`: работающая реплика продолжает + обслуживать; новая реплика не становится ready; после unseal — healthy. +- **CA/unseal owner.** Только оператор стенда; CA key не монтируется, unseal + shares не передаются приложениям. Автоматический unseal при каждом рестарте не + заявляется как production-решение: `restart.sh` явно запускает bootstrap. + +## Scan triage + +`pip-audit`/Trivy в CI не являются доказательством отсутствия уязвимостей. +В отчёте перечислены конкретные пакеты/образы и применимость findings; критичные +CVE с доступным путём эксплуатации в этом стенде отсутствуют на момент +измерений (см. REPORT.md, раздел «Сканирование»). Остаточный риск: pinned-образы +не обновляются автоматически; `docker scout`/Trivy нужно запускать перед +публикацией. diff --git a/src/messenger/__init__.py b/src/messenger/__init__.py new file mode 100644 index 0000000..29e00ee --- /dev/null +++ b/src/messenger/__init__.py @@ -0,0 +1,5 @@ +"""Мессенджер на PostgreSQL, S3 и RabbitMQ: лабораторная 7 (MTUSI).""" + +__all__ = ["__version__"] + +__version__ = "7.0.0" \ No newline at end of file diff --git a/src/messenger/__main__.py b/src/messenger/__main__.py new file mode 100644 index 0000000..5fdc73d --- /dev/null +++ b/src/messenger/__main__.py @@ -0,0 +1,40 @@ +"""Точка входа: `python -m messenger` (в контейнере — PID 1).""" +from __future__ import annotations + +import sys + +import uvicorn + +from .app import create_app +from .config import Config, ConfigError +from .secrets_provider import SecretsUnavailable, load_service_secrets + + +def main() -> int: + try: + load_service_secrets() + config = Config.from_env() + except (ConfigError, SecretsUnavailable) as exc: + print(f"config error: {exc}", file=sys.stderr) + return 2 + + uvicorn.run( + create_app(config), + host=config.host, + port=config.port, + # Свой формат логов: uvicorn не пишет access-лог с query-строкой. + log_config=None, + access_log=False, + # Верхняя граница ожидания активных запросов при остановке. + timeout_graceful_shutdown=config.graceful_shutdown_seconds, + # Один процесс: лимиты пула соединений заданы на процесс, а не на весь стенд. + workers=1, + server_header=False, + date_header=False, + proxy_headers=False, + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/messenger/access.py b/src/messenger/access.py new file mode 100644 index 0000000..a03d541 --- /dev/null +++ b/src/messenger/access.py @@ -0,0 +1,16 @@ +"""Правила доступа: чужой объект неотличим от отсутствующего (404, не 403).""" +from __future__ import annotations + +from uuid import UUID + +from .domain import ChatRecord, UserRecord +from .errors import not_found +from .repository import Repository + + +async def visible_chat(repository: Repository, chat_id: UUID, user: UserRecord) -> ChatRecord: + """Возвращает чат, если пользователь его участник, иначе 404.""" + chat = await repository.chat_for_member(chat_id, user.id) + if chat is None: + raise not_found("Чат не найден") + return chat diff --git a/src/messenger/admin.py b/src/messenger/admin.py new file mode 100644 index 0000000..35af4fb --- /dev/null +++ b/src/messenger/admin.py @@ -0,0 +1,175 @@ +"""Операторский CLI: снимок состояния, replay, fault-injection и duplicate. + +Запускается внутри контейнера с теми же секретами, что API: + python -m messenger.admin show --attachment + python -m messenger.admin stats + python -m messenger.admin replay --job --operator denis --reason "..." + +Публичного HTTP-доступа к этим операциям нет: это не часть обязательного API. +""" +from __future__ import annotations + +import argparse +import asyncio +import json +import os +import sys +from uuid import UUID + +from .broker import Broker, build_payload +from .config import Config, ConfigError +from .db import Database +from .jobs import FAULT_KINDS, JobRepository, ReplayRejected +from .pipeline import UnsupportedPipeline, variant_specs +from .storage import S3Storage + + +def _json(value) -> None: + print(json.dumps(value, ensure_ascii=False, indent=2, sort_keys=True)) + + +async def _run(args: argparse.Namespace) -> int: + config = Config.from_env() + database = Database(config) + jobs = JobRepository(database, config) + broker: Broker | None = None + try: + if args.command == "show": + _json(await jobs.report(args.attachment)) + return 0 + if args.command == "stats": + _json(await jobs.queue_stats()) + return 0 + if args.command == "objects": + storage = S3Storage(config) + try: + objects = await storage.list_objects(config.s3_key_prefix + args.prefix) + finally: + await storage.close() + _json( + [ + { + "key": item.key, + "size_bytes": item.size_bytes, + "last_modified": item.last_modified.isoformat().replace("+00:00", "Z"), + } + for item in objects + ] + ) + return 0 + if args.command == "jobs": + _json( + [ + { + "id": str(job.id), + "pipeline_version": job.pipeline_version, + "state": job.state, + "attempts": job.attempts, + "max_attempts": job.max_attempts, + "last_error_code": job.last_error_code, + "replay_of": str(job.replay_of) if job.replay_of else None, + } + for job in await jobs.jobs_for_attachment(args.attachment) + ] + ) + return 0 + if args.command == "fault": + if not config.allow_fault_injection: + print("fault injection is disabled (ALLOW_FAULT_INJECTION=false)", file=sys.stderr) + return 2 + await jobs.set_fault(args.kind, args.count) + _json({"kind": args.kind, "remaining": args.count}) + return 0 + if args.command == "replay": + if not args.job and not args.attachment: + print("replay requires --job or --attachment", file=sys.stderr) + return 2 + try: + new_id = await jobs.replay( + job_id=args.job, + attachment_id=args.attachment, + requested_by=args.operator, + reason=args.reason, + ) + except ReplayRejected as exc: + print(f"replay rejected: {exc}", file=sys.stderr) + return 3 + _json({"replay_job_id": str(new_id)}) + return 0 + if args.command == "enqueue": + try: + variant_specs(args.pipeline_version) + except UnsupportedPipeline as exc: + print(f"enqueue rejected: {exc}", file=sys.stderr) + return 2 + try: + new_id = await jobs.force_enqueue(args.attachment, args.pipeline_version) + except ReplayRejected as exc: + print(f"enqueue rejected: {exc}", file=sys.stderr) + return 3 + _json({"job_id": str(new_id), "pipeline_version": args.pipeline_version}) + return 0 + if args.command == "duplicate": + job = await jobs.get_job(args.job) + if job is None: + print("job not found", file=sys.stderr) + return 2 + broker = Broker(config) + await broker.connect() + for index in range(args.count): + payload = build_payload(job, attempt=job.attempts + 1) + await broker.publish_job(payload, message_id=str(job.id)) + _json({"job_id": str(job.id), "published": args.count, "attempt": job.attempts + 1}) + return 0 + print("unknown command", file=sys.stderr) + return 2 + finally: + if broker is not None: + await broker.close() + await database.dispose() + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description="Операторский CLI lab5") + sub = parser.add_subparsers(dest="command", required=True) + + show = sub.add_parser("show", help="снимок attachment/jobs/outbox/events") + show.add_argument("--attachment", type=UUID, required=True) + + stats = sub.add_parser("stats", help="счётчики job/outbox") + stats.set_defaults() + + jobs_parser = sub.add_parser("jobs", help="задания вложения") + jobs_parser.add_argument("--attachment", type=UUID, required=True) + + objects_parser = sub.add_parser("objects", help="объекты S3 под префиксом") + objects_parser.add_argument("--prefix", required=True) + + fault = sub.add_parser("fault", help="одноразовый fault flag (только lab)") + fault.add_argument("--kind", choices=FAULT_KINDS, required=True) + fault.add_argument("--count", type=int, default=1) + + replay = sub.add_parser("replay", help="явный replay failed-задачи") + replay.add_argument("--job", type=UUID, default=None) + replay.add_argument("--attachment", type=UUID, default=None) + replay.add_argument("--operator", default=os.environ.get("OPERATOR", "operator")) + replay.add_argument("--reason", default="manual replay") + + enqueue = sub.add_parser("enqueue", help="поставить job конкретной версии (тест/оператор)") + enqueue.add_argument("--attachment", type=UUID, required=True) + enqueue.add_argument("--pipeline-version", type=int, required=True) + + duplicate = sub.add_parser("duplicate", help="опубликовать то же сообщение N раз") + duplicate.add_argument("--job", type=UUID, required=True) + duplicate.add_argument("--count", type=int, default=2) + + args = parser.parse_args(argv) + try: + return asyncio.run(_run(args)) + except ConfigError as exc: + print(f"config error: {exc}", file=sys.stderr) + return 2 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/messenger/app.py b/src/messenger/app.py new file mode 100644 index 0000000..0f54769 --- /dev/null +++ b/src/messenger/app.py @@ -0,0 +1,197 @@ +"""Сборка ASGI-приложения: жизненный цикл, обработчики ошибок, маршруты.""" +from __future__ import annotations + +import asyncio +import logging +from contextlib import asynccontextmanager +from typing import AsyncIterator, Awaitable, Callable + +from fastapi import FastAPI + +from . import __version__, telemetry +from .config import Config +from .cursor import CursorCodec +from .db import Database +from .errorhandlers import register_error_handlers +from .jobs import JobRepository +from .logging_setup import configure_logging, log +from .login_guard import LoginGuard +from .middleware import RequestContextMiddleware +from .routers import attachments, auth, chats, health, messages, users +from .security import configure_argon2 +from .sessions import PostgresSessionStore +from .storage import S3Storage + +ROUTERS = ( + health.router, + auth.router, + users.router, + chats.router, + messages.router, + attachments.router, +) + + +async def _queue_metrics_loop(database: Database, config: Config, logger: logging.Logger) -> None: + """Публикует queue depth/age даже когда worker остановлен. + + Метрику должен отдавать процесс, который не является предметом инцидента: + иначе при падении worker-а gauge замирает на последнем значении и alert + «растущая очередь» никогда не сработает. + """ + jobs = JobRepository(database, config) + while True: + try: + stats = await jobs.queue_metrics() + telemetry.record_queue( + queue="attachment.jobs", + depth=int(stats["queued"]), + in_flight=int(stats["processing"]), + oldest_age=float(stats["oldest_queued_seconds"]), + ) + except Exception as exc: + log( + logger, + logging.WARNING, + "queue_metrics_failed", + error=type(exc).__name__, + ) + await asyncio.sleep(5) + + +async def _release( + logger: logging.Logger, resource: str, closer: Callable[[], Awaitable[None]] +) -> None: + """Освобождает ресурс: отказ зависимости при остановке не должен мешать выходу.""" + try: + await closer() + except Exception as exc: + log( + logger, + logging.WARNING, + "release_failed", + exc_info=exc, + resource=resource, + error=type(exc).__name__, + ) + + +def build_fastapi(config: Config, logger: logging.Logger) -> FastAPI: + """Создаёт приложение FastAPI с обработчиками ошибок и маршрутами.""" + + @asynccontextmanager + async def lifespan(app: FastAPI) -> AsyncIterator[None]: + # Клиенты создаются здесь, но к зависимостям не подключаются: старт не + # должен падать, если PostgreSQL или Valkey поднимаются одновременно с API. + # За трафик отвечает готовность, а не перезапуск контейнера. + telemetry.setup_telemetry( + service_name="messenger-api", instance_id=config.instance_id + ) + configure_argon2( + config.argon2_memory_kib, + config.argon2_iterations, + config.argon2_parallelism, + ) + database = Database(config) + telemetry.register_db_pool(database.engine) + sessions = PostgresSessionStore(database, config.session_ttl_seconds) + login_guard = LoginGuard( + database, + max_attempts=config.login_rate_limit_attempts, + window_seconds=config.login_rate_limit_window_seconds, + block_seconds=config.login_rate_limit_block_seconds, + max_concurrency=config.login_max_concurrency, + ) + storage = S3Storage(config) + app.state.database = database + app.state.sessions = sessions + app.state.login_guard = login_guard + app.state.storage = storage + app.state.config = config + app.state.cursors = CursorCodec(config.cursor_secret) + app.state.draining = False + queue_task = asyncio.create_task( + _queue_metrics_loop(database, config, logger) + ) + log( + logger, + logging.INFO, + "startup", + version=__version__, + host=config.host, + port=config.port, + shutdown_budget_seconds=config.shutdown_budget_seconds, + storage="postgresql+s3", + s3_bucket=config.s3_bucket, + max_upload_bytes=config.max_upload_bytes, + max_image_pixels=config.max_image_pixels, + instance_id=config.instance_id, + session_store="postgresql", + session_ttl_seconds=config.session_ttl_seconds, + db_pool_size=config.db_pool_size, + db_max_overflow=config.db_max_overflow, + db_pool_timeout_seconds=config.db_pool_timeout_seconds, + db_connect_timeout_seconds=config.db_connect_timeout_seconds, + db_command_timeout_seconds=config.db_command_timeout_seconds, + db_statement_timeout_ms=config.db_statement_timeout_ms, + db_tls=config.db_ca_file is not None, + s3_tls=config.s3_endpoint.startswith("https://"), + argon2_memory_kib=config.argon2_memory_kib, + argon2_iterations=config.argon2_iterations, + argon2_parallelism=config.argon2_parallelism, + ) + if config.binds_to_loopback: + # Bind на loopback внутри контейнера не виден через published port. + log( + logger, + logging.WARNING, + "loopback_bind", + detail="bind на loopback недоступен через published port контейнера", + ) + try: + yield + finally: + queue_task.cancel() + await asyncio.gather(queue_task, return_exceptions=True) + app.state.draining = True + log( + logger, + logging.INFO, + "shutdown_begin", + drain_seconds=config.shutdown_drain_seconds, + note="слушающий сокет уже закрыт: новые соединения не принимаются", + ) + if config.shutdown_drain_seconds > 0: + # Окно управляемого снятия с балансировки: процесс ещё жив, + # но трафик на него уже не идёт. + await asyncio.sleep(config.shutdown_drain_seconds) + await _release(logger, "storage", storage.close) + await _release(logger, "sessions", sessions.close) + await _release(logger, "database", database.dispose) + telemetry.shutdown_telemetry() + app.state.draining = False + log(logger, logging.INFO, "shutdown_complete") + + app = FastAPI( + title="MTUSI Messenger — лабораторная 7", + version=__version__, + lifespan=lifespan, + # Источник истины — contracts/openapi.json: свои /docs и /openapi.json не публикуются. + docs_url=None, + redoc_url=None, + openapi_url=None, + ) + register_error_handlers(app, logger) + for router in ROUTERS: + app.include_router(router) + return app + + +def create_app( + config: Config | None = None, + logger: logging.Logger | None = None, +) -> RequestContextMiddleware: + """Создаёт приложение; разбор окружения идёт здесь, а не при импорте модуля.""" + config = Config.from_env() if config is None else config + logger = configure_logging(config.log_level, config.env) if logger is None else logger + return RequestContextMiddleware(build_fastapi(config, logger), logger, config.instance_id) \ No newline at end of file diff --git a/src/messenger/broker.py b/src/messenger/broker.py new file mode 100644 index 0000000..11afc88 --- /dev/null +++ b/src/messenger/broker.py @@ -0,0 +1,220 @@ +"""RabbitMQ: durable quorum queue, publisher confirms и ручной consumer ack. + +Брокер переносит только ссылки/служебные поля задания по jobs.schema.json. +Байты изображения и credentials в сообщение не попадают. Publisher confirm +подтверждает приём брокером, consumer ack — устойчивую обработку; это разные +границы, и между ними возможна повторная доставка. +""" +from __future__ import annotations + +import json +import logging +from datetime import datetime, timezone +from typing import Awaitable, Callable +from uuid import UUID + +import ssl + +from aio_pika import DeliveryMode, ExchangeType, Message, connect_robust +from aio_pika.abc import AbstractChannel, AbstractIncomingMessage, AbstractQueue + +from .config import ( + DEFAULT_DLQ_EXCHANGE, + DEFAULT_DLQ_QUEUE, + DEFAULT_JOB_QUEUE, + DEFAULT_JOB_ROUTING_KEY, + Config, +) +from .domain import rfc3339_z +from .jobs import JOB_TYPE, JobRecord + +logger = logging.getLogger("messenger.broker") + +REQUIRED_FIELDS = ( + "schema_version", + "job_id", + "type", + "attachment_id", + "pipeline_version", + "attempt", + "created_at", +) +OPTIONAL_FIELDS = ("traceparent", "tracestate") + + +class InvalidJobMessage(ValueError): + """Сообщение не соответствует jobs.schema.json; оно уходит в DLQ.""" + + +def build_payload(job: JobRecord, *, attempt: int) -> dict: + """Точное представление задания: только ID, служебные поля и trace context.""" + payload = { + "schema_version": 1, + "job_id": str(job.id), + "type": JOB_TYPE, + "attachment_id": str(job.attachment_id), + "pipeline_version": job.pipeline_version, + "attempt": attempt, + "created_at": rfc3339_z(job.created_at), + } + if job.traceparent: + payload["traceparent"] = job.traceparent + if job.tracestate: + payload["tracestate"] = job.tracestate + return payload + + +def parse_payload(body: bytes) -> dict: + """Строгая проверка сообщения до обращения к БД.""" + try: + payload = json.loads(body.decode("utf-8")) + except (UnicodeDecodeError, ValueError) as exc: + raise InvalidJobMessage("message is not valid UTF-8 JSON") from exc + if not isinstance(payload, dict): + raise InvalidJobMessage("message must be a JSON object") + extra = set(payload).difference(REQUIRED_FIELDS + OPTIONAL_FIELDS) + if extra: + raise InvalidJobMessage("unexpected message fields") + missing = [field for field in REQUIRED_FIELDS if field not in payload] + if missing: + raise InvalidJobMessage("missing message fields") + if payload["schema_version"] != 1 or payload["type"] != JOB_TYPE: + raise InvalidJobMessage("unsupported schema_version/type") + try: + UUID(str(payload["job_id"])) + UUID(str(payload["attachment_id"])) + except (ValueError, TypeError) as exc: + raise InvalidJobMessage("invalid UUID") from exc + if not isinstance(payload["pipeline_version"], int) or payload["pipeline_version"] < 1: + raise InvalidJobMessage("invalid pipeline_version") + if not isinstance(payload["attempt"], int) or payload["attempt"] < 1: + raise InvalidJobMessage("invalid attempt") + if not isinstance(payload["created_at"], str) or not payload["created_at"].endswith("Z"): + raise InvalidJobMessage("invalid created_at") + return payload + + +class Broker: + """Одно соединение на процесс; каналы и topology объявляются один раз.""" + + def __init__(self, config: Config, *, manage_topology: bool = True) -> None: + self._config = config + self._manage_topology = manage_topology + self._url = config.require_broker() + self._queue_name = DEFAULT_JOB_QUEUE + self._routing_key = DEFAULT_JOB_ROUTING_KEY + self._dlx_name = DEFAULT_DLQ_EXCHANGE + self._dlq_name = DEFAULT_DLQ_QUEUE + self._connection = None + self._channel: AbstractChannel | None = None + self._exchange = None + self._queue: AbstractQueue | None = None + + async def connect(self) -> None: + ssl_context = None + if self._url.startswith("amqps://"): + if not self._config.broker_ca_file: + raise RuntimeError("BROKER_CA_FILE is required for amqps://") + ssl_context = ssl.create_default_context(cafile=self._config.broker_ca_file) + ssl_context.check_hostname = True + ssl_context.verify_mode = ssl.CERT_REQUIRED + if self._config.broker_cert_file: + ssl_context.load_cert_chain( + self._config.broker_cert_file, self._config.broker_key_file + ) + self._connection = await connect_robust( + self._url, + heartbeat=30, + timeout=10, + connection_attempts=10, + retry_interval=1, + ssl_context=ssl_context, + ) + self._channel = await self._connection.channel( + publisher_confirms=True, + on_return_raises=True, + ) + assert self._channel is not None + if not self._manage_topology: + # Consumer не объявляет и не связывает топологию: ему разрешён только + # read своей очереди. Это отделяет право consume от права publish. + self._queue = await self._channel.get_queue(self._queue_name) + logger.info( + "broker_connected", + extra={"fields": {"queue": self._queue_name, "topology": "consumer"}}, + ) + return + self._exchange = await self._channel.declare_exchange( + self._queue_name, ExchangeType.DIRECT, durable=True + ) + self._queue = await self._channel.declare_queue( + self._queue_name, + durable=True, + arguments={ + "x-queue-type": "quorum", + "x-dead-letter-exchange": self._dlx_name, + }, + ) + await self._queue.bind(self._exchange, routing_key=self._routing_key) + dead_letter_exchange = await self._channel.declare_exchange( + self._dlx_name, ExchangeType.FANOUT, durable=True + ) + dead_letter_queue = await self._channel.declare_queue( + self._dlq_name, + durable=True, + arguments={"x-queue-type": "quorum"}, + ) + await dead_letter_queue.bind(dead_letter_exchange) + logger.info( + "broker_connected", + extra={"fields": {"queue": self._queue_name, "dlq": self._dlq_name, "topology": "producer"}}, + ) + + async def publish_job(self, payload: dict, *, message_id: str) -> None: + """Публикация с publisher confirm; исключение означает отсутствие приёма.""" + if self._exchange is None: + raise RuntimeError("broker is not connected") + message = Message( + body=json.dumps(payload, ensure_ascii=False, separators=(",", ":")).encode("utf-8"), + content_type="application/json", + content_encoding="utf-8", + delivery_mode=DeliveryMode.PERSISTENT, + message_id=message_id, + type=JOB_TYPE, + timestamp=datetime.now(timezone.utc), + headers={ + "schema_version": 1, + "pipeline_version": payload["pipeline_version"], + **( + {"traceparent": payload["traceparent"]} + if payload.get("traceparent") + else {} + ), + }, + ) + await self._exchange.publish( + message, routing_key=self._routing_key, mandatory=True + ) + + async def consume( + self, + callback: Callable[[AbstractIncomingMessage], Awaitable[None]], + *, + prefetch: int, + ) -> AbstractQueue: + if self._channel is None or self._queue is None: + raise RuntimeError("broker is not connected") + await self._channel.set_qos(prefetch_count=prefetch) + await self._queue.consume(callback) + return self._queue + + async def close(self) -> None: + if self._connection is not None: + await self._connection.close() + self._connection = None + self._channel = None + self._queue = None + + @property + def queue_name(self) -> str: + return self._queue_name \ No newline at end of file diff --git a/src/messenger/config.py b/src/messenger/config.py new file mode 100644 index 0000000..873cca2 --- /dev/null +++ b/src/messenger/config.py @@ -0,0 +1,440 @@ +"""Конфигурация процесса: значения приходят только из переменных окружения. + +Секреты читаются либо напрямую (NAME), либо из файла (NAME_FILE) — второй +вариант используется стендом Swarm и Docker secrets. Значения секретов +никогда не попадают в текст ошибки. Один и тот же разбор используют API, +worker, relay и операторский CLI. +""" +from __future__ import annotations + +import hashlib +import os +import re +import socket +import uuid +from dataclasses import dataclass +from pathlib import Path +from typing import Mapping + +DEFAULT_HOST = "0.0.0.0" +DEFAULT_PORT = 8080 +DEFAULT_ENV = "lab" +DEFAULT_LOG_LEVEL = "info" +DEFAULT_GRACEFUL_SHUTDOWN_SECONDS = 5 +DEFAULT_SHUTDOWN_DRAIN_SECONDS = 0.0 + +MAX_SHUTDOWN_BUDGET_SECONDS = 10 + +DEFAULT_SESSION_TTL_SECONDS = 3600 +MIN_SESSION_TTL_SECONDS = 1 +MAX_SESSION_TTL_SECONDS = 86400 + +DEFAULT_DB_POOL_SIZE = 5 +MAX_DB_POOL_SIZE = 32 +DEFAULT_DB_MAX_OVERFLOW = 5 +MAX_DB_MAX_OVERFLOW = 32 +DEFAULT_DB_POOL_TIMEOUT_SECONDS = 2.0 +MAX_DB_POOL_TIMEOUT_SECONDS = 30.0 +DEFAULT_DB_CONNECT_TIMEOUT_SECONDS = 1.5 +MAX_DB_CONNECT_TIMEOUT_SECONDS = 30.0 +DEFAULT_DB_COMMAND_TIMEOUT_SECONDS = 2.5 +MAX_DB_COMMAND_TIMEOUT_SECONDS = 60.0 +DEFAULT_DB_STATEMENT_TIMEOUT_MS = 2000 +MAX_DB_STATEMENT_TIMEOUT_MS = 60000 + +DEFAULT_CACHE_TIMEOUT_SECONDS = 1.0 +MAX_CACHE_TIMEOUT_SECONDS = 10.0 + +# Контракт лабораторной 5 фиксирует эти два предела; переменные окружения +# позволяют выбрать меньший предел для эксперимента, но не больший. +MAX_UPLOAD_BYTES_HARD_LIMIT = 10_485_760 +MAX_IMAGE_PIXELS_HARD_LIMIT = 40_000_000 +DEFAULT_MAX_UPLOAD_BYTES = MAX_UPLOAD_BYTES_HARD_LIMIT +DEFAULT_MAX_IMAGE_PIXELS = MAX_IMAGE_PIXELS_HARD_LIMIT + +DEFAULT_S3_REGION = "us-east-1" +DEFAULT_S3_BUCKET = "messenger-attachments" +DEFAULT_S3_KEY_PREFIX = "attachments/" +DEFAULT_S3_CONNECT_TIMEOUT_SECONDS = 1.5 +DEFAULT_S3_READ_TIMEOUT_SECONDS = 30.0 +DEFAULT_S3_MAX_ATTEMPTS = 2 +MAX_S3_READ_TIMEOUT_SECONDS = 120.0 +DEFAULT_ATTACHMENT_ORPHAN_GRACE_SECONDS = 3600 +MAX_ATTACHMENT_ORPHAN_GRACE_SECONDS = 7 * 24 * 3600 + +# Конвейер версионирован. Версия 1 — original+thumbnail (минимум лабораторной), +# версия 2 — original+thumbnail+crop+optimized (уровень 4). Текущая версия +# задаётся PIPELINE_VERSION и попадает в новое job, а не в глобальную переменную +# worker-а: уже поставленная работа продолжает выполняться своей версией. +DEFAULT_PIPELINE_VERSION = 2 +MAX_SUPPORTED_PIPELINE_VERSION = 2 + +DEFAULT_WORKER_CONCURRENCY = 2 +MAX_WORKER_CONCURRENCY = 16 +DEFAULT_WORKER_PREFETCH = 2 +MAX_WORKER_PREFETCH = 64 +DEFAULT_JOB_MAX_ATTEMPTS = 5 +MAX_JOB_MAX_ATTEMPTS = 20 +DEFAULT_JOB_TIMEOUT_SECONDS = 60.0 +MAX_JOB_TIMEOUT_SECONDS = 600.0 +DEFAULT_JOB_LEASE_SECONDS = 15.0 +MAX_JOB_LEASE_SECONDS = 600.0 +DEFAULT_JOB_BACKOFF_BASE_SECONDS = 1.0 +MAX_JOB_BACKOFF_SECONDS = 600.0 +DEFAULT_JOB_BACKOFF_MAX_SECONDS = 30.0 +DEFAULT_STAGING_RETENTION_SECONDS = 86400 +MAX_STAGING_RETENTION_SECONDS = 7 * 24 * 3600 +DEFAULT_RELAY_POLL_SECONDS = 0.25 +MAX_RELAY_POLL_SECONDS = 10.0 +DEFAULT_REAPER_INTERVAL_SECONDS = 1.0 +MAX_REAPER_INTERVAL_SECONDS = 60.0 +DEFAULT_WORKER_HEARTBEAT_SECONDS = 5.0 + +# Имена очередей и DLQ зафиксированы контрактом задания (jobs.schema.json). +DEFAULT_JOB_QUEUE = "attachment.jobs" +DEFAULT_JOB_ROUTING_KEY = "attachment.process.v1" +DEFAULT_DLQ_EXCHANGE = "attachment.dlx" +DEFAULT_DLQ_QUEUE = "attachment.dlq" + +ENVIRONMENTS = ("lab", "dev", "prod") +LOG_LEVELS = ("debug", "info", "warning", "error") + +DATABASE_URL_SCHEME = "postgresql+asyncpg://" +BROKER_URL_SCHEMES = ("amqp://", "amqps://") + +LOOPBACK_HOSTS = ("127.0.0.1", "localhost", "::1") + +INSTANCE_ID_PATTERN = re.compile(r"^[A-Za-z0-9._:-]{1,128}$") +BUCKET_PATTERN = re.compile(r"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$") +KEY_PREFIX_PATTERN = re.compile(r"^[A-Za-z0-9._/-]{0,128}$") + +FAULT_MODES = ("none", "after_s3_put") + + +class ConfigError(RuntimeError): + """Некорректная конфигурация. Текст не раскрывает значений переменных.""" + + +def _choice(environ: Mapping[str, str], name: str, default: str, allowed: tuple[str, ...]) -> str: + value = environ.get(name, default).strip().lower() + if value not in allowed: + raise ConfigError(f"{name} must be one of: {', '.join(allowed)}") + return value + + +def _integer(environ: Mapping[str, str], name: str, default: int, minimum: int, maximum: int) -> int: + raw = environ.get(name, "").strip() + if not raw: + return default + try: + value = int(raw) + except ValueError: + raise ConfigError(f"{name} must be an integer") from None + if not minimum <= value <= maximum: + raise ConfigError(f"{name} must be within {minimum}..{maximum}") + return value + + +def _seconds(environ: Mapping[str, str], name: str, default: float, maximum: float) -> float: + raw = environ.get(name, "").strip() + if not raw: + return default + try: + value = float(raw) + except ValueError: + raise ConfigError(f"{name} must be a number of seconds") from None + if not 0.0 <= value <= maximum: + raise ConfigError(f"{name} must be within 0..{maximum}") + return value + + +def _boolean(environ: Mapping[str, str], name: str, default: bool) -> bool: + raw = environ.get(name, "").strip().lower() + if not raw: + return default + if raw in ("1", "true", "yes", "on"): + return True + if raw in ("0", "false", "no", "off"): + return False + raise ConfigError(f"{name} must be a boolean") + + +def _secret(environ: Mapping[str, str], name: str) -> str | None: + direct = environ.get(name, "").strip() + path = environ.get(f"{name}_FILE", "").strip() + if direct and path: + raise ConfigError(f"{name} and {name}_FILE must not be set together") + if direct: + return direct + if not path: + return None + try: + value = Path(path).read_text(encoding="utf-8").strip() + except OSError: + raise ConfigError(f"{name}_FILE must point to a readable file") from None + if not value: + raise ConfigError(f"{name}_FILE must not be empty") + return value + + +def _required_secret(environ: Mapping[str, str], name: str) -> str: + value = _secret(environ, name) + if value is None: + raise ConfigError(f"{name} or {name}_FILE is required") + return value + + +def _optional_path(environ: Mapping[str, str], name: str) -> str | None: + """Путь к публичному CA/сертификату: значение не секрет, но файл обязателен.""" + raw = environ.get(name, "").strip() + if not raw: + return None + try: + Path(raw).open("rb").close() + except OSError: + raise ConfigError(f"{name} must point to a readable file") from None + return raw + + +def _checked_url(value: str, *, name: str, schemes: tuple[str, ...]) -> str: + if not value.startswith(schemes): + raise ConfigError(f"{name} must start with one of: {', '.join(schemes)}") + return value + + +def database_url_from_env(environ: Mapping[str, str] | None = None) -> str: + source: Mapping[str, str] = os.environ if environ is None else environ + return _checked_url( + _required_secret(source, "DATABASE_URL"), + name="DATABASE_URL", + schemes=(DATABASE_URL_SCHEME,), + ) + + +def instance_id_from_env(environ: Mapping[str, str]) -> str: + raw = environ.get("INSTANCE_ID", "").strip() or socket.gethostname().strip() + if not raw: + raw = "api-" + uuid.uuid4().hex[:12] + if INSTANCE_ID_PATTERN.fullmatch(raw): + return raw + return "api-" + hashlib.sha256(raw.encode("utf-8")).hexdigest()[:16] + + +def process_identity_from_env(environ: Mapping[str, str], prefix: str) -> str: + """Стабильный идентификатор процесса для логов, lease и аудита.""" + raw = environ.get("WORKER_ID", "").strip() or socket.gethostname().strip() + if not raw: + raw = prefix + "-" + uuid.uuid4().hex[:12] + if INSTANCE_ID_PATTERN.fullmatch(raw): + return raw + return prefix + "-" + hashlib.sha256(raw.encode("utf-8")).hexdigest()[:16] + + +@dataclass(frozen=True) +class Config: + host: str + port: int + env: str + instance_id: str + log_level: str + graceful_shutdown_seconds: int + shutdown_drain_seconds: float + database_url: str + session_ttl_seconds: int + db_pool_size: int + db_max_overflow: int + db_pool_timeout_seconds: float + db_connect_timeout_seconds: float + db_command_timeout_seconds: float + db_statement_timeout_ms: int + db_ca_file: str | None + db_cert_file: str | None + db_key_file: str | None + cursor_secret: bytes | None + s3_endpoint: str + s3_region: str + s3_bucket: str + s3_key_prefix: str + s3_access_key_id: str + s3_secret_access_key: str + s3_connect_timeout_seconds: float + s3_read_timeout_seconds: float + s3_max_attempts: int + s3_ca_file: str | None + max_upload_bytes: int + max_image_pixels: int + attachment_orphan_grace_seconds: int + attachment_fault_mode: str + broker_url: str | None + broker_ca_file: str | None + broker_cert_file: str | None + broker_key_file: str | None + pipeline_version: int + worker_id: str + worker_concurrency: int + worker_prefetch: int + job_max_attempts: int + job_timeout_seconds: float + job_lease_seconds: float + job_backoff_base_seconds: float + job_backoff_max_seconds: float + staging_retention_seconds: int + allow_fault_injection: bool + relay_poll_seconds: float + reaper_interval_seconds: float + argon2_memory_kib: int + argon2_iterations: int + argon2_parallelism: int + login_rate_limit_attempts: int + login_rate_limit_window_seconds: int + login_rate_limit_block_seconds: int + login_max_concurrency: int + + def __post_init__(self) -> None: + if self.shutdown_budget_seconds > MAX_SHUTDOWN_BUDGET_SECONDS: + raise ConfigError( + "GRACEFUL_SHUTDOWN_SECONDS + SHUTDOWN_DRAIN_SECONDS must be " + f"at most {MAX_SHUTDOWN_BUDGET_SECONDS} seconds" + ) + if not self.s3_endpoint.startswith(("http://", "https://")): + raise ConfigError("S3_ENDPOINT must start with http:// or https://") + if not BUCKET_PATTERN.fullmatch(self.s3_bucket): + raise ConfigError("S3_BUCKET must be a valid S3 bucket name") + if not KEY_PREFIX_PATTERN.fullmatch(self.s3_key_prefix) or ".." in self.s3_key_prefix: + raise ConfigError("S3_KEY_PREFIX is not a safe object prefix") + if self.broker_url is not None and not self.broker_url.startswith(BROKER_URL_SCHEMES): + raise ConfigError("BROKER_URL must start with amqp:// or amqps://") + if self.job_backoff_max_seconds < self.job_backoff_base_seconds: + raise ConfigError("JOB_BACKOFF_MAX_SECONDS must be >= JOB_BACKOFF_BASE_SECONDS") + if self.job_timeout_seconds <= 0: + raise ConfigError("JOB_TIMEOUT_SECONDS must be > 0") + if self.job_lease_seconds <= 0: + raise ConfigError("JOB_LEASE_SECONDS must be > 0") + if self.pipeline_version < 1 or self.pipeline_version > MAX_SUPPORTED_PIPELINE_VERSION: + raise ConfigError( + f"PIPELINE_VERSION must be within 1..{MAX_SUPPORTED_PIPELINE_VERSION}" + ) + + @property + def shutdown_budget_seconds(self) -> float: + return self.graceful_shutdown_seconds + self.shutdown_drain_seconds + + @property + def binds_to_loopback(self) -> bool: + return self.host in LOOPBACK_HOSTS + + def require_broker(self) -> str: + """Worker/relay не могут работать без брокера; API — может (outbox).""" + if not self.broker_url: + raise ConfigError("BROKER_URL or BROKER_URL_FILE is required for worker/relay") + return self.broker_url + + @classmethod + def from_env(cls, environ: Mapping[str, str] | None = None) -> "Config": + source: Mapping[str, str] = os.environ if environ is None else environ + env = _choice(source, "APP_ENV", DEFAULT_ENV, ENVIRONMENTS) + host = source.get("APP_HOST", DEFAULT_HOST).strip() + if not host: + raise ConfigError("APP_HOST must not be empty") + default_log_level = "debug" if env == "dev" else DEFAULT_LOG_LEVEL + database_url = database_url_from_env(source) + cursor_secret = _secret(source, "CURSOR_SECRET") + fault_mode = _choice(source, "ATTACHMENT_FAULT_MODE", "none", FAULT_MODES) + if env == "prod" and fault_mode != "none": + raise ConfigError("ATTACHMENT_FAULT_MODE must be none in prod") + allow_faults = _boolean(source, "ALLOW_FAULT_INJECTION", env != "prod") + if env == "prod" and allow_faults: + raise ConfigError("ALLOW_FAULT_INJECTION must be false in prod") + key_prefix = source.get("S3_KEY_PREFIX", DEFAULT_S3_KEY_PREFIX).strip() or DEFAULT_S3_KEY_PREFIX + broker_url = _secret(source, "BROKER_URL") + job_max_attempts = _integer( + source, "JOB_MAX_ATTEMPTS", DEFAULT_JOB_MAX_ATTEMPTS, 1, MAX_JOB_MAX_ATTEMPTS + ) + return cls( + host=host, + port=_integer(source, "APP_PORT", DEFAULT_PORT, 1, 65535), + env=env, + instance_id=instance_id_from_env(source), + log_level=_choice(source, "LOG_LEVEL", default_log_level, LOG_LEVELS), + graceful_shutdown_seconds=_integer( + source, "GRACEFUL_SHUTDOWN_SECONDS", DEFAULT_GRACEFUL_SHUTDOWN_SECONDS, 1, 10 + ), + shutdown_drain_seconds=_seconds( + source, "SHUTDOWN_DRAIN_SECONDS", DEFAULT_SHUTDOWN_DRAIN_SECONDS, 5.0 + ), + database_url=database_url, + session_ttl_seconds=_integer( + source, "SESSION_TTL_SECONDS", DEFAULT_SESSION_TTL_SECONDS, + MIN_SESSION_TTL_SECONDS, MAX_SESSION_TTL_SECONDS, + ), + db_pool_size=_integer(source, "DB_POOL_SIZE", DEFAULT_DB_POOL_SIZE, 1, MAX_DB_POOL_SIZE), + db_max_overflow=_integer(source, "DB_MAX_OVERFLOW", DEFAULT_DB_MAX_OVERFLOW, 0, MAX_DB_MAX_OVERFLOW), + db_pool_timeout_seconds=_seconds(source, "DB_POOL_TIMEOUT_SECONDS", DEFAULT_DB_POOL_TIMEOUT_SECONDS, MAX_DB_POOL_TIMEOUT_SECONDS), + db_connect_timeout_seconds=_seconds(source, "DB_CONNECT_TIMEOUT_SECONDS", DEFAULT_DB_CONNECT_TIMEOUT_SECONDS, MAX_DB_CONNECT_TIMEOUT_SECONDS), + db_command_timeout_seconds=_seconds(source, "DB_COMMAND_TIMEOUT_SECONDS", DEFAULT_DB_COMMAND_TIMEOUT_SECONDS, MAX_DB_COMMAND_TIMEOUT_SECONDS), + db_statement_timeout_ms=_integer(source, "DB_STATEMENT_TIMEOUT_MS", DEFAULT_DB_STATEMENT_TIMEOUT_MS, 1, MAX_DB_STATEMENT_TIMEOUT_MS), + db_ca_file=_optional_path(source, "DB_CA_FILE"), + db_cert_file=_optional_path(source, "DB_CLIENT_CERT_FILE"), + db_key_file=_optional_path(source, "DB_CLIENT_KEY_FILE"), + cursor_secret=None if cursor_secret is None else cursor_secret.encode("utf-8"), + s3_endpoint=_checked_url(_required_secret(source, "S3_ENDPOINT"), name="S3_ENDPOINT", schemes=("http://", "https://")), + s3_region=source.get("S3_REGION", DEFAULT_S3_REGION).strip() or DEFAULT_S3_REGION, + s3_bucket=source.get("S3_BUCKET", DEFAULT_S3_BUCKET).strip() or DEFAULT_S3_BUCKET, + s3_key_prefix=key_prefix, + s3_access_key_id=_required_secret(source, "S3_ACCESS_KEY_ID"), + s3_secret_access_key=_required_secret(source, "S3_SECRET_ACCESS_KEY"), + s3_connect_timeout_seconds=_seconds(source, "S3_CONNECT_TIMEOUT_SECONDS", DEFAULT_S3_CONNECT_TIMEOUT_SECONDS, MAX_S3_READ_TIMEOUT_SECONDS), + s3_read_timeout_seconds=_seconds(source, "S3_READ_TIMEOUT_SECONDS", DEFAULT_S3_READ_TIMEOUT_SECONDS, MAX_S3_READ_TIMEOUT_SECONDS), + s3_max_attempts=_integer(source, "S3_MAX_ATTEMPTS", DEFAULT_S3_MAX_ATTEMPTS, 1, 5), + s3_ca_file=_optional_path(source, "S3_CA_FILE"), + max_upload_bytes=_integer(source, "MAX_UPLOAD_BYTES", DEFAULT_MAX_UPLOAD_BYTES, 1, MAX_UPLOAD_BYTES_HARD_LIMIT), + max_image_pixels=_integer(source, "MAX_IMAGE_PIXELS", DEFAULT_MAX_IMAGE_PIXELS, 1, MAX_IMAGE_PIXELS_HARD_LIMIT), + attachment_orphan_grace_seconds=_integer(source, "ATTACHMENT_ORPHAN_GRACE_SECONDS", DEFAULT_ATTACHMENT_ORPHAN_GRACE_SECONDS, 0, MAX_ATTACHMENT_ORPHAN_GRACE_SECONDS), + attachment_fault_mode=fault_mode, + broker_url=broker_url, + broker_ca_file=_optional_path(source, "BROKER_CA_FILE"), + broker_cert_file=_optional_path(source, "BROKER_CLIENT_CERT_FILE"), + broker_key_file=_optional_path(source, "BROKER_CLIENT_KEY_FILE"), + pipeline_version=_integer(source, "PIPELINE_VERSION", DEFAULT_PIPELINE_VERSION, 1, MAX_SUPPORTED_PIPELINE_VERSION), + worker_id=process_identity_from_env(source, "worker"), + worker_concurrency=_integer(source, "WORKER_CONCURRENCY", DEFAULT_WORKER_CONCURRENCY, 1, MAX_WORKER_CONCURRENCY), + worker_prefetch=_integer(source, "WORKER_PREFETCH", DEFAULT_WORKER_PREFETCH, 1, MAX_WORKER_PREFETCH), + job_max_attempts=job_max_attempts, + job_timeout_seconds=_seconds(source, "JOB_TIMEOUT_SECONDS", DEFAULT_JOB_TIMEOUT_SECONDS, MAX_JOB_TIMEOUT_SECONDS), + job_lease_seconds=_seconds(source, "JOB_LEASE_SECONDS", DEFAULT_JOB_LEASE_SECONDS, MAX_JOB_LEASE_SECONDS), + job_backoff_base_seconds=_seconds(source, "JOB_BACKOFF_BASE_SECONDS", DEFAULT_JOB_BACKOFF_BASE_SECONDS, MAX_JOB_BACKOFF_SECONDS), + job_backoff_max_seconds=_seconds(source, "JOB_BACKOFF_MAX_SECONDS", DEFAULT_JOB_BACKOFF_MAX_SECONDS, MAX_JOB_BACKOFF_SECONDS), + staging_retention_seconds=_integer(source, "STAGING_RETENTION_SECONDS", DEFAULT_STAGING_RETENTION_SECONDS, 0, MAX_STAGING_RETENTION_SECONDS), + allow_fault_injection=allow_faults, + relay_poll_seconds=_seconds(source, "RELAY_POLL_SECONDS", DEFAULT_RELAY_POLL_SECONDS, MAX_RELAY_POLL_SECONDS), + reaper_interval_seconds=_seconds(source, "REAPER_INTERVAL_SECONDS", DEFAULT_REAPER_INTERVAL_SECONDS, MAX_REAPER_INTERVAL_SECONDS), + argon2_memory_kib=_integer(source, "ARGON2_MEMORY_KIB", 19456, 19456, 1048576), + argon2_iterations=_integer(source, "ARGON2_ITERATIONS", 2, 2, 16), + argon2_parallelism=_integer(source, "ARGON2_PARALLELISM", 1, 1, 8), + login_rate_limit_attempts=_integer(source, "LOGIN_RATE_LIMIT_ATTEMPTS", 10, 1, 1000), + login_rate_limit_window_seconds=_integer(source, "LOGIN_RATE_LIMIT_WINDOW_SECONDS", 60, 1, 3600), + login_rate_limit_block_seconds=_integer(source, "LOGIN_RATE_LIMIT_BLOCK_SECONDS", 60, 1, 3600), + login_max_concurrency=_integer(source, "LOGIN_MAX_CONCURRENCY", 2, 1, 32), + ) + + +def db_ssl_context_from_env(environ: Mapping[str, str] | None = None): + """TLS-контекст для PostgreSQL: verify-full плюс необязательный клиентский cert. + + Возвращает None, если DB_CA_FILE не задан. Отдельная функция нужна и + Alembic-у: миграции обязаны идти по тому же проверенному TLS, что и API. + """ + import ssl + + source: Mapping[str, str] = os.environ if environ is None else environ + cafile = _optional_path(source, "DB_CA_FILE") + if cafile is None: + return None + context = ssl.create_default_context(cafile=cafile) + context.check_hostname = True + context.verify_mode = ssl.CERT_REQUIRED + certfile = _optional_path(source, "DB_CLIENT_CERT_FILE") + keyfile = _optional_path(source, "DB_CLIENT_KEY_FILE") + if certfile: + context.load_cert_chain(certfile, keyfile) + return context diff --git a/src/messenger/context.py b/src/messenger/context.py new file mode 100644 index 0000000..78f326f --- /dev/null +++ b/src/messenger/context.py @@ -0,0 +1,23 @@ +"""Контекст одного HTTP-запроса: данные живут в ASGI-scope.""" +from __future__ import annotations + +from typing import Any, MutableMapping + +CONTEXT_KEY = "messenger.request_context" + +REQUEST_ID = "request_id" +USER_ID = "user_id" + + +def context_of(scope: MutableMapping[str, Any]) -> dict[str, Any]: + """Возвращает (при необходимости создавая) словарь контекста запроса.""" + context = scope.get(CONTEXT_KEY) + if context is None: + context = {} + scope[CONTEXT_KEY] = context + return context + + +def request_context(request: Any) -> dict[str, Any]: + """Контекст по объекту Request/WebSocket.""" + return context_of(request.scope) diff --git a/src/messenger/cursor.py b/src/messenger/cursor.py new file mode 100644 index 0000000..7f55bc1 --- /dev/null +++ b/src/messenger/cursor.py @@ -0,0 +1,119 @@ +"""Keyset-курсор: подписан ключом процесса и привязан к ресурсу (kind + scope).""" +from __future__ import annotations + +import base64 +import binascii +import hashlib +import hmac +import json +import secrets +from dataclasses import dataclass +from uuid import UUID + +from .domain import Position, parse_rfc3339_z + +CURSOR_VERSION = 1 +SIGNATURE_BYTES = 16 +SEPARATOR = "." + +KIND_CHATS = "chats" +KIND_MESSAGES = "messages" + + +class InvalidCursor(ValueError): + """Курсор повреждён, подделан или выпущен для другого ресурса.""" + + +def _b64encode(raw: bytes) -> str: + return base64.urlsafe_b64encode(raw).decode("ascii").rstrip("=") + + +def _b64decode(value: str) -> bytes: + return base64.urlsafe_b64decode(value + "=" * (-len(value) % 4)) + + +def _parse_timestamp(value: object) -> str: + """Проверяет, что метка времени — RFC 3339 UTC с суффиксом Z.""" + if not isinstance(value, str): + raise InvalidCursor("cursor timestamp is not a string") + try: + parse_rfc3339_z(value) + except ValueError: + raise InvalidCursor("cursor timestamp is not RFC 3339 UTC with Z suffix") from None + return value + + +@dataclass(frozen=True) +class Cursor: + """Позиция последнего отданного элемента выборки.""" + + kind: str + scope: str + created_at: str + item_id: str + + @property + def position(self) -> Position: + """Место в порядке (created_at, id), с которого продолжается выборка.""" + return (parse_rfc3339_z(self.created_at), UUID(self.item_id)) + + +class CursorCodec: + """Кодирует и проверяет курсоры ключом, известным только процессу.""" + + def __init__(self, key: bytes | None = None) -> None: + self._key = secrets.token_bytes(32) if key is None else key + + def encode(self, kind: str, scope: str, created_at: str, item_id: str) -> str: + payload = json.dumps( + { + "v": CURSOR_VERSION, + "kind": kind, + "scope": scope, + "created_at": created_at, + "id": item_id, + }, + ensure_ascii=False, + separators=(",", ":"), + sort_keys=True, + ).encode("utf-8") + signature = hmac.new(self._key, payload, hashlib.sha256).digest()[:SIGNATURE_BYTES] + return _b64encode(payload) + SEPARATOR + _b64encode(signature) + + def decode(self, token: str, *, kind: str, scope: str) -> Cursor: + """Разбирает курсор или поднимает InvalidCursor — наружу это всегда 400.""" + if not isinstance(token, str) or not token: + raise InvalidCursor("cursor is empty") + encoded_payload, separator, encoded_signature = token.partition(SEPARATOR) + if not separator: + raise InvalidCursor("cursor has no signature part") + try: + payload = _b64decode(encoded_payload) + signature = _b64decode(encoded_signature) + except (binascii.Error, ValueError): + raise InvalidCursor("cursor is not valid base64url") from None + + expected = hmac.new(self._key, payload, hashlib.sha256).digest()[:SIGNATURE_BYTES] + if not hmac.compare_digest(signature, expected): + raise InvalidCursor("cursor signature mismatch") + + try: + data = json.loads(payload.decode("utf-8")) + except (UnicodeDecodeError, ValueError): + raise InvalidCursor("cursor payload is not valid JSON") from None + if not isinstance(data, dict) or data.get("v") != CURSOR_VERSION: + raise InvalidCursor("unsupported cursor version") + + cursor = Cursor( + kind=str(data.get("kind", "")), + scope=str(data.get("scope", "")), + created_at=_parse_timestamp(data.get("created_at")), + item_id=str(data.get("id", "")), + ) + try: + UUID(cursor.item_id) + except ValueError: + raise InvalidCursor("cursor id is not a UUID") from None + if cursor.kind != kind or cursor.scope != scope: + raise InvalidCursor("cursor belongs to another resource") + return cursor diff --git a/src/messenger/db.py b/src/messenger/db.py new file mode 100644 index 0000000..a537095 --- /dev/null +++ b/src/messenger/db.py @@ -0,0 +1,104 @@ +"""Асинхронный доступ к PostgreSQL: движок, ограниченный пул и таймауты.""" +from __future__ import annotations + +from contextlib import asynccontextmanager +from typing import AsyncIterator + +from sqlalchemy import text +from sqlalchemy.exc import ProgrammingError +from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker, create_async_engine +from sqlalchemy.pool.impl import AsyncAdaptedQueuePool + +from .config import Config, db_ssl_context_from_env + +APPLICATION_NAME = "messenger" + +# Незакоммиченная транзакция не должна держать соединение пула бесконечно. +IDLE_IN_TRANSACTION_TIMEOUT_MS = 10000 + + +class ObservedAsyncPool(AsyncAdaptedQueuePool): + """Пул, который считает ожидающих соединение. + + SQLAlchemy не публикует число waiters для async-пула. Счётчик вокруг + _do_get() включает и ожидание в очереди, и установление нового соединения; + для saturation-панели этого достаточно, семантика названа явно. + """ + + waiting: int = 0 + + def _do_get(self): + type(self).waiting += 1 + try: + return super()._do_get() + finally: + type(self).waiting -= 1 + + +class Database: + """Владеет пулом соединений; сессия живёт ровно один HTTP-запрос.""" + + def __init__(self, config: Config) -> None: + ssl_context = db_ssl_context_from_env() + connect_args: dict = { + # Границы на круг asyncpg, на установление соединения (включая + # разрешение имени) и на стороне сервера. + "timeout": config.db_connect_timeout_seconds, + "command_timeout": config.db_command_timeout_seconds, + "server_settings": { + "application_name": APPLICATION_NAME, + "statement_timeout": str(config.db_statement_timeout_ms), + "idle_in_transaction_session_timeout": str(IDLE_IN_TRANSACTION_TIMEOUT_MS), + }, + } + if ssl_context is not None: + # verify-full: цепочка, срок и hostname проверяются клиентом (asyncpg + # использует ssl-контекст целиком, включая check_hostname). + connect_args["ssl"] = ssl_context + self._engine: AsyncEngine = create_async_engine( + config.database_url, + # Пул ограничен: лишние запросы ждут освобождения соединения. + pool_size=config.db_pool_size, + max_overflow=config.db_max_overflow, + pool_timeout=config.db_pool_timeout_seconds, + poolclass=ObservedAsyncPool, + pool_pre_ping=True, + pool_recycle=1800, + connect_args=connect_args, + ) + self._sessions = async_sessionmaker(self._engine, expire_on_commit=False) + + @property + def engine(self) -> AsyncEngine: + return self._engine + + @asynccontextmanager + async def session(self) -> AsyncIterator[AsyncSession]: + """Сессия на один запрос: закрывается всегда, откат делает SQLAlchemy.""" + session = self._sessions() + try: + yield session + finally: + await session.close() + + async def ping(self) -> None: + """Проверка готовности: одно дешёвое обращение к серверу.""" + async with self.session() as session: + await session.execute(text("SELECT 1")) + + async def schema_revision(self) -> str | None: + """Текущая ревизия Alembic; None, если таблицы версий ещё нет. + + До завершения однократной миграции API обязан быть неготовым, иначе + Traefik отправит трафик на процесс, который не может писать в схему. + Отсутствие таблицы — это не отказ соединения, а нормальное состояние + холодного старта, поэтому исключение гасится здесь. + """ + async with self.session() as session: + try: + return await session.scalar(text("SELECT version_num FROM alembic_version")) + except ProgrammingError: + return None + + async def dispose(self) -> None: + await self._engine.dispose() \ No newline at end of file diff --git a/src/messenger/deps.py b/src/messenger/deps.py new file mode 100644 index 0000000..1847d54 --- /dev/null +++ b/src/messenger/deps.py @@ -0,0 +1,140 @@ +"""Зависимости FastAPI: PostgreSQL, хранилище сессий и текущий пользователь. + +Личность в этой работе определяется только сессией: заголовок X-User-Id из ЛР1 +не читается нигде и не влияет на ответ. +""" +from __future__ import annotations + +from collections.abc import AsyncIterator +from dataclasses import dataclass +from typing import Annotated + +from fastapi import Depends, Header, Request +from sqlalchemy.ext.asyncio import AsyncSession + +from .config import Config +from .context import USER_ID, request_context +from .cursor import CursorCodec +from .db import Database +from .domain import UserRecord +from .errors import BASIC_CHALLENGE, unauthorized +from .login_guard import LoginGuard +from .repository import Repository +from .security import parse_basic, parse_bearer +from .sessions import SessionStore +from .storage import S3Storage + +AUTHORIZATION_HEADER = "Authorization" + + +@dataclass(frozen=True) +class BasicCredentials: + """Разобранные учётные данные входа по Basic.""" + + username: str + password: str + + +def get_database(request: Request) -> Database: + """Пул соединений живёт в состоянии приложения: один на процесс.""" + return request.app.state.database + + +def get_sessions(request: Request) -> SessionStore: + """Хранилище сессий живёт в состоянии приложения.""" + return request.app.state.sessions + + +def get_cursors(request: Request) -> CursorCodec: + """Кодек курсоров привязан к процессу: ключ подписи не покидает память.""" + return request.app.state.cursors + + +def get_login_guard(request: Request) -> LoginGuard: + """Лимитер входа живёт в состоянии приложения и использует общий пул БД.""" + return request.app.state.login_guard + + +def get_config(request: Request) -> Config: + """Разобранная конфигурация процесса живёт в состоянии приложения.""" + return request.app.state.config + + +def get_storage(request: Request) -> S3Storage: + """S3-клиент один на процесс; байты не проходят через PostgreSQL.""" + return request.app.state.storage + + +DatabaseDep = Annotated[Database, Depends(get_database)] +SessionsDep = Annotated[SessionStore, Depends(get_sessions)] +CursorsDep = Annotated[CursorCodec, Depends(get_cursors)] +ConfigDep = Annotated[Config, Depends(get_config)] +LoginGuardDep = Annotated[LoginGuard, Depends(get_login_guard)] +StorageDep = Annotated[S3Storage, Depends(get_storage)] + + +async def get_db_session(database: DatabaseDep) -> AsyncIterator[AsyncSession]: + """Сессия БД на один запрос: закрывается вместе с ответом.""" + async with database.session() as session: + yield session + + +DbSession = Annotated[AsyncSession, Depends(get_db_session)] + + +def get_repository(session: DbSession) -> Repository: + """Репозиторий поверх сессии запроса: всё SQL живёт в нём.""" + return Repository(session) + + +RepositoryDep = Annotated[Repository, Depends(get_repository)] + + +def basic_credentials( + authorization: Annotated[str | None, Header(alias=AUTHORIZATION_HEADER)] = None, +) -> BasicCredentials: + """Учётные данные входа: единственное место, где принимается схема Basic.""" + parsed = parse_basic(authorization) + if parsed is None: + raise unauthorized("Требуется Basic-аутентификация", challenge=BASIC_CHALLENGE) + return BasicCredentials(username=parsed[0], password=parsed[1]) + + +BasicCredentialsDep = Annotated[BasicCredentials, Depends(basic_credentials)] + + +def bearer_token( + authorization: Annotated[str | None, Header(alias=AUTHORIZATION_HEADER)] = None, +) -> str: + """Токен сессии из заголовка Authorization; иначе 401 с Bearer-челленджем.""" + token = parse_bearer(authorization) + if token is None: + raise unauthorized("Требуется Bearer-токен сессии") + return token + + +BearerToken = Annotated[str, Depends(bearer_token)] + + +async def get_current_user( + request: Request, + sessions: SessionsDep, + repository: RepositoryDep, + token: BearerToken, +) -> UserRecord: + """Владелец действующей сессии. + + Порядок важен: сначала сессия в Valkey, потом пользователь в PostgreSQL. + Неизвестный или истёкший токен — это 401, а не «анонимный доступ». + """ + state = await sessions.resolve(token) + if state is None: + raise unauthorized("Сессия не найдена или истекла") + user = await repository.get_user(state.user_id) + if user is None: + raise unauthorized("Владелец сессии больше не существует") + request_context(request)[USER_ID] = str(user.id) + return user + + +CurrentUser = Annotated[UserRecord, Depends(get_current_user)] diff --git a/src/messenger/domain.py b/src/messenger/domain.py new file mode 100644 index 0000000..056320d --- /dev/null +++ b/src/messenger/domain.py @@ -0,0 +1,137 @@ +"""Сущности предметной области, порядок сортировки и формат метки времени.""" +from __future__ import annotations + +from dataclasses import dataclass, field +from datetime import datetime, timezone +from typing import Protocol, Sequence +from uuid import UUID + + +def utc_now() -> datetime: + return datetime.now(timezone.utc) + + +def rfc3339_z(moment: datetime) -> str: + """RFC 3339 в UTC с суффиксом Z и микросекундной точностью.""" + return moment.astimezone(timezone.utc).isoformat(timespec="microseconds").replace("+00:00", "Z") + + +def parse_rfc3339_z(value: str) -> datetime: + """Разбирает метку в формате `rfc3339_z`; иначе ValueError.""" + if not value.endswith("Z"): + raise ValueError("timestamp is not UTC with Z suffix") + return datetime.fromisoformat(value[:-1] + "+00:00") + + +class Sortable(Protocol): + """Общая часть записей: пара, по которой строится порядок и keyset-курсор.""" + + created_at: datetime + id: UUID + + +Position = tuple[datetime, UUID] + +ATTACHMENT_STATUS_QUEUED = "queued" +ATTACHMENT_STATUS_PROCESSING = "processing" +ATTACHMENT_STATUS_READY = "ready" +ATTACHMENT_STATUS_FAILED = "failed" +# Историческое имя lab4: строка до публикации результата. В lab5 это queued. +ATTACHMENT_STATUS_PENDING = ATTACHMENT_STATUS_QUEUED + + +class UsernameTaken(Exception): + """username уже занят другим пользователем.""" + + +class UnknownMembers(Exception): + """В member_ids есть идентификаторы несуществующих пользователей.""" + + def __init__(self, member_ids: Sequence[UUID]) -> None: + super().__init__("unknown members") + self.member_ids = tuple(member_ids) + + +class IdempotencyConflict(Exception): + """Тот же ключ идемпотентности использован с другим телом запроса.""" + + +class AttachmentUnknown(Exception): + """Вложение не существует, чужое или принадлежит другому чату.""" + + +class AttachmentNotReady(Exception): + """Вложение существует, но ещё не готово (pending/failed).""" + + +@dataclass(frozen=True) +class UserRecord: + id: UUID + username: str + display_name: str + created_at: datetime + + +@dataclass(frozen=True) +class ChatRecord: + id: UUID + title: str + member_ids: tuple[UUID, ...] + created_at: datetime + + def has_member(self, user_id: UUID) -> bool: + """Состав участников задаётся при создании и не меняется.""" + return user_id in self.member_ids + + +@dataclass(frozen=True) +class MessageRecord: + id: UUID + chat_id: UUID + sender_id: UUID + text: str + created_at: datetime + attachment_ids: tuple[UUID, ...] = field(default_factory=tuple) + + +@dataclass(frozen=True) +class VariantRecord: + """Опубликованный вариант изображения: метаданные и ключ объекта S3.""" + + attachment_id: UUID + pipeline_version: int + name: str + content_type: str + object_key: str + size_bytes: int + sha256: str + width: int + height: int + created_at: datetime + + +@dataclass(frozen=True) +class AttachmentRecord: + """Метаданные вложения. Байты в этой записи отсутствуют принципиально. + + object_key — конечный ключ оригинала; staging_key — приватный staging-ключ. + pipeline_version — версия конвейера, результат которой опубликован (0 — нет). + variants — только варианты этой версии, в порядке thumbnail/crop/optimized. + """ + + id: UUID + chat_id: UUID + owner_id: UUID + object_key: str + staging_key: str + pipeline_version: int + filename: str + content_type: str + size_bytes: int + sha256: str + status: str + error_code: str | None + ready_at: datetime | None + created_at: datetime + updated_at: datetime + variants: tuple[VariantRecord, ...] = field(default_factory=tuple) diff --git a/src/messenger/errorhandlers.py b/src/messenger/errorhandlers.py new file mode 100644 index 0000000..ded2022 --- /dev/null +++ b/src/messenger/errorhandlers.py @@ -0,0 +1,182 @@ +"""Обработчики ошибок: единый конверт контракта и заголовки к нему.""" +from __future__ import annotations + +import logging +import uuid +from typing import Mapping + +from fastapi import FastAPI, Request +from fastapi.exceptions import RequestValidationError +from fastapi.responses import JSONResponse +from sqlalchemy.exc import DataError, DisconnectionError, InterfaceError, OperationalError +from sqlalchemy.exc import TimeoutError as PoolTimeoutError +from starlette.exceptions import HTTPException as StarletteHTTPException + +from .context import REQUEST_ID, request_context +from .errors import INTERNAL_ERROR, INVALID_REQUEST, NOT_FOUND, UNAVAILABLE, ApiError, code_for_status +from .logging_setup import log +from .storage import StorageObjectMissing, StorageUnavailable + +FALLBACK_MESSAGES: Mapping[int, str] = { + 404: "Маршрут не найден", + 405: "Метод не поддерживается для этого маршрута", +} + +# Отказ критичной зависимости (PostgreSQL или Valkey): наружу 503 без деталей, +# подробности остаются в логе. Для клиента «сессии недоступны» и «база недоступна» +# выглядят одинаково — и это правильно, различать их он не должен. +# +# Здесь только отказы соединения и исчерпание пула. Более широкий SQLAlchemyError +# сюда не годится: он включает DataError, и тогда значение, которое PostgreSQL +# не может принять, выглядело бы как недоступность базы. +DEPENDENCY_ERRORS = ( + OperationalError, + InterfaceError, + DisconnectionError, + PoolTimeoutError, + OSError, +) +DEPENDENCY_MESSAGE = "Сервис временно недоступен: критичная зависимость не отвечает" +DATA_ERROR_MESSAGE = "Значение поля не может быть сохранено" + + +def request_id_of(request: Request) -> str: + """Идентификатор запроса; запасной вариант — если middleware не подключён.""" + context = request_context(request) + identifier = context.get(REQUEST_ID) + if not identifier: + identifier = uuid.uuid4().hex + context[REQUEST_ID] = identifier + return identifier + + +def error_response( + request: Request, + status: int, + code: str, + message: str, + headers: Mapping[str, str] | None = None, +) -> JSONResponse: + """Собирает конверт ошибки контракта; request_id совпадает с заголовком.""" + identifier = request_id_of(request) + response_headers = {"X-Request-Id": identifier} + response_headers.update(headers or {}) + return JSONResponse( + status_code=status, + content={"error": {"code": code, "message": message, "request_id": identifier}}, + headers=response_headers, + ) + + +def describe_validation_error(exc: RequestValidationError) -> str: + """Краткое описание без значений полей: наружу уходит только расположение ошибки. + + Значения сюда не попадают намеренно: среди них может быть пароль. + """ + errors = exc.errors() + if not errors: + return "Тело запроса не соответствует контракту" + first = errors[0] + if str(first.get("type", "")) == "json_invalid": + return "Тело запроса не является корректным JSON" + location = ".".join( + str(part) + for part in first.get("loc", ()) + if part not in ("body", "query", "path", "header") + ) + return f"Некорректный запрос: {location or 'body'}" + + +def register_error_handlers(app: FastAPI, logger: logging.Logger) -> None: + """Ставит обработчики так, чтобы наружу не ушёл ответ без конверта.""" + + @app.exception_handler(ApiError) + async def handle_api_error(request: Request, exc: ApiError) -> JSONResponse: + return error_response(request, exc.status, exc.code, exc.message, exc.headers) + + @app.exception_handler(RequestValidationError) + async def handle_validation_error( + request: Request, exc: RequestValidationError + ) -> JSONResponse: + return error_response(request, 400, INVALID_REQUEST, describe_validation_error(exc)) + + @app.exception_handler(StarletteHTTPException) + async def handle_http_exception( + request: Request, exc: StarletteHTTPException + ) -> JSONResponse: + status = exc.status_code + return error_response( + request, + status, + code_for_status(status), + FALLBACK_MESSAGES.get(status, "Запрос не может быть обработан"), + getattr(exc, "headers", None), + ) + + async def handle_dependency_failure(request: Request, exc: Exception) -> JSONResponse: + log( + logger, + logging.ERROR, + "dependency_unavailable", + exc_info=exc, + request_id=request_id_of(request), + error=type(exc).__name__, + ) + return error_response(request, 503, UNAVAILABLE, DEPENDENCY_MESSAGE) + + @app.exception_handler(StorageObjectMissing) + async def handle_storage_missing(request: Request, exc: StorageObjectMissing) -> JSONResponse: + """Объект, на который ссылаются метаданные, отсутствует — 404.""" + log( + logger, + logging.WARNING, + "storage_object_missing", + request_id=request_id_of(request), + error=type(exc).__name__, + ) + return error_response(request, 404, NOT_FOUND, "Объект вложения отсутствует") + + @app.exception_handler(StorageUnavailable) + async def handle_storage_unavailable( + request: Request, exc: StorageUnavailable + ) -> JSONResponse: + """S3 недоступен: 503, детали остаются в логе.""" + log( + logger, + logging.ERROR, + "storage_unavailable", + request_id=request_id_of(request), + error=type(exc).__name__, + ) + return error_response(request, 503, UNAVAILABLE, "Хранилище вложений недоступно") + + @app.exception_handler(DataError) + async def handle_data_error(request: Request, exc: DataError) -> JSONResponse: + """Данные клиента, которые СУБД не в состоянии сохранить, — это 400. + + На границе такие значения уже отсекаются; обработчик оставлен страховкой, + чтобы ошибка данных никогда не выдавалась за отказ зависимости. + """ + log( + logger, + logging.WARNING, + "invalid_stored_value", + request_id=request_id_of(request), + error=type(exc).__name__, + ) + return error_response(request, 400, INVALID_REQUEST, DATA_ERROR_MESSAGE) + + for error_type in DEPENDENCY_ERRORS: + app.add_exception_handler(error_type, handle_dependency_failure) + + @app.exception_handler(Exception) + async def handle_unexpected(request: Request, exc: Exception) -> JSONResponse: + log( + logger, + logging.ERROR, + "unhandled_exception", + exc_info=exc, + request_id=request_id_of(request), + error=type(exc).__name__, + ) + return error_response(request, 500, INTERNAL_ERROR, "Внутренняя ошибка сервера") diff --git a/src/messenger/errors.py b/src/messenger/errors.py new file mode 100644 index 0000000..99fb3f1 --- /dev/null +++ b/src/messenger/errors.py @@ -0,0 +1,98 @@ +"""Ошибки API и единый конверт ответа контракта.""" +from __future__ import annotations + +from typing import Mapping + +INVALID_REQUEST = "invalid_request" +UNAUTHORIZED = "unauthorized" +NOT_FOUND = "not_found" +CONFLICT = "conflict" +PAYLOAD_TOO_LARGE = "payload_too_large" +UNSUPPORTED_MEDIA_TYPE = "unsupported_media_type" +RATE_LIMITED = "rate_limited" +UNAVAILABLE = "unavailable" +INTERNAL_ERROR = "internal_error" + +BASIC_CHALLENGE = 'Basic realm="messenger", charset="UTF-8"' +BEARER_CHALLENGE = 'Bearer realm="messenger"' + +DEFAULT_CODE_BY_STATUS: Mapping[int, str] = { + 400: INVALID_REQUEST, + 401: UNAUTHORIZED, + 403: UNAUTHORIZED, + 404: NOT_FOUND, + 405: INVALID_REQUEST, + 409: CONFLICT, + 413: PAYLOAD_TOO_LARGE, + 415: UNSUPPORTED_MEDIA_TYPE, + 429: RATE_LIMITED, + 500: INTERNAL_ERROR, + 503: UNAVAILABLE, +} + + +class ApiError(Exception): + """Ошибка, которую можно безопасно показать клиенту в конверте контракта.""" + + def __init__( + self, + status: int, + code: str, + message: str, + headers: Mapping[str, str] | None = None, + ) -> None: + super().__init__(message) + self.status = status + self.code = code + self.message = message + self.headers = dict(headers or {}) + + +def code_for_status(status: int) -> str: + """Подбирает код конверта для статуса, пришедшего извне контракта.""" + if status in DEFAULT_CODE_BY_STATUS: + return DEFAULT_CODE_BY_STATUS[status] + return INTERNAL_ERROR if status >= 500 else INVALID_REQUEST + + +def invalid_request(message: str) -> ApiError: + return ApiError(400, INVALID_REQUEST, message) + + +def unauthorized(message: str, challenge: str = BEARER_CHALLENGE) -> ApiError: + """401 с challenge схемы: Basic — только на создании сессии, иначе Bearer.""" + return ApiError(401, UNAUTHORIZED, message, headers={"WWW-Authenticate": challenge}) + + +def not_found(message: str) -> ApiError: + """Чужой объект неотличим от отсутствующего: 403 не используется.""" + return ApiError(404, NOT_FOUND, message) + + +def conflict(message: str) -> ApiError: + return ApiError(409, CONFLICT, message) + + +def rate_limited(message: str, retry_after_seconds: int) -> ApiError: + """429 с обязательным Retry-After: клиент знает, когда можно повторить.""" + return ApiError( + 429, + RATE_LIMITED, + message, + headers={"Retry-After": str(max(1, int(retry_after_seconds)))}, + ) + + +def unavailable(message: str) -> ApiError: + """503: зависимость недоступна, отказ ограничен и не раскрывает внутренностей.""" + return ApiError(503, UNAVAILABLE, message) + + +def payload_too_large(message: str) -> ApiError: + """413: тело или декодированное изображение превышает контрактный предел.""" + return ApiError(413, PAYLOAD_TOO_LARGE, message) + + +def unsupported_media_type(message: str) -> ApiError: + """415: тип не PNG/JPEG или содержимое не совпало с объявленным типом.""" + return ApiError(415, UNSUPPORTED_MEDIA_TYPE, message) diff --git a/src/messenger/healthcheck.py b/src/messenger/healthcheck.py new file mode 100644 index 0000000..d0585bd --- /dev/null +++ b/src/messenger/healthcheck.py @@ -0,0 +1,26 @@ +"""Проверка живости для Docker HEALTHCHECK: python -m messenger.healthcheck.""" +from __future__ import annotations + +import os +import urllib.error +import urllib.request + +DEFAULT_PORT = "8080" +TIMEOUT_SECONDS = 2 + + +def liveness_url() -> str: + port = os.environ.get("APP_PORT", DEFAULT_PORT).strip() or DEFAULT_PORT + return "http://127.0.0.1:%s/health/live" % port + + +def main() -> int: + try: + with urllib.request.urlopen(liveness_url(), timeout=TIMEOUT_SECONDS) as response: + return 0 if response.status == 200 else 1 + except (urllib.error.URLError, OSError, ValueError): + return 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/messenger/idempotency.py b/src/messenger/idempotency.py new file mode 100644 index 0000000..f56cd9c --- /dev/null +++ b/src/messenger/idempotency.py @@ -0,0 +1,42 @@ +"""Идемпотентность POST сообщения: проверка ключа и канонический хэш тела.""" +from __future__ import annotations + +import hashlib +import json +import re +from collections.abc import Sequence +from uuid import UUID + +from .errors import invalid_request + +# Контракт: ASCII [A-Za-z0-9._:-]{1,128}. Полное совпадение, а не поиск. +IDEMPOTENCY_KEY_PATTERN = re.compile(r"^[A-Za-z0-9._:-]{1,128}$") + + +def require_idempotency_key(value: str | None) -> str: + """Возвращает валидный ключ или 400; отсутствие ключа — тоже 400.""" + if value is None or not IDEMPOTENCY_KEY_PATTERN.fullmatch(value): + raise invalid_request( + "Idempotency-Key обязателен и должен соответствовать [A-Za-z0-9._:-]{1,128}" + ) + return value + + +def message_request_hash(text: str, attachment_ids: Sequence[UUID] = ()) -> str: + """Хэш семантически нормализованного тела запроса. + + Порядок ключей JSON и отсутствие необязательных полей не должны менять + результат. Список вложений канонизируется как множество: порядок ссылок в + сообщении не является частью семантики запроса (порядок хранения при этом + сохраняется отдельно, в message_attachments.position). + """ + canonical = json.dumps( + { + "attachment_ids": sorted(str(item) for item in attachment_ids), + "text": text, + }, + ensure_ascii=False, + separators=(",", ":"), + sort_keys=True, + ) + return hashlib.sha256(canonical.encode("utf-8")).hexdigest() diff --git a/src/messenger/images.py b/src/messenger/images.py new file mode 100644 index 0000000..fc7fb2a --- /dev/null +++ b/src/messenger/images.py @@ -0,0 +1,88 @@ +"""Проверка изображения по содержимому, без доверия к Content-Type клиента.""" +from __future__ import annotations + +import struct +import warnings +from dataclasses import dataclass + +from PIL import Image, UnidentifiedImageError + +PNG_SIGNATURE = b"\x89PNG\r\n\x1a\n" +JPEG_SIGNATURE = b"\xff\xd8\xff" + + +class UnsupportedImage(ValueError): + """Не PNG/JPEG или файл повреждён.""" + + +class ImageTooLarge(ValueError): + """Пиксельный предел контракта превышен.""" + + +@dataclass(frozen=True) +class ImageInfo: + content_type: str + width: int + height: int + + +def detect_content_type(head: bytes) -> str | None: + """MIME по первым байтам, а не по заголовку запроса.""" + if head.startswith(PNG_SIGNATURE): + return "image/png" + if head.startswith(JPEG_SIGNATURE): + return "image/jpeg" + return None + + +def inspect_image(path: str, *, expected_content_type: str, max_pixels: int) -> ImageInfo: + """Проверяет сигнатуру, формат, целостность и число пикселей. + + Размеры читаются из заголовка и проверяются до полной распаковки; для + отсечения бомб Pillow получает те же пределы, а предупреждение о бомбе + превращается в `ImageTooLarge`. Полное декодирование в этой лабораторной + не требуется: вариантов изображения нет. + """ + with open(path, "rb") as probe: + head = probe.read(len(PNG_SIGNATURE)) + detected = detect_content_type(head) + if detected is None: + raise UnsupportedImage("Содержимое не является PNG/JPEG") + if detected != expected_content_type: + raise UnsupportedImage("Content-Type не совпадает с содержимым") + + try: + with warnings.catch_warnings(): + warnings.simplefilter("error", Image.DecompressionBombWarning) + with Image.open(path) as image: + width, height = image.size + image_format = image.format + if width <= 0 or height <= 0: + raise UnsupportedImage("Некорректные размеры изображения") + if width * height > max_pixels: + raise ImageTooLarge("Изображение превышает предел пикселей") + if image_format not in ("PNG", "JPEG"): + raise UnsupportedImage("Формат изображения не PNG/JPEG") + image.verify() + except (UnsupportedImage, ImageTooLarge): + raise + except Image.DecompressionBombWarning as exc: + raise ImageTooLarge("Изображение превышает предел пикселей") from exc + except Image.DecompressionBombError as exc: + raise ImageTooLarge("Изображение превышает предел пикселей") from exc + except ( + UnidentifiedImageError, + OSError, + SyntaxError, + ValueError, + struct.error, + IndexError, + OverflowError, + ) as exc: + raise UnsupportedImage("Изображение повреждено") from exc + + if detected == "image/png" and image_format != "PNG": + raise UnsupportedImage("Расширение и формат PNG не совпали") + if detected == "image/jpeg" and image_format != "JPEG": + raise UnsupportedImage("Расширение и формат JPEG не совпали") + return ImageInfo(content_type=detected, width=width, height=height) diff --git a/src/messenger/jobs.py b/src/messenger/jobs.py new file mode 100644 index 0000000..772caeb --- /dev/null +++ b/src/messenger/jobs.py @@ -0,0 +1,1182 @@ +"""Задания обработки, lease, outbox, варианты и операторский replay. + +Модуль содержит SQL/транзакционные границы асинхронного pipeline. API использует +`insert_upload_work` в своей транзакции, а worker/relay/admin — `JobRepository` +с отдельной сессией на операцию. Метаданные PostgreSQL — источник истины; +брокер лишь доставляет ссылки на job. +""" +from __future__ import annotations + +import random +from dataclasses import dataclass +from datetime import datetime +from typing import Sequence +from uuid import UUID, uuid4 + +from sqlalchemy import func, insert, select, text, update +from sqlalchemy.dialects.postgresql import insert as pg_insert +from sqlalchemy.exc import IntegrityError +from sqlalchemy.ext.asyncio import AsyncSession + +from .config import Config +from .db import Database +from .domain import AttachmentRecord, VariantRecord, utc_now +from .pipeline import GeneratedVariant +from .schema import ( + ATTACHMENTS, + JOBS, + JOB_EVENTS, + JOB_REPLAYS, + OUTBOX, + VARIANTS, + FAULT_FLAGS, +) + +TERMINAL_JOB_STATES = ("ready", "failed", "superseded") +JOB_TYPE = "attachment.process.v1" +FAULT_KINDS = ( + "crash_before_objects", + "crash_after_objects", + "transient_once", + "permanent_once", + "stuck_before_commit", + "transient_always", +) + + +class ReplayRejected(RuntimeError): + """Явный replay невозможен: задача не failed или результат уже новее.""" + + +@dataclass(frozen=True) +class JobRecord: + id: UUID + attachment_id: UUID + pipeline_version: int + type: str + state: str + attempts: int + max_attempts: int + lease_token: UUID | None + worker_id: str | None + lease_expires_at: datetime | None + next_attempt_at: datetime | None + last_error_code: str | None + traceparent: str | None + tracestate: str | None + replay_of: UUID | None + created_at: datetime + updated_at: datetime + finished_at: datetime | None + + +@dataclass(frozen=True) +class Claim: + granted: bool + reason: str + job: JobRecord | None = None + attachment: AttachmentRecord | None = None + lease_token: UUID | None = None + + +@dataclass(frozen=True) +class OutboxItem: + outbox_id: int + job: JobRecord + attachment: AttachmentRecord + + +def _interval(seconds: float): + """Интервал PostgreSQL от текущего времени; значение — число из конфигурации.""" + return text(f"INTERVAL '{float(seconds)} seconds'") + + +def _job_record(row) -> JobRecord: + return JobRecord( + id=row.id, + attachment_id=row.attachment_id, + pipeline_version=row.pipeline_version, + type=row.type, + state=row.state, + attempts=row.attempts, + max_attempts=row.max_attempts, + lease_token=row.lease_token, + worker_id=row.worker_id, + lease_expires_at=row.lease_expires_at, + next_attempt_at=row.next_attempt_at, + last_error_code=row.last_error_code, + traceparent=row.traceparent, + tracestate=row.tracestate, + replay_of=row.replay_of, + created_at=row.created_at, + updated_at=row.updated_at, + finished_at=row.finished_at, + ) + + +def _variant_record(row) -> VariantRecord: + return VariantRecord( + attachment_id=row.attachment_id, + pipeline_version=row.pipeline_version, + name=row.name, + content_type=row.content_type, + object_key=row.object_key, + size_bytes=row.size_bytes, + sha256=row.sha256, + width=row.width, + height=row.height, + created_at=row.created_at, + ) + + +def _attachment_record(row, variants: Sequence[VariantRecord] = ()) -> AttachmentRecord: + return AttachmentRecord( + id=row.id, + chat_id=row.chat_id, + owner_id=row.owner_id, + object_key=row.object_key, + staging_key=row.staging_key, + pipeline_version=row.pipeline_version, + filename=row.filename, + content_type=row.content_type, + size_bytes=row.size_bytes, + sha256=row.sha256, + status=row.status, + error_code=row.error_code, + ready_at=row.ready_at, + created_at=row.created_at, + updated_at=row.updated_at, + variants=tuple(variants), + ) + + +async def _variants_of( + session: AsyncSession, attachment_id: UUID, pipeline_version: int +) -> list[VariantRecord]: + if pipeline_version <= 0: + return [] + rows = ( + await session.execute( + select(VARIANTS) + .where( + VARIANTS.c.attachment_id == attachment_id, + VARIANTS.c.pipeline_version == pipeline_version, + ) + .order_by(VARIANTS.c.name) + ) + ).all() + return [_variant_record(row) for row in rows] + + +async def insert_upload_work( + session: AsyncSession, + *, + attachment_id: UUID, + chat_id: UUID, + owner_id: UUID, + staging_key: str, + object_key: str, + filename: str, + content_type: str, + size_bytes: int, + sha256: str, + pipeline_version: int, + max_attempts: int, + traceparent: str | None = None, + tracestate: str | None = None, +) -> None: + """Одна транзакция: queued-вложение + job + outbox-строка. + + Вызывается из upload-запроса до COMMIT. После успешного COMMIT API имеет + право ответить 202: и байты (staging), и намерение обработки устойчивы. + """ + await session.execute( + ATTACHMENTS.insert().values( + id=attachment_id, + chat_id=chat_id, + owner_id=owner_id, + object_key=object_key, + staging_key=staging_key, + pipeline_version=0, + filename=filename, + content_type=content_type, + size_bytes=size_bytes, + sha256=sha256, + status="queued", + ) + ) + job_id = uuid4() + await session.execute( + JOBS.insert().values( + id=job_id, + attachment_id=attachment_id, + pipeline_version=pipeline_version, + type=JOB_TYPE, + state="queued", + attempts=0, + max_attempts=max_attempts, + traceparent=traceparent, + tracestate=tracestate, + ) + ) + await session.execute(OUTBOX.insert().values(job_id=job_id, available_at=func.now())) + await session.execute( + JOB_EVENTS.insert().values( + job_id=job_id, + from_state=None, + to_state="queued", + attempt=0, + detail="upload_accepted", + ) + ) + + +class JobRepository: + """Транзакционные операции над jobs/outbox/variants.""" + + def __init__(self, database: Database, config: Config) -> None: + self._db = database + self._config = config + + # --- чтение ----------------------------------------------------------- + + async def get_job(self, job_id: UUID) -> JobRecord | None: + async with self._db.session() as session: + row = ( + await session.execute(select(JOBS).where(JOBS.c.id == job_id).limit(1)) + ).first() + return None if row is None else _job_record(row) + + async def get_attachment(self, attachment_id: UUID) -> AttachmentRecord | None: + async with self._db.session() as session: + row = ( + await session.execute( + select(ATTACHMENTS).where(ATTACHMENTS.c.id == attachment_id).limit(1) + ) + ).first() + if row is None: + return None + return _attachment_record( + row, await _variants_of(session, attachment_id, row.pipeline_version) + ) + + async def has_other_active_jobs(self, attachment_id: UUID, exclude_job_id: UUID) -> bool: + """Есть ли ещё queued/processing job того же вложения (другая версия/attempt).""" + async with self._db.session() as session: + found = await session.scalar( + select(JOBS.c.id) + .where( + JOBS.c.attachment_id == attachment_id, + JOBS.c.id != exclude_job_id, + JOBS.c.state.in_(("queued", "processing")), + ) + .limit(1) + ) + return found is not None + + async def jobs_for_attachment(self, attachment_id: UUID) -> list[JobRecord]: + async with self._db.session() as session: + rows = ( + await session.execute( + select(JOBS) + .where(JOBS.c.attachment_id == attachment_id) + .order_by(JOBS.c.created_at, JOBS.c.id) + ) + ).all() + return [_job_record(row) for row in rows] + + # --- worker ----------------------------------------------------------- + + async def claim( + self, job_id: UUID, *, worker_id: str, lease_seconds: float + ) -> Claim: + """Захватывает job под lease. Повторная доставка не создаёт второй эффект.""" + async with self._db.session() as session: + async with session.begin(): + row = ( + await session.execute( + select(JOBS).where(JOBS.c.id == job_id).with_for_update() + ) + ).first() + if row is None: + return Claim(False, "missing") + job = _job_record(row) + db_now = await session.scalar(select(func.now())) + if job.state in TERMINAL_JOB_STATES: + return Claim(False, job.state, job=job) + attachment_row = ( + await session.execute( + select(ATTACHMENTS) + .where(ATTACHMENTS.c.id == job.attachment_id) + .with_for_update() + ) + ).first() + if attachment_row is None: + return Claim(False, "missing_attachment", job=job) + attachment = _attachment_record(attachment_row) + if attachment.pipeline_version > job.pipeline_version: + await self._supersede(session, job, "newer_pipeline_ready") + return Claim(False, "superseded", job=job) + if ( + job.state == "processing" + and job.lease_expires_at is not None + and job.lease_expires_at >= db_now + ): + return Claim(False, "busy", job=job) + if job.attempts >= job.max_attempts: + await self._fail_locked( + session, + job, + attachment, + error_code="retry_exhausted", + permanent=True, + detail="attempts_exhausted_on_claim", + ) + return Claim(False, "exhausted", job=job) + attempt = job.attempts + 1 + token = uuid4() + await session.execute( + update(JOBS) + .where(JOBS.c.id == job.id) + .values( + state="processing", + attempts=attempt, + lease_token=token, + worker_id=worker_id, + lease_expires_at=func.now() + _interval(lease_seconds), + next_attempt_at=None, + updated_at=func.now(), + ) + ) + if ( + attachment.pipeline_version <= job.pipeline_version + and attachment.status in ("queued", "processing") + ): + await session.execute( + update(ATTACHMENTS) + .where(ATTACHMENTS.c.id == attachment.id) + .values(status="processing", error_code=None, updated_at=func.now()) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job.id, + from_state=job.state, + to_state="processing", + attempt=attempt, + worker_id=worker_id, + detail="lease_acquired", + ) + ) + claimed = _job_record( + ( + await session.execute( + select(JOBS).where(JOBS.c.id == job.id) + ) + ).first() + ) + return Claim( + True, + "claimed", + job=claimed, + attachment=attachment, + lease_token=token, + ) + + async def extend_lease(self, job_id: UUID, lease_token: UUID, lease_seconds: float) -> bool: + async with self._db.session() as session: + result = await session.execute( + update(JOBS) + .where( + JOBS.c.id == job_id, + JOBS.c.lease_token == lease_token, + JOBS.c.state == "processing", + ) + .values(lease_expires_at=func.now() + _interval(lease_seconds)) + ) + await session.commit() + return bool(result.rowcount) + + async def complete( + self, + *, + job_id: UUID, + lease_token: UUID, + worker_id: str, + original_key: str, + variants: Sequence[GeneratedVariant], + variant_keys: dict[str, str], + ) -> str: + """Атомарно публикует результат. Гард версии не даёт старой job перезаписать новую.""" + async with self._db.session() as session: + async with session.begin(): + row = ( + await session.execute( + select(JOBS).where(JOBS.c.id == job_id).with_for_update() + ) + ).first() + if row is None: + return "missing" + job = _job_record(row) + if job.state != "processing" or job.lease_token != lease_token: + return "lease_lost" + attachment_row = ( + await session.execute( + select(ATTACHMENTS) + .where(ATTACHMENTS.c.id == job.attachment_id) + .with_for_update() + ) + ).first() + if attachment_row is None: + return "missing_attachment" + attachment = _attachment_record(attachment_row) + if attachment.pipeline_version > job.pipeline_version: + await self._supersede(session, job, "newer_pipeline_ready") + return "superseded" + for variant in variants: + object_key = variant_keys.get(variant.name) + if not object_key: + raise ValueError("variant object key is required") + await session.execute( + pg_insert(VARIANTS) + .values( + attachment_id=job.attachment_id, + pipeline_version=job.pipeline_version, + name=variant.name, + content_type=variant.content_type, + object_key=object_key, + size_bytes=variant.size_bytes, + sha256=variant.sha256, + width=variant.width, + height=variant.height, + ) + .on_conflict_do_update( + index_elements=[ + VARIANTS.c.attachment_id, + VARIANTS.c.pipeline_version, + VARIANTS.c.name, + ], + set_={ + "content_type": variant.content_type, + "object_key": object_key, + "size_bytes": variant.size_bytes, + "sha256": variant.sha256, + "width": variant.width, + "height": variant.height, + }, + ) + ) + await session.execute( + update(ATTACHMENTS) + .where(ATTACHMENTS.c.id == job.attachment_id) + .values( + status="ready", + pipeline_version=job.pipeline_version, + object_key=original_key, + ready_at=func.now(), + error_code=None, + updated_at=func.now(), + ) + ) + await session.execute( + update(JOBS) + .where(JOBS.c.id == job.id) + .values( + state="ready", + lease_token=None, + lease_expires_at=None, + next_attempt_at=None, + updated_at=func.now(), + finished_at=func.now(), + ) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job.id, + from_state="processing", + to_state="ready", + attempt=job.attempts, + worker_id=worker_id, + detail="effect_committed", + ) + ) + return "ready" + + async def fail( + self, + *, + job_id: UUID, + lease_token: UUID, + worker_id: str, + error_code: str, + permanent: bool, + ) -> str: + async with self._db.session() as session: + async with session.begin(): + row = ( + await session.execute( + select(JOBS).where(JOBS.c.id == job_id).with_for_update() + ) + ).first() + if row is None: + return "missing" + job = _job_record(row) + if job.state != "processing" or job.lease_token != lease_token: + return "lease_lost" + attachment_row = ( + await session.execute( + select(ATTACHMENTS) + .where(ATTACHMENTS.c.id == job.attachment_id) + .with_for_update() + ) + ).first() + if attachment_row is None: + return "missing_attachment" + attachment = _attachment_record(attachment_row) + if attachment.pipeline_version > job.pipeline_version: + await self._supersede(session, job, "newer_pipeline_ready") + return "superseded" + return await self._fail_locked( + session, + job, + attachment, + error_code=error_code, + permanent=permanent, + worker_id=worker_id, + detail="worker_reported_failure", + ) + + async def _fail_locked( + self, + session: AsyncSession, + job: JobRecord, + attachment: AttachmentRecord, + *, + error_code: str, + permanent: bool, + worker_id: str | None = None, + detail: str, + ) -> str: + terminal = permanent or job.attempts >= job.max_attempts + code = "retry_exhausted" if (not permanent and terminal) else error_code + if terminal: + await session.execute( + update(JOBS) + .where(JOBS.c.id == job.id) + .values( + state="failed", + lease_token=None, + lease_expires_at=None, + last_error_code=code, + updated_at=func.now(), + finished_at=func.now(), + ) + ) + # Готовый результат более новой/этой версии не откатываем. + if attachment.pipeline_version <= job.pipeline_version and attachment.status != "ready": + await session.execute( + update(ATTACHMENTS) + .where(ATTACHMENTS.c.id == attachment.id) + .values(status="failed", error_code=code, updated_at=func.now()) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job.id, + from_state=job.state, + to_state="failed", + attempt=job.attempts, + error_code=code, + worker_id=worker_id, + detail=detail, + ) + ) + return "failed" + + backoff = self._backoff_seconds(job.attempts) + next_at = func.now() + _interval(backoff) + await session.execute( + update(JOBS) + .where(JOBS.c.id == job.id) + .values( + state="queued", + lease_token=None, + lease_expires_at=None, + next_attempt_at=next_at, + last_error_code=code, + updated_at=func.now(), + ) + ) + await session.execute( + pg_insert(OUTBOX) + .values(job_id=job.id, available_at=next_at) + .on_conflict_do_nothing() + ) + if attachment.pipeline_version <= job.pipeline_version: + await session.execute( + update(ATTACHMENTS) + .where(ATTACHMENTS.c.id == attachment.id) + .values(status="queued", error_code=None, updated_at=func.now()) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job.id, + from_state=job.state, + to_state="queued", + attempt=job.attempts, + error_code=code, + worker_id=worker_id, + detail=f"{detail}; retry_in={backoff:.2f}s", + ) + ) + return "retry" + + def _backoff_seconds(self, attempts: int) -> float: + base = self._config.job_backoff_base_seconds + cap = self._config.job_backoff_max_seconds + raw = min(cap, base * (2 ** max(0, attempts - 1))) + # Jitter ±20%: несколько worker-ов не просыпаются одновременно. + return max(0.05, raw * random.uniform(0.8, 1.2)) + + async def _supersede(self, session: AsyncSession, job: JobRecord, detail: str) -> None: + await session.execute( + update(JOBS) + .where(JOBS.c.id == job.id) + .values( + state="superseded", + lease_token=None, + lease_expires_at=None, + updated_at=func.now(), + finished_at=func.now(), + ) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job.id, + from_state=job.state, + to_state="superseded", + attempt=job.attempts, + detail=detail, + ) + ) + + async def reap_expired(self, limit: int = 50) -> int: + """Возвращает в очередь processing с истёкшим lease; считает такие job.""" + async with self._db.session() as session: + ids = ( + await session.execute( + select(JOBS.c.id) + .where( + JOBS.c.state == "processing", + JOBS.c.lease_expires_at.is_not(None), + JOBS.c.lease_expires_at < func.now(), + ) + .order_by(JOBS.c.lease_expires_at) + .limit(limit) + ) + ).scalars().all() + recovered = 0 + for job_id in ids: + async with self._db.session() as session: + async with session.begin(): + row = ( + await session.execute( + select(JOBS).where(JOBS.c.id == job_id).with_for_update() + ) + ).first() + if row is None: + continue + job = _job_record(row) + db_now = await session.scalar(select(func.now())) + if ( + job.state != "processing" + or job.lease_expires_at is None + or job.lease_expires_at >= db_now + ): + continue + attachment_row = ( + await session.execute( + select(ATTACHMENTS) + .where(ATTACHMENTS.c.id == job.attachment_id) + .with_for_update() + ) + ).first() + if attachment_row is None: + continue + attachment = _attachment_record(attachment_row) + if attachment.pipeline_version > job.pipeline_version: + await self._supersede(session, job, "newer_pipeline_ready") + continue + if job.attempts >= job.max_attempts: + await self._fail_locked( + session, + job, + attachment, + error_code="retry_exhausted", + permanent=True, + detail="lease_expired_after_last_attempt", + ) + else: + await session.execute( + update(JOBS) + .where(JOBS.c.id == job.id) + .values( + state="queued", + lease_token=None, + lease_expires_at=None, + next_attempt_at=func.now(), + last_error_code="lease_expired", + updated_at=func.now(), + ) + ) + await session.execute( + pg_insert(OUTBOX) + .values(job_id=job.id, available_at=func.now()) + .on_conflict_do_nothing() + ) + await session.execute( + update(ATTACHMENTS) + .where(ATTACHMENTS.c.id == attachment.id) + .values(status="queued", updated_at=func.now()) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job.id, + from_state="processing", + to_state="queued", + attempt=job.attempts, + error_code="lease_expired", + detail="reaper_requeued", + ) + ) + recovered += 1 + return recovered + + # --- outbox relay ----------------------------------------------------- + + async def outbox_due(self, limit: int = 20) -> list[OutboxItem]: + async with self._db.session() as session: + rows = ( + await session.execute( + select( + OUTBOX.c.id.label("outbox_id"), + JOBS.c.id.label("job_id"), + JOBS.c.attachment_id, + JOBS.c.pipeline_version, + JOBS.c.type, + JOBS.c.state, + JOBS.c.attempts, + JOBS.c.max_attempts, + JOBS.c.lease_token, + JOBS.c.worker_id, + JOBS.c.lease_expires_at, + JOBS.c.next_attempt_at, + JOBS.c.last_error_code, + JOBS.c.traceparent, + JOBS.c.tracestate, + JOBS.c.replay_of, + JOBS.c.created_at, + JOBS.c.updated_at, + JOBS.c.finished_at, + ) + .select_from(OUTBOX.join(JOBS, JOBS.c.id == OUTBOX.c.job_id)) + .where( + OUTBOX.c.published_at.is_(None), + OUTBOX.c.available_at <= func.now(), + ) + .order_by(OUTBOX.c.available_at, OUTBOX.c.id) + .limit(limit) + ) + ).all() + items: list[OutboxItem] = [] + for row in rows: + mapping = row._mapping + job = JobRecord( + id=mapping["job_id"], + attachment_id=mapping["attachment_id"], + pipeline_version=mapping["pipeline_version"], + type=mapping["type"], + state=mapping["state"], + attempts=mapping["attempts"], + max_attempts=mapping["max_attempts"], + lease_token=mapping["lease_token"], + worker_id=mapping["worker_id"], + lease_expires_at=mapping["lease_expires_at"], + next_attempt_at=mapping["next_attempt_at"], + last_error_code=mapping["last_error_code"], + traceparent=mapping["traceparent"], + tracestate=mapping["tracestate"], + replay_of=mapping["replay_of"], + created_at=mapping["created_at"], + updated_at=mapping["updated_at"], + finished_at=mapping["finished_at"], + ) + attachment_row = ( + await session.execute( + select(ATTACHMENTS).where(ATTACHMENTS.c.id == job.attachment_id) + ) + ).first() + if attachment_row is None: + continue + attachment = _attachment_record(attachment_row) + items.append( + OutboxItem( + outbox_id=int(mapping["outbox_id"]), + job=job, + attachment=attachment, + ) + ) + return items + + async def mark_published(self, outbox_id: int) -> None: + async with self._db.session() as session: + await session.execute( + update(OUTBOX) + .where(OUTBOX.c.id == outbox_id, OUTBOX.c.published_at.is_(None)) + .values( + published_at=func.now(), + attempts=OUTBOX.c.attempts + 1, + last_error=None, + ) + ) + await session.commit() + + async def mark_publish_failed(self, outbox_id: int, error: str) -> None: + async with self._db.session() as session: + await session.execute( + update(OUTBOX) + .where(OUTBOX.c.id == outbox_id, OUTBOX.c.published_at.is_(None)) + .values(attempts=OUTBOX.c.attempts + 1, last_error=error[:200]) + ) + await session.commit() + + # --- operator --------------------------------------------------------- + + async def replay( + self, + *, + job_id: UUID | None, + attachment_id: UUID | None, + requested_by: str, + reason: str, + ) -> UUID: + """Явный replay только failed-задачи; создаёт новый job_id и outbox-строку.""" + if not requested_by.strip() or len(requested_by) > 128: + raise ReplayRejected("requested_by must contain 1..128 characters") + if not reason.strip() or len(reason) > 512: + raise ReplayRejected("reason must contain 1..512 characters") + async with self._db.session() as session: + async with session.begin(): + if job_id is not None: + row = ( + await session.execute( + select(JOBS).where(JOBS.c.id == job_id).with_for_update() + ) + ).first() + else: + row = ( + await session.execute( + select(JOBS) + .where( + JOBS.c.attachment_id == attachment_id, + JOBS.c.state == "failed", + ) + .order_by(JOBS.c.created_at.desc()) + .limit(1) + .with_for_update() + ) + ).first() + if row is None: + raise ReplayRejected("failed job not found") + source = _job_record(row) + if source.state != "failed": + raise ReplayRejected("only failed jobs can be replayed") + attachment_row = ( + await session.execute( + select(ATTACHMENTS) + .where(ATTACHMENTS.c.id == source.attachment_id) + .with_for_update() + ) + ).first() + if attachment_row is None: + raise ReplayRejected("attachment not found") + if attachment_row.status == "ready": + # Успешный эффект уже существует: replay не должен создавать дубль. + raise ReplayRejected("attachment already has a ready result") + if attachment_row.pipeline_version > source.pipeline_version: + raise ReplayRejected("a newer pipeline result already exists") + inflight = ( + await session.execute( + select(JOBS.c.id) + .where( + JOBS.c.attachment_id == source.attachment_id, + JOBS.c.state.in_(("queued", "processing")), + ) + .limit(1) + ) + ).first() + if inflight is not None: + raise ReplayRejected("another job is already queued or processing") + new_id = uuid4() + await session.execute( + insert(JOBS).values( + id=new_id, + attachment_id=source.attachment_id, + pipeline_version=source.pipeline_version, + type=JOB_TYPE, + state="queued", + attempts=0, + max_attempts=source.max_attempts, + replay_of=source.id, + ) + ) + await session.execute( + update(ATTACHMENTS) + .where(ATTACHMENTS.c.id == source.attachment_id) + .values(status="queued", error_code=None, updated_at=func.now()) + ) + await session.execute( + insert(OUTBOX).values(job_id=new_id, available_at=func.now()) + ) + await session.execute( + insert(JOB_REPLAYS).values( + id=uuid4(), + source_job_id=source.id, + replay_job_id=new_id, + requested_by=requested_by.strip(), + reason=reason.strip(), + ) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=new_id, + from_state=None, + to_state="queued", + attempt=0, + detail=f"operator_replay_of={source.id}", + ) + ) + return new_id + + async def force_enqueue(self, attachment_id: UUID, pipeline_version: int) -> UUID: + """Тестовый/операторский enqueue конкретной версии (для fault-трека).""" + async with self._db.session() as session: + async with session.begin(): + attachment_row = ( + await session.execute( + select(ATTACHMENTS) + .where(ATTACHMENTS.c.id == attachment_id) + .with_for_update() + ) + ).first() + if attachment_row is None: + raise ReplayRejected("attachment not found") + job_id = uuid4() + try: + await session.execute( + insert(JOBS).values( + id=job_id, + attachment_id=attachment_id, + pipeline_version=pipeline_version, + type=JOB_TYPE, + state="queued", + attempts=0, + max_attempts=self._config.job_max_attempts, + ) + ) + except IntegrityError: + raise ReplayRejected("initial job for this version already exists") from None + await session.execute( + insert(OUTBOX).values(job_id=job_id, available_at=func.now()) + ) + await session.execute( + insert(JOB_EVENTS).values( + job_id=job_id, + from_state=None, + to_state="queued", + attempt=0, + detail="operator_force_enqueue", + ) + ) + return job_id + + async def set_fault(self, kind: str, count: int) -> None: + if kind not in FAULT_KINDS: + raise ValueError("unknown fault kind") + if count < 0: + raise ValueError("count must be >= 0") + async with self._db.session() as session: + await session.execute( + pg_insert(FAULT_FLAGS) + .values(kind=kind, remaining=count, updated_at=func.now()) + .on_conflict_do_update( + index_elements=[FAULT_FLAGS.c.kind], + set_={"remaining": count, "updated_at": func.now()}, + ) + ) + await session.commit() + + async def consume_fault(self) -> str | None: + if not self._config.allow_fault_injection: + return None + async with self._db.session() as session: + async with session.begin(): + row = ( + await session.execute( + select(FAULT_FLAGS) + .where( + FAULT_FLAGS.c.kind.in_(FAULT_KINDS), + FAULT_FLAGS.c.remaining > 0, + ) + .order_by(FAULT_FLAGS.c.kind) + .limit(1) + .with_for_update(skip_locked=True) + ) + ).first() + if row is None: + return None + await session.execute( + update(FAULT_FLAGS) + .where(FAULT_FLAGS.c.kind == row.kind) + .values(remaining=FAULT_FLAGS.c.remaining - 1, updated_at=func.now()) + ) + return row.kind + + async def report(self, attachment_id: UUID) -> dict: + """Снимок состояния для evidence и оператора (без секретов).""" + attachment = await self.get_attachment(attachment_id) + jobs = await self.jobs_for_attachment(attachment_id) + async with self._db.session() as session: + outbox_rows = ( + await session.execute( + select(OUTBOX) + .where(OUTBOX.c.job_id.in_([job.id for job in jobs])) + .order_by(OUTBOX.c.id) + ) + ).all() + event_rows = ( + await session.execute( + select(JOB_EVENTS) + .where(JOB_EVENTS.c.job_id.in_([job.id for job in jobs])) + .order_by(JOB_EVENTS.c.id) + ) + ).all() + + def moment(value): + return None if value is None else value.isoformat().replace("+00:00", "Z") + + return { + "attachment": None + if attachment is None + else { + "id": str(attachment.id), + "status": attachment.status, + "error_code": attachment.error_code, + "pipeline_version": attachment.pipeline_version, + "object_key": attachment.object_key, + "staging_key": attachment.staging_key, + "size_bytes": attachment.size_bytes, + "sha256": attachment.sha256, + "ready_at": moment(attachment.ready_at), + "updated_at": moment(attachment.updated_at), + "variants": [ + { + "name": item.name, + "pipeline_version": item.pipeline_version, + "content_type": item.content_type, + "object_key": item.object_key, + "size_bytes": item.size_bytes, + "sha256": item.sha256, + "width": item.width, + "height": item.height, + } + for item in attachment.variants + ], + }, + "jobs": [ + { + "id": str(job.id), + "pipeline_version": job.pipeline_version, + "state": job.state, + "attempts": job.attempts, + "max_attempts": job.max_attempts, + "lease_token": str(job.lease_token) if job.lease_token else None, + "worker_id": job.worker_id, + "last_error_code": job.last_error_code, + "replay_of": str(job.replay_of) if job.replay_of else None, + "created_at": moment(job.created_at), + "updated_at": moment(job.updated_at), + "finished_at": moment(job.finished_at), + } + for job in jobs + ], + "outbox": [ + { + "id": row.id, + "job_id": str(row.job_id), + "available_at": moment(row.available_at), + "published_at": moment(row.published_at), + "attempts": row.attempts, + "last_error": row.last_error, + } + for row in outbox_rows + ], + "events": [ + { + "job_id": str(row.job_id), + "from_state": row.from_state, + "to_state": row.to_state, + "attempt": row.attempt, + "error_code": row.error_code, + "worker_id": row.worker_id, + "detail": row.detail, + "created_at": moment(row.created_at), + } + for row in event_rows + ], + } + + async def queue_metrics(self) -> dict: + """Числа для OTel gauges: queued/processing и возраст старейшей задачи.""" + async with self._db.session() as session: + rows = ( + await session.execute( + select(JOBS.c.state, func.count()).group_by(JOBS.c.state) + ) + ).all() + counts = {row[0]: int(row[1]) for row in rows} + oldest = await session.scalar( + select(func.min(JOBS.c.created_at)).where(JOBS.c.state == "queued") + ) + age = await session.scalar( + select(func.extract("epoch", func.now() - func.min(JOBS.c.created_at))).where( + JOBS.c.state == "queued" + ) + ) + return { + "queued": counts.get("queued", 0), + "processing": counts.get("processing", 0), + "oldest_queued_seconds": float(age) if age is not None else 0.0, + "oldest_queued_at": None + if oldest is None + else oldest.isoformat().replace("+00:00", "Z"), + } + + async def queue_stats(self) -> dict: + async with self._db.session() as session: + job_rows = ( + await session.execute( + select(JOBS.c.state, func.count()).group_by(JOBS.c.state) + ) + ).all() + outbox_pending = await session.scalar( + select(func.count()).select_from(OUTBOX).where(OUTBOX.c.published_at.is_(None)) + ) + oldest = await session.scalar( + select(func.min(JOBS.c.created_at)).where(JOBS.c.state == "queued") + ) + return { + "jobs_by_state": {row[0]: int(row[1]) for row in job_rows}, + "outbox_pending": int(outbox_pending or 0), + "oldest_queued_at": None + if oldest is None + else oldest.isoformat().replace("+00:00", "Z"), + } \ No newline at end of file diff --git a/src/messenger/logging_setup.py b/src/messenger/logging_setup.py new file mode 100644 index 0000000..08475ba --- /dev/null +++ b/src/messenger/logging_setup.py @@ -0,0 +1,100 @@ +"""Структурные логи в stdout: одна JSON-строка на событие, без тел и query-строки.""" +from __future__ import annotations + +import json +import logging +import os +import sys +from datetime import datetime, timezone + +from opentelemetry import trace + +from . import __version__ + +SERVICE_NAME = os.environ.get("OTEL_SERVICE_NAME", "messenger-api") +SERVICE_VERSION = __version__ +SERVICE_INSTANCE_ID = os.environ.get("INSTANCE_ID") or os.environ.get("HOSTNAME") or "" +ENVIRONMENT = "lab" +for _pair in os.environ.get("OTEL_RESOURCE_ATTRIBUTES", "").split(","): + _key, _, _value = _pair.partition("=") + if _key.strip() == "deployment.environment.name" and _value.strip(): + ENVIRONMENT = _value.strip() + + +class JsonFormatter(logging.Formatter): + """Сериализует запись лога в компактный JSON без потери структуры.""" + + def format(self, record: logging.LogRecord) -> str: + payload: dict[str, object] = { + "ts": datetime.fromtimestamp(record.created, timezone.utc) + .isoformat(timespec="milliseconds") + .replace("+00:00", "Z"), + "level": record.levelname.lower(), + "logger": record.name, + "event": record.getMessage(), + } + payload.update(getattr(record, "fields", {}) or {}) + payload.setdefault("service.name", SERVICE_NAME) + payload.setdefault("service.version", SERVICE_VERSION) + payload.setdefault("deployment.environment.name", ENVIRONMENT) + if SERVICE_INSTANCE_ID: + payload.setdefault("service.instance.id", SERVICE_INSTANCE_ID) + span = trace.get_current_span() + context = span.get_span_context() + if context.is_valid: + payload.setdefault("trace_id", format(context.trace_id, "032x")) + payload.setdefault("span_id", format(context.span_id, "016x")) + if record.exc_info: + payload["exception"] = self.formatException(record.exc_info) + return json.dumps(payload, ensure_ascii=False, separators=(",", ":")) + + +class _EnvironmentFilter(logging.Filter): + """Добавляет метку окружения в каждую запись, включая логи uvicorn.""" + + def __init__(self, env: str) -> None: + super().__init__() + self._env = env + + def filter(self, record: logging.LogRecord) -> bool: + fields = dict(getattr(record, "fields", {}) or {}) + fields.setdefault("env", self._env) + record.fields = fields + return True + + +def configure_logging(level: str, env: str) -> logging.Logger: + """Перенаправляет логи процесса в stdout в структурированном виде.""" + handler = logging.StreamHandler(sys.stdout) + handler.setFormatter(JsonFormatter()) + handler.addFilter(_EnvironmentFilter(env)) + + root = logging.getLogger() + root.handlers[:] = [handler] + root.setLevel(level.upper()) + + for name in ("uvicorn", "uvicorn.error", "uvicorn.access"): + logger = logging.getLogger(name) + logger.handlers[:] = [] + logger.propagate = True + logging.getLogger("uvicorn.access").setLevel(logging.WARNING) + + return logging.getLogger("messenger") + + +def log( + logger: logging.Logger, + level: int, + event: str, + exc_info: BaseException | None = None, + **fields: object, +) -> None: + """Пишет событие с произвольными структурированными полями.""" + if not logger.isEnabledFor(level): + return + logger.log( + level, + event, + extra={"fields": {k: v for k, v in fields.items() if v is not None}}, + exc_info=exc_info, + ) \ No newline at end of file diff --git a/src/messenger/login_guard.py b/src/messenger/login_guard.py new file mode 100644 index 0000000..9a6e273 --- /dev/null +++ b/src/messenger/login_guard.py @@ -0,0 +1,127 @@ +"""Защита входа: общий для реплик лимит попыток и бюджет KDF. + +Лимит хранится в PostgreSQL, поэтому две API-реплики не имеют независимых +счётчиков: серия попыток через балансировщик видна целиком. Ключ bucket — +SHA-256 нормализованного username, а не сам username: таблица не превращается +в список логинов. Одновременные KDF в одном процессе ограничены семафором, +чтобы дорогой Argon2id не выедал CPU при всплеске попыток. +""" +from __future__ import annotations + +import asyncio +import hashlib +from contextlib import asynccontextmanager +from datetime import datetime, timedelta, timezone + +from sqlalchemy import delete, select +from sqlalchemy.dialects.postgresql import insert as pg_insert + +from .db import Database +from .schema import LOGIN_RATE_LIMITS + +BUCKET_PREFIX = "login:" + + +def bucket_for(username: str) -> str: + """Детерминированный ключ без PII: одинаковый для всех реплик.""" + digest = hashlib.sha256(username.strip().lower().encode("utf-8")).hexdigest() + return BUCKET_PREFIX + digest + + +class LoginGuard: + """Атомарный счётчик попыток + ограничение параллельных KDF.""" + + def __init__( + self, + database: Database, + *, + max_attempts: int, + window_seconds: int, + block_seconds: int, + max_concurrency: int, + ) -> None: + self._database = database + self._max_attempts = max_attempts + self._window_seconds = window_seconds + self._block_seconds = block_seconds + self._semaphore = asyncio.Semaphore(max_concurrency) + + @asynccontextmanager + async def kdf_slot(self): + """Ограничивает число одновременных Argon2id в процессе.""" + async with self._semaphore: + yield + + async def reserve(self, username: str) -> int | None: + """Регистрирует попытку. Возвращает Retry-After, если вход заблокирован.""" + bucket = bucket_for(username) + async with self._database.session() as session: + # Создаём строку без гонки; второй INSERT при параллельном запросе + # ничего не меняет, после чего SELECT ... FOR UPDATE сериализует + # обновление счётчика между репликами. + await session.execute( + pg_insert(LOGIN_RATE_LIMITS) + .values(bucket=bucket, window_start=datetime.now(timezone.utc), attempts=0) + .on_conflict_do_nothing(index_elements=[LOGIN_RATE_LIMITS.c.bucket]) + ) + row = ( + await session.execute( + select( + LOGIN_RATE_LIMITS.c.window_start, + LOGIN_RATE_LIMITS.c.attempts, + LOGIN_RATE_LIMITS.c.blocked_until, + ) + .where(LOGIN_RATE_LIMITS.c.bucket == bucket) + .with_for_update() + ) + ).first() + if row is None: + raise RuntimeError("login rate-limit row disappeared") + now = datetime.now(timezone.utc) + # Окно истекло — счётчик начинается заново. + if (now - row.window_start).total_seconds() >= self._window_seconds: + attempts = 0 + window_start = now + blocked_until = None + else: + attempts = int(row.attempts) + window_start = row.window_start + blocked_until = row.blocked_until + if blocked_until is not None and blocked_until > now: + retry_after = max(1, int((blocked_until - now).total_seconds() + 0.999)) + await session.execute( + LOGIN_RATE_LIMITS.update() + .where(LOGIN_RATE_LIMITS.c.bucket == bucket) + .values(attempts=attempts + 1) + ) + await session.commit() + return retry_after + attempts += 1 + blocked_until = ( + now + timedelta(seconds=self._block_seconds) + if attempts > self._max_attempts + else None + ) + await session.execute( + LOGIN_RATE_LIMITS.update() + .where(LOGIN_RATE_LIMITS.c.bucket == bucket) + .values( + window_start=window_start, + attempts=attempts, + blocked_until=blocked_until, + ) + ) + await session.commit() + if blocked_until is not None: + return self._block_seconds + return None + + async def reset(self, username: str) -> None: + """Успешный вход сбрасывает счётчик, но не отменяет активную блокировку.""" + async with self._database.session() as session: + await session.execute( + delete(LOGIN_RATE_LIMITS).where( + LOGIN_RATE_LIMITS.c.bucket == bucket_for(username) + ) + ) + await session.commit() diff --git a/src/messenger/middleware.py b/src/messenger/middleware.py new file mode 100644 index 0000000..8a95e62 --- /dev/null +++ b/src/messenger/middleware.py @@ -0,0 +1,168 @@ +"""Внешний ASGI-слой: X-Request-Id, X-Instance-Id (в том числе на 500) и access-лог.""" +from __future__ import annotations + +import logging +import re +import time +import uuid +from typing import Any, Awaitable, Callable, MutableMapping + +from opentelemetry.context import Context +from opentelemetry.trace import SpanKind, Status, StatusCode + +from . import telemetry +from .context import REQUEST_ID, USER_ID, context_of +from .logging_setup import log + +SAFE_REQUEST_ID = re.compile(r"^[A-Za-z0-9._:-]{1,128}$") + +Scope = MutableMapping[str, Any] +Message = MutableMapping[str, Any] +Receive = Callable[[], Awaitable[Message]] +Send = Callable[[Message], Awaitable[None]] +ASGIApp = Callable[[Scope, Receive, Send], Awaitable[None]] + + +def incoming_request_id(scope: Scope) -> str | None: + """Возвращает заголовок клиента, если он безопасен для логирования и ответа.""" + for name, value in scope.get("headers") or (): + if name.lower() != b"x-request-id": + continue + try: + candidate = value.decode("ascii") + except UnicodeDecodeError: + return None + return candidate if SAFE_REQUEST_ID.match(candidate) else None + return None + + +def incoming_trace_context(scope: Scope) -> dict[str, str]: + """W3C traceparent/tracestate из входящих заголовков; значения не логируются.""" + carrier: dict[str, str] = {} + for name, value in scope.get("headers") or (): + lowered = name.lower() + if lowered == b"traceparent": + try: + carrier["traceparent"] = value.decode("ascii") + except UnicodeDecodeError: + pass + elif lowered == b"tracestate": + try: + carrier["tracestate"] = value.decode("ascii") + except UnicodeDecodeError: + pass + return carrier + + +def set_response_header(message: Message, name: bytes, value: bytes) -> None: + """Идемпотентно выставляет заголовок в ASGI-сообщении ответа.""" + headers = message.setdefault("headers", []) + lowered = name.lower() + for index, (key, _) in enumerate(headers): + if key.lower() == lowered: + headers[index] = (name, value) + return + headers.append((name, value)) + + +class RequestContextMiddleware: + """Присваивает запросу идентификатор, гарантирует заголовок и пишет access-лог.""" + + def __init__(self, app: ASGIApp, logger: logging.Logger, instance_id: str) -> None: + if not instance_id: + raise ValueError("instance_id must not be empty") + self._app = app + self._logger = logger + self._instance_id = instance_id + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] != "http": + await self._app(scope, receive, send) + return + + request_id = incoming_request_id(scope) or uuid.uuid4().hex + context = context_of(scope) + context[REQUEST_ID] = request_id + method = str(scope.get("method", "GET")) + path = str(scope.get("path", "/")) + trace_context = incoming_trace_context(scope) + incoming_traceparent = trace_context.get("traceparent") or "" + incoming_trace_id = ( + incoming_traceparent.split("-")[1] + if incoming_traceparent.count("-") == 3 + else None + ) + # Без входящего traceparent серверный span обязан быть корнем нового + # trace, а не продолжателем случайного contextvar-а. + parent = telemetry.context_from_trace( + trace_context.get("traceparent"), trace_context.get("tracestate") + ) or Context() + started = time.perf_counter() + status_holder: dict[str, int] = {} + instance_id = self._instance_id.encode("ascii") + + async def send_with_request_id(message: Message) -> None: + if message["type"] == "http.response.start": + status_holder["status"] = int(message["status"]) + set_response_header(message, b"x-request-id", request_id.encode("ascii")) + # Значение стабильно на жизнь процесса; LB не переписывает его. + set_response_header(message, b"x-instance-id", instance_id) + await send(message) + + with telemetry.start_span( + f"{method} {path}", + kind=SpanKind.SERVER, + context=parent, + attributes={ + "http.request.method": method, + # raw path/URL и UUID не пишем: только шаблон маршрута и request id. + "http.request_id": request_id, + }, + ) as span: + try: + await self._app(scope, receive, send_with_request_id) + finally: + status = status_holder.get("status", 500) + route = getattr(scope.get("route"), "path", None) or "unmatched" + span.update_name(f"{method} {route}") + span.set_attribute("http.route", route) + span.set_attribute("http.response.status_code", status) + span.set_attribute("http.response.status_class", f"{status // 100}xx") + if status >= 500: + span.set_status(Status(StatusCode.ERROR)) + telemetry.record_http_request( + method=method, + route=route, + status=status, + duration_seconds=time.perf_counter() - started, + ) + self._write_access_log( + scope, status_holder.get("status"), started, incoming_trace_id + ) + + def _write_access_log( + self, + scope: Scope, + status: int | None, + started: float, + incoming_trace_id: str | None = None, + ) -> None: + context = context_of(scope) + # Логируется шаблон маршрута, а не сырой путь: query-строка в лог не попадает. + route = getattr(scope.get("route"), "path", None) + endpoint = scope.get("endpoint") + log( + self._logger, + logging.INFO, + "request", + request_id=context.get(REQUEST_ID), + method=scope.get("method"), + route=route, + operation=None if endpoint is None else getattr(endpoint, "__name__", None), + matched=route is not None, + status=status, + duration_ms=round((time.perf_counter() - started) * 1000, 3), + user_id=context.get(USER_ID), + instance_id=self._instance_id, + incoming_trace_id=incoming_trace_id, + ) \ No newline at end of file diff --git a/src/messenger/models.py b/src/messenger/models.py new file mode 100644 index 0000000..36ba3c5 --- /dev/null +++ b/src/messenger/models.py @@ -0,0 +1,283 @@ +"""Схемы запросов и ответов ровно по contracts/openapi.json.""" +from __future__ import annotations + +from typing import Literal +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator + +from .domain import AttachmentRecord, ChatRecord, MessageRecord, UserRecord, VariantRecord, rfc3339_z +from .sessions import IssuedSession + +USERNAME_PATTERN = r"^[a-z0-9_]{3,32}$" +MIN_PASSWORD = 12 +MAX_PASSWORD = 128 +MAX_DISPLAY_NAME = 100 +MAX_TITLE = 100 +MAX_TEXT = 4000 +MAX_MEMBERS = 100 +MAX_ATTACHMENTS = 10 +MAX_LIMIT = 100 +DEFAULT_LIMIT = 50 + +ATTACHMENT_CONTENT_TYPES = ("image/png", "image/jpeg") +SHA256_PATTERN = r"^[a-f0-9]{64}$" + + +def _require_content(value: str, *, field: str) -> str: + """Обязательная строка не может быть пустой или состоять из пробельных символов.""" + if not value.strip(): + raise ValueError(f"{field} must not be empty or contain only whitespace") + return value + + +def _visible(value: str, *, field: str, maximum: int) -> str: + """Проверяет строку, которую предстоит сохранить в PostgreSQL.""" + _require_content(value, field=field) + if "\u0000" in value: + raise ValueError(f"{field} must not contain U+0000") + if len(value) > maximum: + raise ValueError(f"{field} must be at most {maximum} Unicode code points") + return value + + +class Health(BaseModel): + """Тело ответа /health/live и /health/ready.""" + + model_config = ConfigDict(extra="forbid") + + status: Literal["ok"] = "ok" + + +class User(BaseModel): + """Публичное представление пользователя: ни пароля, ни сессий здесь нет.""" + + model_config = ConfigDict(extra="forbid") + + id: UUID + username: str + display_name: str + created_at: str + + @classmethod + def from_record(cls, record: UserRecord) -> "User": + return cls( + id=record.id, + username=record.username, + display_name=record.display_name, + created_at=rfc3339_z(record.created_at), + ) + + +class CreateUser(BaseModel): + """Регистрация: пароль приходит открытым текстом и дальше живёт только как хэш.""" + + model_config = ConfigDict(extra="forbid") + + username: str = Field(pattern=USERNAME_PATTERN) + display_name: str + password: str = Field(min_length=MIN_PASSWORD, max_length=MAX_PASSWORD) + + @field_validator("display_name") + @classmethod + def _check_display_name(cls, value: str) -> str: + return _visible(value, field="display_name", maximum=MAX_DISPLAY_NAME) + + @field_validator("password") + @classmethod + def _check_password(cls, value: str) -> str: + return _require_content(value, field="password") + + +class Session(BaseModel): + """Выданная сессия: токен показывается клиенту один раз и в логи не попадает.""" + + model_config = ConfigDict(extra="forbid") + + token: str + token_type: Literal["Bearer"] = "Bearer" + expires_at: str + user: User + + @classmethod + def from_issued(cls, issued: IssuedSession, user: UserRecord) -> "Session": + return cls( + token=issued.token, + expires_at=rfc3339_z(issued.state.expires_at), + user=User.from_record(user), + ) + + +class Chat(BaseModel): + model_config = ConfigDict(extra="forbid") + + id: UUID + title: str + member_ids: list[UUID] + created_at: str + + @classmethod + def from_record(cls, record: ChatRecord) -> "Chat": + return cls( + id=record.id, + title=record.title, + member_ids=list(record.member_ids), + created_at=rfc3339_z(record.created_at), + ) + + +class CreateChat(BaseModel): + model_config = ConfigDict(extra="forbid") + + title: str + member_ids: list[UUID] + + @field_validator("title") + @classmethod + def _check_title(cls, value: str) -> str: + return _visible(value, field="title", maximum=MAX_TITLE) + + @field_validator("member_ids") + @classmethod + def _check_member_ids(cls, value: list[UUID]) -> list[UUID]: + if not 1 <= len(value) <= MAX_MEMBERS: + raise ValueError(f"member_ids must contain 1..{MAX_MEMBERS} items") + if len(set(value)) != len(value): + raise ValueError("member_ids must not contain duplicates") + return value + + +class Message(BaseModel): + model_config = ConfigDict(extra="forbid") + + id: UUID + chat_id: UUID + sender_id: UUID + text: str + created_at: str + attachment_ids: list[UUID] + + @classmethod + def from_record(cls, record: MessageRecord) -> "Message": + return cls( + id=record.id, + chat_id=record.chat_id, + sender_id=record.sender_id, + text=record.text, + created_at=rfc3339_z(record.created_at), + attachment_ids=list(record.attachment_ids), + ) + + +class CreateMessage(BaseModel): + """Поле sender_id не принимается: отправитель выводится из идентификации. + + Текст может быть пустым только при наличии хотя бы одного вложения. + """ + + model_config = ConfigDict(extra="forbid") + + text: str = Field(max_length=MAX_TEXT) + attachment_ids: list[UUID] = Field(default_factory=list, max_length=MAX_ATTACHMENTS) + + @field_validator("text") + @classmethod + def _check_text(cls, value: str) -> str: + if "\u0000" in value: + raise ValueError("text must not contain U+0000") + if len(value) > MAX_TEXT: + raise ValueError(f"text must be at most {MAX_TEXT} Unicode code points") + return value + + @field_validator("attachment_ids") + @classmethod + def _check_attachment_ids(cls, value: list[UUID]) -> list[UUID]: + if len(set(value)) != len(value): + raise ValueError("attachment_ids must not contain duplicates") + return value + + @model_validator(mode="after") + def _check_content(self) -> "CreateMessage": + if not self.text.strip() and not self.attachment_ids: + raise ValueError("text must not be empty or contain only whitespace without attachments") + return self + + +class ChatPage(BaseModel): + model_config = ConfigDict(extra="forbid") + + items: list[Chat] + next_cursor: str | None + + @classmethod + def from_records(cls, records: list[ChatRecord], next_cursor: str | None) -> "ChatPage": + return cls(items=[Chat.from_record(record) for record in records], next_cursor=next_cursor) + + +class MessagePage(BaseModel): + model_config = ConfigDict(extra="forbid") + + items: list[Message] + next_cursor: str | None + + @classmethod + def from_records(cls, records: list[MessageRecord], next_cursor: str | None) -> "MessagePage": + return cls(items=[Message.from_record(record) for record in records], next_cursor=next_cursor) + + +class Variant(BaseModel): + """Опубликованный вариант изображения ровно по contracts/openapi.json.""" + + model_config = ConfigDict(extra="forbid") + + name: Literal["thumbnail", "crop", "optimized"] + content_type: Literal["image/jpeg", "image/png", "image/webp"] + size_bytes: int = Field(gt=0) + width: int = Field(gt=0) + height: int = Field(gt=0) + sha256: str = Field(pattern=SHA256_PATTERN) + + @classmethod + def from_record(cls, record: VariantRecord) -> "Variant": + return cls( + name=record.name, + content_type=record.content_type, + size_bytes=record.size_bytes, + width=record.width, + height=record.height, + sha256=record.sha256, + ) + + +class Attachment(BaseModel): + model_config = ConfigDict(extra="forbid") + + id: UUID + chat_id: UUID + owner_id: UUID + filename: str = Field(min_length=1, max_length=255) + content_type: Literal["image/png", "image/jpeg"] + size_bytes: int = Field(gt=0, le=10485760) + sha256: str = Field(pattern=SHA256_PATTERN) + status: Literal["queued", "processing", "ready", "failed"] + variants: list[Variant] = Field(default_factory=list) + error_code: str | None = None + created_at: str + updated_at: str + + @classmethod + def from_record(cls, record: AttachmentRecord) -> "Attachment": + return cls( + id=record.id, + chat_id=record.chat_id, + owner_id=record.owner_id, + filename=record.filename, + content_type=record.content_type, + size_bytes=record.size_bytes, + sha256=record.sha256, + status=record.status, + variants=[Variant.from_record(item) for item in record.variants], + error_code=record.error_code, + created_at=rfc3339_z(record.created_at), + updated_at=rfc3339_z(record.updated_at), + ) diff --git a/src/messenger/mtls_gateway.py b/src/messenger/mtls_gateway.py new file mode 100644 index 0000000..93ef40c --- /dev/null +++ b/src/messenger/mtls_gateway.py @@ -0,0 +1,302 @@ +"""mTLS-шлюз: проверяет цепочку клиента и разрешённую SAN-identity. + +Один процесс обслуживает несколько listener-ов (например, LB→API, +producer→broker, worker→broker, API/worker→Collector). Для каждого listener +задан явный allowlist SAN; сертификат, подписанный тем же CA, но с другой +identity, получает 403/close, а не доступ. Backend-соединение может быть +локальным plaintext (закрытый loopback внутри контейнера) либо TLS с +проверкой сервера и собственным клиентским сертификатом. + +Это не «TLS proxy без проверки identity»: без client certificate handshake +не завершается, а проверка SAN выполняется до открытия backend-соединения. +""" +from __future__ import annotations + +import argparse +import asyncio +import json +import logging +import signal +import ssl +import sys +from dataclasses import dataclass +from pathlib import Path + +logger = logging.getLogger("messenger.mtls_gateway") + +FORBIDDEN_RESPONSE = ( + b"HTTP/1.1 403 Forbidden\r\n" + b"Content-Length: 0\r\n" + b"Connection: close\r\n\r\n" +) + + +@dataclass(frozen=True) +class Listener: + bind_host: str + bind_port: int + allow_san: tuple[str, ...] + backend_host: str + backend_port: int + backend_tls: bool + reject_mode: str = "http" + require_client_cert: bool = True + alpn: tuple[str, ...] = () + + +@dataclass(frozen=True) +class GatewayConfig: + cert_file: str + key_file: str + ca_file: str | None + revoked_serials_file: str | None + backend_ca_file: str | None + backend_cert_file: str | None + backend_key_file: str | None + backend_server_name: str | None + listeners: tuple[Listener, ...] + + +def load_config(path: str) -> GatewayConfig: + raw = json.loads(Path(path).read_text(encoding="utf-8")) + listeners = tuple( + Listener( + bind_host=str(item.get("bind_host", "0.0.0.0")), + bind_port=int(item["bind_port"]), + allow_san=tuple(str(value) for value in item["allow_san"]), + backend_host=str(item.get("backend_host", "127.0.0.1")), + backend_port=int(item["backend_port"]), + backend_tls=bool(item.get("backend_tls", False)), + reject_mode=str(item.get("reject_mode", "http")), + require_client_cert=bool(item.get("require_client_cert", True)), + alpn=tuple(str(value) for value in item.get("alpn", [])), + ) + for item in raw["listeners"] + ) + return GatewayConfig( + cert_file=raw["cert_file"], + key_file=raw["key_file"], + ca_file=raw.get("ca_file"), + revoked_serials_file=raw.get("revoked_serials_file"), + backend_ca_file=raw.get("backend_ca_file"), + backend_cert_file=raw.get("backend_cert_file"), + backend_key_file=raw.get("backend_key_file"), + backend_server_name=raw.get("backend_server_name"), + listeners=listeners, + ) + + +def server_context(config: GatewayConfig, listener: Listener) -> ssl.SSLContext: + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.minimum_version = ssl.TLSVersion.TLSv1_2 + context.load_cert_chain(config.cert_file, config.key_file) + if listener.require_client_cert: + if not config.ca_file: + raise ValueError("ca_file is required when client certificates are required") + context.load_verify_locations(config.ca_file) + context.verify_mode = ssl.CERT_REQUIRED + else: + context.verify_mode = ssl.CERT_NONE + if listener.alpn: + context.set_alpn_protocols(list(listener.alpn)) + return context + + +def backend_context(config: GatewayConfig) -> ssl.SSLContext | None: + if not config.backend_ca_file: + return None + context = ssl.create_default_context(cafile=config.backend_ca_file) + context.check_hostname = True + context.verify_mode = ssl.CERT_REQUIRED + if config.backend_cert_file: + context.load_cert_chain(config.backend_cert_file, config.backend_key_file) + return context + + +def revoked_serials(config: GatewayConfig) -> set[str]: + """Локальный revocation list: serial-номера отозванных leaf-сертификатов.""" + if not config.revoked_serials_file: + return set() + try: + lines = Path(config.revoked_serials_file).read_text(encoding="utf-8").splitlines() + except OSError: + return set() + return {line.strip().lower() for line in lines if line.strip() and not line.startswith("#")} + + +def identity_of(cert: dict) -> set[str]: + """SAN-идентичности сертификата; CN намеренно не используется как fallback.""" + names: set[str] = set() + for kind, value in cert.get("subjectAltName", ()): + if kind in ("DNS", "URI", "email"): + names.add(str(value)) + return names + + +def allowed(cert: dict, allow_san: tuple[str, ...]) -> bool: + names = identity_of(cert) + return any(name in names for name in allow_san) + + +async def _pipe(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: + try: + while True: + chunk = await reader.read(64 * 1024) + if not chunk: + break + writer.write(chunk) + await writer.drain() + except (ConnectionError, asyncio.IncompleteReadError, OSError): + pass + finally: + try: + writer.close() + except OSError: + pass + + +async def _reject(writer: asyncio.StreamWriter, mode: str, identity: set[str], listener: Listener) -> None: + logger.warning( + "mtls_identity_rejected", + extra={ + "fields": { + "listener": f"{listener.bind_host}:{listener.bind_port}", + "identity": sorted(identity), + "allow_san": list(listener.allow_san), + } + }, + ) + if mode == "http": + try: + writer.write(FORBIDDEN_RESPONSE) + await writer.drain() + except OSError: + pass + try: + writer.close() + except OSError: + pass + + +async def handle( + reader: asyncio.StreamReader, + writer: asyncio.StreamWriter, + config: GatewayConfig, + backend_ctx: ssl.SSLContext | None, + listener: Listener, +) -> None: + ssl_object = writer.get_extra_info("ssl_object") + try: + cert = ssl_object.getpeercert() if ssl_object is not None else None + except (ValueError, ssl.SSLError): + cert = None + if listener.require_client_cert and not cert: + # Handshake не завершился бы без CERT_REQUIRED, но защищаемся явно. + await _reject(writer, listener.reject_mode, set(), listener) + return + identity = identity_of(cert or {}) + serial = str((cert or {}).get("serialNumber", "")).lower() + if listener.require_client_cert and serial and serial in revoked_serials(config): + await _reject(writer, listener.reject_mode, identity, listener) + return + if listener.require_client_cert and not allowed(cert or {}, listener.allow_san): + await _reject(writer, listener.reject_mode, identity, listener) + return + logger.info( + "mtls_identity_accepted", + extra={ + "fields": { + "listener": f"{listener.bind_host}:{listener.bind_port}", + "identity": sorted(identity), + } + }, + ) + try: + upstream_reader, upstream_writer = await asyncio.open_connection( + listener.backend_host, + listener.backend_port, + ssl=backend_ctx if listener.backend_tls else None, + server_hostname=( + config.backend_server_name + if listener.backend_tls and config.backend_server_name + else None + ), + ) + except (ConnectionError, OSError) as exc: + logger.error( + "mtls_backend_unavailable", + extra={"fields": {"listener": listener.bind_port, "error": type(exc).__name__}}, + ) + try: + writer.close() + except OSError: + pass + return + await asyncio.gather( + _pipe(reader, upstream_writer), + _pipe(upstream_reader, writer), + ) + + +async def serve(config: GatewayConfig) -> None: + backend_ctx = backend_context(config) + servers: list[asyncio.AbstractServer] = [] + for listener in config.listeners: + server = await asyncio.start_server( + lambda r, w, listener=listener: handle(r, w, config, backend_ctx, listener), + listener.bind_host, + listener.bind_port, + ssl=server_context(config, listener), + limit=1024 * 1024, + ) + servers.append(server) + logger.info( + "mtls_listener_started", + extra={ + "fields": { + "bind": f"{listener.bind_host}:{listener.bind_port}", + "allow_san": list(listener.allow_san), + "backend": f"{listener.backend_host}:{listener.backend_port}", + "backend_tls": listener.backend_tls, + } + }, + ) + stop = asyncio.Event() + loop = asyncio.get_running_loop() + for sig in (signal.SIGTERM, signal.SIGINT): + try: + loop.add_signal_handler(sig, stop.set) + except (NotImplementedError, RuntimeError): + signal.signal(sig, lambda *_: stop.set()) + async with asyncio.TaskGroup() as group: + for server in servers: + group.create_task(server.serve_forever()) + await stop.wait() + for server in servers: + server.close() + + +def _configure_logging() -> None: + handler = logging.StreamHandler(sys.stdout) + handler.setFormatter(logging.Formatter("%(message)s")) + root = logging.getLogger() + root.handlers[:] = [handler] + root.setLevel(logging.INFO) + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--config", required=True) + args = parser.parse_args() + _configure_logging() + try: + config = load_config(args.config) + asyncio.run(serve(config)) + except (OSError, ValueError, KeyError, ssl.SSLError) as exc: + logger.error("gateway_fatal", extra={"fields": {"error": type(exc).__name__}}) + return 2 + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/messenger/pagination.py b/src/messenger/pagination.py new file mode 100644 index 0000000..4a342dc --- /dev/null +++ b/src/messenger/pagination.py @@ -0,0 +1,38 @@ +"""Keyset-пагинация: разбор курсора клиента и сборка следующего.""" +from __future__ import annotations + +from typing import Sequence + +from .cursor import CursorCodec, InvalidCursor +from .domain import Position, Sortable, rfc3339_z +from .errors import invalid_request + + +def decoded_cursor( + cursors: CursorCodec, + token: str | None, + *, + kind: str, + scope: str, +) -> Position | None: + """Позиция из курсора клиента; None означает «начать с начала выборки».""" + if token is None: + return None + try: + return cursors.decode(token, kind=kind, scope=scope).position + except InvalidCursor: + raise invalid_request("cursor недействителен для этого запроса") from None + + +def build_next_cursor( + cursors: CursorCodec, + kind: str, + scope: str, + records: Sequence[Sortable], + has_more: bool, +) -> str | None: + """next_cursor равен null, если на момент чтения следующей записи нет.""" + if not has_more or not records: + return None + last = records[-1] + return cursors.encode(kind, scope, rfc3339_z(last.created_at), str(last.id)) diff --git a/src/messenger/pipeline.py b/src/messenger/pipeline.py new file mode 100644 index 0000000..8007786 --- /dev/null +++ b/src/messenger/pipeline.py @@ -0,0 +1,223 @@ +"""Версионированный конвейер изображений: thumbnail, crop и optimized WebP. + +Версия 1 — обязательный минимум лабораторной (original + thumbnail 256×256). +Версия 2 — уровень 4 (additional crop 128×128 и optimized WebP до 1280×1280). + +Все варианты детерминированно вписываются в размеры с сохранением пропорций, +EXIF orientation применяется до масштабирования, alpha компонуется на белый, +маленькие исходники не увеличиваются (кроме явно разрешённого crop). Метаданные +(EXIF/ICC) не переносятся: выходные файлы создаются из пиксельных данных. +""" +from __future__ import annotations + +import hashlib +import os +from dataclasses import dataclass + +from PIL import Image, ImageOps, UnidentifiedImageError + +THUMBNAIL_SIZE = (256, 256) +CROP_SIZE = (128, 128) +OPTIMIZED_SIZE = (1280, 1280) +JPEG_QUALITY = 85 +WEBP_QUALITY = 80 +WEBP_METHOD = 6 + +SUPPORTED_PIPELINE_VERSIONS = (1, 2) + + +class PipelineError(Exception): + """Ошибка конвейера с безопасным машинным кодом и признаком постоянства.""" + + permanent = False + code = "processing_failed" + + +class PermanentPipelineError(PipelineError): + permanent = True + + +class InvalidImage(PermanentPipelineError): + code = "invalid_image" + + +class ImageTooLarge(PermanentPipelineError): + code = "image_too_large" + + +class CorruptOriginal(PermanentPipelineError): + code = "corrupt_original" + + +class UnsupportedPipeline(PermanentPipelineError): + code = "unsupported_pipeline" + + +@dataclass(frozen=True) +class GeneratedVariant: + """Готовый вариант на локальном диске worker-а до публикации в S3.""" + + name: str + content_type: str + path: str + size_bytes: int + sha256: str + width: int + height: int + + def cleanup(self) -> None: + try: + os.unlink(self.path) + except OSError: + pass + + +def variant_specs(pipeline_version: int) -> tuple[tuple[str, str], ...]: + """(name, content_type) в порядке публикации для версии конвейера.""" + if pipeline_version == 1: + return (("thumbnail", "image/jpeg"),) + if pipeline_version == 2: + return ( + ("thumbnail", "image/jpeg"), + ("crop", "image/jpeg"), + ("optimized", "image/webp"), + ) + raise UnsupportedPipeline("Неизвестная версия конвейера") + + +def _suffix(name: str) -> str: + return ".webp" if name == "optimized" else ".jpg" + + +def _to_rgb(image: Image.Image) -> Image.Image: + """Alpha компонуется на белый: JPEG/WebP не должны содержать прозрачность.""" + if image.mode in ("RGBA", "LA") or (image.mode == "P" and "transparency" in image.info): + rgba = image.convert("RGBA") + background = Image.new("RGB", rgba.size, (255, 255, 255)) + background.paste(rgba, mask=rgba.getchannel("A")) + return background + return image.convert("RGB") + + +def _save(image: Image.Image, path: str, name: str) -> None: + if name == "optimized": + image.save( + path, + format="WEBP", + quality=WEBP_QUALITY, + method=WEBP_METHOD, + exif=b"", + icc_profile=None, + ) + else: + image.save( + path, + format="JPEG", + quality=JPEG_QUALITY, + optimize=True, + progressive=True, + exif=b"", + icc_profile=None, + ) + + +def _measure(path: str) -> tuple[int, str]: + digest = hashlib.sha256() + size = 0 + with open(path, "rb") as handle: + while True: + chunk = handle.read(64 * 1024) + if not chunk: + break + digest.update(chunk) + size += len(chunk) + return size, digest.hexdigest() + + +def render_variants( + source_path: str, + *, + pipeline_version: int, + workdir: str, + max_pixels: int, +) -> list[GeneratedVariant]: + """Декодирует оригинал и создаёт ровно варианты заявленной версии. + + Вызывается в рабочем потоке. Ошибки Pillow преобразуются в типизированные + постоянные ошибки, чтобы worker не делал бессмысленных повторов. + """ + specs = variant_specs(pipeline_version) + Image.MAX_IMAGE_PIXELS = max_pixels + try: + with Image.open(source_path) as opened: + opened.load() + oriented = ImageOps.exif_transpose(opened) + width, height = oriented.size + if width <= 0 or height <= 0: + raise InvalidImage("Некорректные размеры изображения") + if width * height > max_pixels: + raise ImageTooLarge("Изображение превышает предел пикселей") + base = _to_rgb(oriented) + except (InvalidImage, ImageTooLarge): + raise + except Image.DecompressionBombError as exc: + raise ImageTooLarge("Изображение превышает предел пикселей") from exc + except ( + UnidentifiedImageError, + OSError, + SyntaxError, + ValueError, + EOFError, + IndexError, + OverflowError, + ) as exc: + raise InvalidImage("Изображение повреждено") from exc + + generated: list[GeneratedVariant] = [] + try: + for name, content_type in specs: + if name == "thumbnail": + rendered = base.copy() + rendered.thumbnail(THUMBNAIL_SIZE, Image.Resampling.LANCZOS) + elif name == "crop": + # Crop — центрированный квадрат; маленькие исходники можно увеличивать. + rendered = ImageOps.fit( + base.copy(), + CROP_SIZE, + method=Image.Resampling.LANCZOS, + centering=(0.5, 0.5), + ) + elif name == "optimized": + rendered = base.copy() + rendered.thumbnail(OPTIMIZED_SIZE, Image.Resampling.LANCZOS) + else: # pragma: no cover - защищено variant_specs + raise UnsupportedPipeline("Неизвестный вариант") + + path = os.path.join(workdir, name + _suffix(name)) + _save(rendered, path, name) + rendered.close() + size, digest = _measure(path) + if size <= 0: + raise InvalidImage("Пустой вариант изображения") + with Image.open(path) as check: + out_width, out_height = check.size + generated.append( + GeneratedVariant( + name=name, + content_type=content_type, + path=path, + size_bytes=size, + sha256=digest, + width=out_width, + height=out_height, + ) + ) + return generated + except PipelineError: + for item in generated: + item.cleanup() + raise + except (OSError, ValueError, Image.DecompressionBombError) as exc: + for item in generated: + item.cleanup() + raise InvalidImage("Не удалось построить вариант изображения") from exc diff --git a/src/messenger/reconcile.py b/src/messenger/reconcile.py new file mode 100644 index 0000000..2f15c1c --- /dev/null +++ b/src/messenger/reconcile.py @@ -0,0 +1,204 @@ +"""Сверка PostgreSQL и S3: staging, orphans и missing ready. + +Запуск идемпотентен и по умолчанию только показывает план (`--dry-run`). +Правила: +- staging текущей (queued/processing) работы не удаляется никогда; +- staging ready/failed-вложения удаляется только после retention; +- variant-объекты ready-вложения считаются используемыми; +- ready-вложение с пропавшим оригиналом только репортится, metadata не теряется. +""" +from __future__ import annotations + +import argparse +import asyncio +import json +import logging +from dataclasses import asdict, dataclass +from datetime import datetime, timedelta +from uuid import UUID + +from .config import Config +from .db import Database +from .domain import AttachmentRecord, utc_now +from .repository import Repository +from .storage import ObjectInfo, S3Storage, StorageUnavailable + +logger = logging.getLogger("messenger.reconcile") + + +@dataclass(frozen=True) +class PlanItem: + kind: str + identifier: str + object_key: str | None + age_seconds: int | None + action: str + + +def build_plan( + rows: list[AttachmentRecord], + objects: list[ObjectInfo], + *, + variant_keys: set[str], + now: datetime, + grace_seconds: int, +) -> tuple[list[PlanItem], list[PlanItem]]: + objects_by_key = {item.key: item for item in objects} + cutoff = now - timedelta(seconds=grace_seconds) + items: list[PlanItem] = [] + protected: set[str] = set(variant_keys) + failed_rows: dict[str, AttachmentRecord] = {} + + for row in rows: + if row.status == "ready": + protected.add(row.object_key) + elif row.status in ("queued", "processing"): + protected.add(row.staging_key) + elif row.status == "failed": + failed_rows[row.staging_key] = row + + for item in objects: + if item.key in protected: + continue + row = failed_rows.get(item.key) + if row is not None: + age = max(0, int((now - item.last_modified).total_seconds())) + stale = row.updated_at < cutoff and item.last_modified < cutoff + items.append( + PlanItem( + kind="stale_failed", + identifier=str(row.id), + object_key=item.key, + age_seconds=age, + action="delete_object_and_row" if stale else "keep_fresh", + ) + ) + continue + age = max(0, int((now - item.last_modified).total_seconds())) + items.append( + PlanItem( + kind="orphan_object", + identifier=item.key, + object_key=item.key, + age_seconds=age, + action="keep_fresh" if item.last_modified >= cutoff else "delete", + ) + ) + + # ready-объект отсутствует: это авария хранилища, metadata не удаляем. + missing = [ + PlanItem( + kind="missing_ready", + identifier=str(row.id), + object_key=row.object_key, + age_seconds=max(0, int((now - row.updated_at).total_seconds())), + action="report_only", + ) + for row in rows + if row.status == "ready" and row.object_key not in objects_by_key + ] + # failed-строка без staging: удалять нечего, но metadata старше retention + # остаётся доступной оператору (replay/аудит). + return items, missing + + +async def run(args: argparse.Namespace) -> int: + config = Config.from_env() + database = Database(config) + storage = S3Storage(config) + grace = config.staging_retention_seconds if args.grace_seconds is None else args.grace_seconds + if grace < 0: + raise SystemExit("--grace-seconds must be >= 0") + try: + async with database.session() as session: + repository = Repository(session) + rows = await repository.list_attachment_states() + variant_keys = await repository.list_variant_keys() + objects = await storage.list_objects() + now = utc_now() + items, missing = build_plan( + rows, + objects, + variant_keys=variant_keys, + now=now, + grace_seconds=grace, + ) + deletable = [ + item + for item in items + if item.action in ("delete", "delete_object_and_row") + ] + summary = { + "mode": "apply" if args.apply else "dry-run", + "grace_seconds": grace, + "prefix": config.s3_key_prefix, + "metadata_rows": len(rows), + "variant_keys": len(variant_keys), + "objects": len(objects), + "plan": [asdict(item) for item in items], + "missing_ready": [asdict(item) for item in missing], + "would_delete_objects": len( + [item for item in items if item.action in ("delete", "delete_object_and_row")] + ), + "would_delete_rows": len( + [item for item in items if item.action == "delete_object_and_row"] + ), + } + if not args.apply: + print(json.dumps(summary, ensure_ascii=False, indent=2, sort_keys=True)) + return 1 if (missing and args.fail_on_missing) else 0 + + deleted_objects = 0 + deleted_rows = 0 + async with database.session() as session: + repository = Repository(session) + for item in deletable: + if item.object_key: + try: + await storage.delete(item.object_key) + deleted_objects += 1 + except StorageUnavailable: + logger.warning( + "reconcile_object_delete_failed", + extra={"fields": {"key": item.object_key}}, + ) + continue + if item.action == "delete_object_and_row": + try: + if await repository.delete_attachment_if_stale( + UUID(item.identifier), now - timedelta(seconds=grace) + ): + deleted_rows += 1 + except Exception: + logger.warning( + "reconcile_row_delete_failed", + extra={"fields": {"id": item.identifier}}, + ) + summary["deleted_objects"] = deleted_objects + summary["deleted_rows"] = deleted_rows + print(json.dumps(summary, ensure_ascii=False, indent=2, sort_keys=True)) + return 1 if (missing and args.fail_on_missing) else 0 + finally: + await storage.close() + await database.dispose() + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description="Сверка вложений PostgreSQL и S3") + parser.add_argument("--apply", action="store_true", help="действительно удалять мусор") + parser.add_argument("--dry-run", action="store_true", help="только показать план (по умолчанию)") + parser.add_argument( + "--grace-seconds", + type=int, + default=None, + help="возраст, после которого staging failed/ready удаляется", + ) + parser.add_argument("--fail-on-missing", action="store_true", help="код 1, если ready-объект отсутствует") + args = parser.parse_args(argv) + if args.dry_run: + args.apply = False + return asyncio.run(run(args)) + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/messenger/relay.py b/src/messenger/relay.py new file mode 100644 index 0000000..30b3ffe --- /dev/null +++ b/src/messenger/relay.py @@ -0,0 +1,241 @@ +"""Relay: transactional outbox → RabbitMQ + reaper истёкших lease. + +Relay отделён от API: COMMIT задания и публикация не могут быть одной +транзакцией, поэтому строка outbox коммитится вместе с job и публикуется +повторно до первого successful publisher confirm. Падение между COMMIT и +publish не теряет принятую работу; повторная публикация допустима, потому что +worker идемпотентен. +""" +from __future__ import annotations + +import asyncio +import logging +import os +import signal +import time +from pathlib import Path + +from opentelemetry.trace import SpanKind, Status, StatusCode + +from . import telemetry +from .broker import Broker, build_payload +from .config import Config, ConfigError +from .db import Database +from .jobs import JobRepository +from .logging_setup import configure_logging, log +from .secrets_provider import SecretsUnavailable, load_service_secrets + +logger = logging.getLogger("messenger.relay") + +HEARTBEAT_FILE = os.environ.get("HEARTBEAT_FILE", "/tmp/messenger-relay-heartbeat") +HEARTBEAT_SECONDS = 5.0 + + +def _heartbeat() -> None: + try: + Path(HEARTBEAT_FILE).write_text(str(time.time()), encoding="ascii") + except OSError: + pass + + +class Relay: + def __init__(self, config: Config) -> None: + self._config = config + self._database = Database(config) + self._jobs = JobRepository(self._database, config) + self._broker = Broker(config) + self._stop = asyncio.Event() + self._published = 0 + self._reaped = 0 + + def request_stop(self) -> None: + self._stop.set() + + async def _heartbeat_loop(self) -> None: + while not self._stop.is_set(): + _heartbeat() + try: + await asyncio.wait_for(self._stop.wait(), timeout=HEARTBEAT_SECONDS) + except asyncio.TimeoutError: + continue + + async def _reaper_loop(self) -> None: + while not self._stop.is_set(): + try: + recovered = await self._jobs.reap_expired() + if recovered: + self._reaped += recovered + log(logger, logging.WARNING, "lease_reaped", jobs=recovered) + except Exception as exc: + log(logger, logging.ERROR, "reaper_failed", exc_info=exc) + try: + await asyncio.wait_for( + self._stop.wait(), timeout=self._config.reaper_interval_seconds + ) + except asyncio.TimeoutError: + continue + + async def run(self) -> None: + log( + logger, + logging.INFO, + "relay_startup", + queue=self._broker.queue_name, + poll_seconds=self._config.relay_poll_seconds, + ) + await self._broker.connect() + _heartbeat() + heartbeat_task = asyncio.create_task(self._heartbeat_loop()) + reaper_task = asyncio.create_task(self._reaper_loop()) + try: + while not self._stop.is_set(): + try: + items = await self._jobs.outbox_due(20) + except Exception as exc: + log(logger, logging.ERROR, "outbox_read_failed", exc_info=exc) + await asyncio.sleep(self._config.relay_poll_seconds) + continue + if not items: + try: + await asyncio.wait_for( + self._stop.wait(), timeout=self._config.relay_poll_seconds + ) + except asyncio.TimeoutError: + pass + continue + for item in items: + if self._stop.is_set(): + break + if item.job.state != "queued": + # Job уже завершён/захвачен; outbox-строка больше не нужна. + await self._jobs.mark_published(item.outbox_id) + log( + logger, + logging.INFO, + "outbox_retired", + job_id=str(item.job.id), + state=item.job.state, + ) + continue + parent = telemetry.context_from_trace( + item.job.traceparent, item.job.tracestate + ) + with telemetry.start_span( + "job.publish " + str(item.job.type), + kind=SpanKind.PRODUCER, + context=parent, + attributes={ + "messaging.system": "rabbitmq", + "messaging.destination.name": self._broker.queue_name, + "messaging.operation": "publish", + "job.id": str(item.job.id), + "job.type": item.job.type, + "job.attempt": item.job.attempts + 1, + }, + ) as span: + payload = build_payload(item.job, attempt=item.job.attempts + 1) + carrier = telemetry.current_trace_context() + if carrier.get("traceparent"): + payload["traceparent"] = carrier["traceparent"] + if carrier.get("tracestate"): + payload["tracestate"] = carrier["tracestate"] + try: + await self._broker.publish_job( + payload, message_id=str(item.job.id) + ) + except Exception as exc: + span.set_status(Status(StatusCode.ERROR)) + span.set_attribute("error.type", type(exc).__name__) + await self._jobs.mark_publish_failed( + item.outbox_id, type(exc).__name__ + ) + log( + logger, + logging.WARNING, + "outbox_publish_failed", + exc_info=exc, + job_id=str(item.job.id), + ) + # Брокер мог перезапускаться: пересоздаём соединение. + try: + await self._broker.close() + except Exception: + pass + await asyncio.sleep(min(2.0, 0.2 * (item.job.attempts + 1))) + try: + await self._broker.connect() + except Exception as reconnect_exc: + log( + logger, + logging.ERROR, + "broker_reconnect_failed", + exc_info=reconnect_exc, + ) + await asyncio.sleep(2.0) + break + await self._jobs.mark_published(item.outbox_id) + self._published += 1 + span.set_attribute("job.outcome", "published") + log( + logger, + logging.INFO, + "outbox_published", + job_id=str(item.job.id), + attachment_id=str(item.job.attachment_id), + pipeline_version=item.job.pipeline_version, + attempt=payload["attempt"], + ) + await asyncio.sleep(0) + finally: + self._stop.set() + heartbeat_task.cancel() + reaper_task.cancel() + await asyncio.gather(heartbeat_task, reaper_task, return_exceptions=True) + try: + await self._broker.close() + except Exception: + pass + await self._database.dispose() + log( + logger, + logging.INFO, + "relay_stopped", + published=self._published, + reaped=self._reaped, + ) + + +async def _run() -> int: + try: + load_service_secrets() + config = Config.from_env() + config.require_broker() + except (ConfigError, SecretsUnavailable) as exc: + print(f"config error: {exc}", file=os.sys.stderr) + return 2 + root = configure_logging(config.log_level, config.env) + telemetry.setup_telemetry(service_name="messenger-relay", instance_id=config.worker_id) + relay = Relay(config) + telemetry.register_db_pool(relay._database.engine) + loop = asyncio.get_running_loop() + for sig in (signal.SIGTERM, signal.SIGINT): + try: + loop.add_signal_handler(sig, relay.request_stop) + except (NotImplementedError, RuntimeError): + signal.signal(sig, lambda *_: relay.request_stop()) + try: + await relay.run() + except Exception as exc: + log(root, logging.ERROR, "relay_fatal", exc_info=exc) + return 1 + finally: + telemetry.shutdown_telemetry() + return 0 + + +def main() -> int: + return asyncio.run(_run()) + + +if __name__ == "__main__": + raise SystemExit(main()) \ No newline at end of file diff --git a/src/messenger/repository.py b/src/messenger/repository.py new file mode 100644 index 0000000..7adaa6e --- /dev/null +++ b/src/messenger/repository.py @@ -0,0 +1,619 @@ +"""Запросы к PostgreSQL: единственное место, где выполняется SQL. + +Все значения передаются bind-параметрами — строки запросов не собираются из +данных пользователя. Транзакционную границу задаёт репозиторий: операция, +меняющая несколько таблиц, выполняется целиком или не выполняется вовсе. + +Единица работы — неявная транзакция сессии запроса: пишущие методы завершают +её `commit`, а незавершённую откатывает закрытие сессии. +""" +from __future__ import annotations + +from typing import Sequence +from uuid import UUID, uuid4 + +from sqlalchemy import Row, Select, cast, delete, func, insert, literal, select, text, tuple_ +from sqlalchemy.dialects.postgresql import TIMESTAMP, UUID as PGUUID +from sqlalchemy.dialects.postgresql import insert as pg_insert +from sqlalchemy.exc import IntegrityError +from sqlalchemy.ext.asyncio import AsyncSession + +from .domain import ( + ATTACHMENT_STATUS_FAILED, + AttachmentNotReady, + AttachmentRecord, + AttachmentUnknown, + ChatRecord, + IdempotencyConflict, + MessageRecord, + Position, + UnknownMembers, + UserRecord, + VariantRecord, +) +from .jobs import insert_upload_work +from .schema import ( + ATTACHMENTS, + CHAT_MEMBERS, + CHATS, + MESSAGE_ATTACHMENTS, + MESSAGE_IDEMPOTENCY, + MESSAGES, + USERS, + VARIANTS, +) + +FOREIGN_KEY_VIOLATION = "23503" + +# Ключ идемпотентности живёт 24 часа; срок считает PostgreSQL, а не часы +# приложения, чтобы реплики с разными часами принимали одинаковое решение. +IDEMPOTENCY_FRESH_PREDICATE = MESSAGE_IDEMPOTENCY.c.created_at > ( + func.now() - text("INTERVAL '24 hours'") +) + + +def _sqlstate(error: IntegrityError) -> str | None: + """Код ошибки PostgreSQL: драйвер кладёт его в исходное исключение.""" + return getattr(getattr(error, "orig", None), "sqlstate", None) + + +def _after_predicate(created_at_column, id_column, after: Position): + """Keyset-условие «строго после пары (created_at, id)» одним сравнением строк.""" + moment, item_id = after + return tuple_(created_at_column, id_column) > tuple_( + cast(literal(moment), TIMESTAMP(timezone=True)), + cast(literal(item_id), PGUUID(as_uuid=True)), + ) + + +def _user_record(row: Row) -> UserRecord: + return UserRecord( + id=row.id, username=row.username, display_name=row.display_name, created_at=row.created_at + ) + + +def _chat_columns() -> tuple: + return (CHATS.c.id, CHATS.c.title, CHATS.c.created_at) + + +def _message_columns() -> tuple: + return ( + MESSAGES.c.id, + MESSAGES.c.chat_id, + MESSAGES.c.sender_id, + MESSAGES.c.text, + MESSAGES.c.created_at, + ) + + +def _attachment_columns() -> tuple: + return ( + ATTACHMENTS.c.id, + ATTACHMENTS.c.chat_id, + ATTACHMENTS.c.owner_id, + ATTACHMENTS.c.object_key, + ATTACHMENTS.c.staging_key, + ATTACHMENTS.c.pipeline_version, + ATTACHMENTS.c.filename, + ATTACHMENTS.c.content_type, + ATTACHMENTS.c.size_bytes, + ATTACHMENTS.c.sha256, + ATTACHMENTS.c.status, + ATTACHMENTS.c.error_code, + ATTACHMENTS.c.ready_at, + ATTACHMENTS.c.created_at, + ATTACHMENTS.c.updated_at, + ) + + +def _variant_record(row: Row) -> VariantRecord: + return VariantRecord( + attachment_id=row.attachment_id, + pipeline_version=row.pipeline_version, + name=row.name, + content_type=row.content_type, + object_key=row.object_key, + size_bytes=row.size_bytes, + sha256=row.sha256, + width=row.width, + height=row.height, + created_at=row.created_at, + ) + + +def _attachment_record( + row: Row, variants: Sequence[VariantRecord] = () +) -> AttachmentRecord: + return AttachmentRecord( + id=row.id, + chat_id=row.chat_id, + owner_id=row.owner_id, + object_key=row.object_key, + staging_key=row.staging_key, + pipeline_version=row.pipeline_version, + filename=row.filename, + content_type=row.content_type, + size_bytes=row.size_bytes, + sha256=row.sha256, + status=row.status, + error_code=row.error_code, + ready_at=row.ready_at, + created_at=row.created_at, + updated_at=row.updated_at, + variants=tuple(variants), + ) + + +def _message_record(row: Row, attachment_ids: Sequence[UUID] = ()) -> MessageRecord: + return MessageRecord( + id=row.id, + chat_id=row.chat_id, + sender_id=row.sender_id, + text=row.text, + created_at=row.created_at, + attachment_ids=tuple(attachment_ids), + ) + + +class Repository: + """Набор операций над PostgreSQL в рамках одной сессии (одного запроса).""" + + def __init__(self, session: AsyncSession) -> None: + self._session = session + + async def ping(self) -> None: + """Дешёвая проверка живости соединения для /health/ready.""" + await self._session.execute(select(literal(1))) + + async def username_taken(self, username: str) -> bool: + found = await self._session.scalar( + select(USERS.c.id).where(USERS.c.username == username).limit(1) + ) + return found is not None + + async def create_user( + self, username: str, display_name: str, password_hash: str + ) -> UserRecord | None: + row = ( + await self._session.execute( + pg_insert(USERS) + .values( + id=uuid4(), + username=username, + display_name=display_name, + password_hash=password_hash, + ) + .on_conflict_do_nothing(index_elements=[USERS.c.username]) + .returning(*USERS.c) + ) + ).first() + await self._session.commit() + return None if row is None else _user_record(row) + + async def credentials_for(self, username: str) -> tuple[UserRecord, str] | None: + row = ( + await self._session.execute( + select(USERS.c.id, USERS.c.username, USERS.c.display_name, USERS.c.created_at, + USERS.c.password_hash) + .where(USERS.c.username == username) + .limit(1) + ) + ).first() + if row is None: + return None + return _user_record(row), row.password_hash + + async def update_password_hash(self, user_id: UUID, password_hash: str) -> None: + """Пересчитывает старый Argon2id-хэш при успешном входе (rehash).""" + await self._session.execute( + USERS.update().where(USERS.c.id == user_id).values(password_hash=password_hash) + ) + await self._session.commit() + + async def get_user(self, user_id: UUID) -> UserRecord | None: + row = ( + await self._session.execute( + select(USERS.c.id, USERS.c.username, USERS.c.display_name, USERS.c.created_at) + .where(USERS.c.id == user_id) + .limit(1) + ) + ).first() + return None if row is None else _user_record(row) + + async def create_chat(self, title: str, member_ids: Sequence[UUID]) -> ChatRecord: + chat_id = uuid4() + row = ( + await self._session.execute( + insert(CHATS).values(id=chat_id, title=title).returning(*_chat_columns()) + ) + ).one() + try: + await self._session.execute( + insert(CHAT_MEMBERS), + [{"chat_id": chat_id, "user_id": member_id} for member_id in member_ids], + ) + except IntegrityError as error: + if _sqlstate(error) != FOREIGN_KEY_VIOLATION: + raise + await self._session.rollback() + raise UnknownMembers(member_ids) from None + await self._session.commit() + return ChatRecord( + id=row.id, + title=row.title, + member_ids=tuple(sorted(member_ids, key=lambda item: item.int)), + created_at=row.created_at, + ) + + async def chat_for_member(self, chat_id: UUID, user_id: UUID) -> ChatRecord | None: + row = ( + await self._session.execute( + select(*_chat_columns()) + .select_from(CHATS.join(CHAT_MEMBERS, CHAT_MEMBERS.c.chat_id == CHATS.c.id)) + .where(CHATS.c.id == chat_id, CHAT_MEMBERS.c.user_id == user_id) + .limit(1) + ) + ).first() + if row is None: + return None + members = await self._members_of([chat_id]) + return ChatRecord( + id=row.id, title=row.title, member_ids=members[chat_id], created_at=row.created_at + ) + + async def list_chats( + self, user_id: UUID, after: Position | None, limit: int + ) -> tuple[list[ChatRecord], bool]: + statement = ( + select(*_chat_columns()) + .select_from(CHATS.join(CHAT_MEMBERS, CHAT_MEMBERS.c.chat_id == CHATS.c.id)) + .where(CHAT_MEMBERS.c.user_id == user_id) + ) + rows = await self._page(statement, CHATS, after, limit) + more = len(rows) > limit + rows = rows[:limit] + members = await self._members_of([row.id for row in rows]) + chats = [ + ChatRecord( + id=row.id, title=row.title, member_ids=members[row.id], created_at=row.created_at + ) + for row in rows + ] + return chats, more + + async def append_message( + self, chat_id: UUID, sender_id: UUID, text: str, attachment_ids: Sequence[UUID] = () + ) -> MessageRecord: + message_id = uuid4() + row = ( + await self._session.execute( + insert(MESSAGES) + .values(id=message_id, chat_id=chat_id, sender_id=sender_id, text=text) + .returning(*_message_columns()) + ) + ).one() + await self._link_attachments(message_id, attachment_ids) + await self._session.commit() + return _message_record(row, attachment_ids) + + async def append_message_idempotent( + self, + chat_id: UUID, + sender_id: UUID, + text: str, + attachment_ids: Sequence[UUID], + idempotency_key: str, + request_hash: str, + ) -> MessageRecord: + """Создаёт сообщение ровно один раз для ключа (пользователь, чат, ключ). + + Побочный эффект (messages + message_attachments) и запись результата + (message_idempotency) фиксируются одной транзакцией. + """ + lock_scope = f'{sender_id}:{chat_id}:{idempotency_key}' + await self._session.execute( + select(func.pg_advisory_xact_lock(func.hashtextextended(lock_scope, 0))) + ) + fresh = IDEMPOTENCY_FRESH_PREDICATE + existing = ( + await self._session.execute( + select(*_message_columns(), MESSAGE_IDEMPOTENCY.c.request_hash, fresh.label('fresh')) + .select_from( + MESSAGE_IDEMPOTENCY.join( + MESSAGES, MESSAGES.c.id == MESSAGE_IDEMPOTENCY.c.message_id + ) + ) + .where( + MESSAGE_IDEMPOTENCY.c.user_id == sender_id, + MESSAGE_IDEMPOTENCY.c.chat_id == chat_id, + MESSAGE_IDEMPOTENCY.c.idempotency_key == idempotency_key, + ) + .limit(1) + ) + ).first() + if existing is not None: + if existing.fresh and existing.request_hash == request_hash: + linked = await self._attachment_ids_of([existing.id]) + record = _message_record(existing, linked.get(existing.id, ())) + await self._session.commit() + return record + if existing.fresh: + await self._session.rollback() + raise IdempotencyConflict() + # Срок хранения ключа истёк: старый ключ можно использовать снова. + await self._session.execute( + delete(MESSAGE_IDEMPOTENCY).where( + MESSAGE_IDEMPOTENCY.c.user_id == sender_id, + MESSAGE_IDEMPOTENCY.c.chat_id == chat_id, + MESSAGE_IDEMPOTENCY.c.idempotency_key == idempotency_key, + ) + ) + message_id = uuid4() + row = ( + await self._session.execute( + insert(MESSAGES) + .values(id=message_id, chat_id=chat_id, sender_id=sender_id, text=text) + .returning(*_message_columns()) + ) + ).one() + await self._link_attachments(message_id, attachment_ids) + await self._session.execute( + insert(MESSAGE_IDEMPOTENCY).values( + user_id=sender_id, + chat_id=chat_id, + idempotency_key=idempotency_key, + request_hash=request_hash, + message_id=message_id, + ) + ) + await self._session.commit() + return _message_record(row, attachment_ids) + + async def list_messages( + self, chat_id: UUID, after: Position | None, limit: int + ) -> tuple[list[MessageRecord], bool]: + statement = select(*_message_columns()).where(MESSAGES.c.chat_id == chat_id) + rows = await self._page(statement, MESSAGES, after, limit) + more = len(rows) > limit + page = rows[:limit] + linked = await self._attachment_ids_of([row.id for row in page]) + messages = [ + _message_record(row, linked.get(row.id, ())) + for row in page + ] + return messages, more + + async def _link_attachments(self, message_id: UUID, attachment_ids: Sequence[UUID]) -> None: + if not attachment_ids: + return + await self._session.execute( + insert(MESSAGE_ATTACHMENTS), + [ + {"message_id": message_id, "attachment_id": attachment_id, "position": position} + for position, attachment_id in enumerate(attachment_ids) + ], + ) + + async def _attachment_ids_of(self, message_ids: Sequence[UUID]) -> dict[UUID, tuple[UUID, ...]]: + if not message_ids: + return {} + rows = await self._session.execute( + select(MESSAGE_ATTACHMENTS.c.message_id, MESSAGE_ATTACHMENTS.c.attachment_id) + .where(MESSAGE_ATTACHMENTS.c.message_id.in_(message_ids)) + .order_by(MESSAGE_ATTACHMENTS.c.message_id, MESSAGE_ATTACHMENTS.c.position) + ) + grouped: dict[UUID, list[UUID]] = {} + for message_id, attachment_id in rows: + grouped.setdefault(message_id, []).append(attachment_id) + return {message_id: tuple(items) for message_id, items in grouped.items()} + + async def _page( + self, statement: Select, table, after: Position | None, limit: int + ) -> list[Row]: + if after is not None: + statement = statement.where(_after_predicate(table.c.created_at, table.c.id, after)) + result = await self._session.execute( + statement.order_by(table.c.created_at, table.c.id).limit(limit + 1) + ) + return list(result) + + async def _members_of(self, chat_ids: Sequence[UUID]) -> dict[UUID, tuple[UUID, ...]]: + if not chat_ids: + return {} + rows = await self._session.execute( + select(CHAT_MEMBERS.c.chat_id, CHAT_MEMBERS.c.user_id) + .where(CHAT_MEMBERS.c.chat_id.in_(chat_ids)) + .order_by(CHAT_MEMBERS.c.chat_id, CHAT_MEMBERS.c.user_id) + ) + grouped: dict[UUID, list[UUID]] = {} + for chat_id, user_id in rows: + grouped.setdefault(chat_id, []).append(user_id) + return {chat_id: tuple(members) for chat_id, members in grouped.items()} + + # --- Вложения --------------------------------------------------------- + + async def create_queued_attachment( + self, + attachment_id: UUID, + chat_id: UUID, + owner_id: UUID, + staging_key: str, + object_key: str, + filename: str, + content_type: str, + size_bytes: int, + sha256: str, + pipeline_version: int, + max_attempts: int, + traceparent: str | None = None, + tracestate: str | None = None, + ) -> AttachmentRecord: + """Одна транзакция: queued-вложение + job + outbox + аудит. + + Вызывается только после успешного S3 PUT тела в staging. COMMIT этой + транзакции — граница, после которой API отвечает 202. Незавершённая + транзакция не оставляет ни строки, ни намерения. + """ + await insert_upload_work( + self._session, + attachment_id=attachment_id, + chat_id=chat_id, + owner_id=owner_id, + staging_key=staging_key, + object_key=object_key, + filename=filename, + content_type=content_type, + size_bytes=size_bytes, + sha256=sha256, + pipeline_version=pipeline_version, + max_attempts=max_attempts, + traceparent=traceparent, + tracestate=tracestate, + ) + row = ( + await self._session.execute( + select(*_attachment_columns()).where(ATTACHMENTS.c.id == attachment_id) + ) + ).one() + await self._session.commit() + return _attachment_record(row) + + async def delete_attachment(self, attachment_id: UUID) -> bool: + """Удаляет метаданные ещё не опубликованного вложения при компенсации. + + Готовые вложения удалять нельзя: на них могут ссылаться сообщения, + поэтому FK `RESTRICT` не даст сделать это случайно. + """ + try: + row = ( + await self._session.execute( + delete(ATTACHMENTS) + .where( + ATTACHMENTS.c.id == attachment_id, + ATTACHMENTS.c.status.in_(("queued", "processing")), + ) + .returning(ATTACHMENTS.c.id) + ) + ).first() + await self._session.commit() + return row is not None + except IntegrityError: + await self._session.rollback() + return False + + async def _variants_of( + self, attachment_id: UUID, pipeline_version: int + ) -> tuple[VariantRecord, ...]: + if pipeline_version <= 0: + return () + rows = ( + await self._session.execute( + select(VARIANTS) + .where( + VARIANTS.c.attachment_id == attachment_id, + VARIANTS.c.pipeline_version == pipeline_version, + ) + .order_by(VARIANTS.c.name) + ) + ).all() + return tuple(_variant_record(row) for row in rows) + + async def attachment_for_member( + self, attachment_id: UUID, user_id: UUID + ) -> AttachmentRecord | None: + """Вложение глазами участника чата; чужое неотличимо от отсутствующего.""" + row = ( + await self._session.execute( + select(*_attachment_columns()) + .select_from( + ATTACHMENTS.join( + CHAT_MEMBERS, CHAT_MEMBERS.c.chat_id == ATTACHMENTS.c.chat_id + ) + ) + .where(ATTACHMENTS.c.id == attachment_id, CHAT_MEMBERS.c.user_id == user_id) + .limit(1) + ) + ).first() + if row is None: + return None + return _attachment_record( + row, await self._variants_of(attachment_id, row.pipeline_version) + ) + + async def attachment_by_id(self, attachment_id: UUID) -> AttachmentRecord | None: + row = ( + await self._session.execute( + select(*_attachment_columns()).where(ATTACHMENTS.c.id == attachment_id).limit(1) + ) + ).first() + if row is None: + return None + return _attachment_record( + row, await self._variants_of(attachment_id, row.pipeline_version) + ) + + async def validate_message_attachments( + self, chat_id: UUID, attachment_ids: Sequence[UUID] + ) -> list[AttachmentRecord]: + """Проверяет, что все вложения существуют и принадлежат чату. + + Неизвестное или чужое — 404; failed — 409. queued/processing допустимы + с lab5: сообщение можно отправить до завершения фоновой обработки. + Порядок возвращаемых записей совпадает с порядком `attachment_ids`. + """ + if not attachment_ids: + return [] + rows = ( + await self._session.execute( + select(*_attachment_columns()).where(ATTACHMENTS.c.id.in_(attachment_ids)) + ) + ).all() + found = {row.id: _attachment_record(row) for row in rows} + if any(attachment_id not in found for attachment_id in attachment_ids): + raise AttachmentUnknown() + if any(found[attachment_id].chat_id != chat_id for attachment_id in attachment_ids): + raise AttachmentUnknown() + if any( + found[attachment_id].status == ATTACHMENT_STATUS_FAILED + for attachment_id in attachment_ids + ): + raise AttachmentNotReady() + return [found[attachment_id] for attachment_id in attachment_ids] + + async def list_variant_keys(self) -> set[str]: + """Ключи всех опубликованных вариантов: reconciler не считает их мусором.""" + rows = await self._session.execute(select(VARIANTS.c.object_key)) + return {str(value) for value in rows.scalars().all()} + + async def list_attachment_states(self) -> list[AttachmentRecord]: + """Все строки метаданных для reconciler (без байтов и вариантов).""" + rows = ( + await self._session.execute( + select(*_attachment_columns()).order_by(ATTACHMENTS.c.created_at, ATTACHMENTS.c.id) + ) + ).all() + return [_attachment_record(row) for row in rows] + + async def delete_attachment_if_stale(self, attachment_id: UUID, before) -> bool: + """Удаляет только failed-строку старше `before`. + + queued/processing — текущая работа, ready — данные пользователя. + Автоматическое удаление этих строк было бы потерей. + """ + try: + row = ( + await self._session.execute( + delete(ATTACHMENTS) + .where( + ATTACHMENTS.c.id == attachment_id, + ATTACHMENTS.c.status == ATTACHMENT_STATUS_FAILED, + ATTACHMENTS.c.updated_at < before, + ) + .returning(ATTACHMENTS.c.id) + ) + ).first() + await self._session.commit() + return row is not None + except IntegrityError: + await self._session.rollback() + return False diff --git a/src/messenger/routers/__init__.py b/src/messenger/routers/__init__.py new file mode 100644 index 0000000..acd9936 --- /dev/null +++ b/src/messenger/routers/__init__.py @@ -0,0 +1 @@ +"""Маршруты HTTP API: только разбор запроса, вызов зависимостей и сборка ответа.""" diff --git a/src/messenger/routers/attachments.py b/src/messenger/routers/attachments.py new file mode 100644 index 0000000..ef42774 --- /dev/null +++ b/src/messenger/routers/attachments.py @@ -0,0 +1,220 @@ +"""Загрузка, метаданные и авторизованная выдача вложений. + +Lab5: upload принимает байты в устойчивый S3 staging, одной транзакцией пишет +attachment(queued) + job + outbox и отвечает 202. Тяжёлая обработка выполняется +отдельным worker-ом; API никогда не делает resize синхронно. +""" +from __future__ import annotations + +import logging +from typing import Annotated, AsyncIterator +from uuid import UUID, uuid4 + +import anyio +from fastapi import APIRouter, Path, Query, Request, status +from fastapi.responses import StreamingResponse + +from ..access import visible_chat +from ..deps import ConfigDep, CurrentUser, RepositoryDep, StorageDep +from ..domain import VariantRecord +from ..errors import conflict, invalid_request, not_found, payload_too_large, unavailable, unsupported_media_type +from ..models import Attachment +from .. import telemetry +from ..storage import StorageObjectMissing, StorageUnavailable +from ..upload import receive_image + +router = APIRouter(prefix="/api/v1", tags=["attachments"]) +logger = logging.getLogger("messenger") + +ALLOWED_CONTENT_TYPES = ("image/png", "image/jpeg") +ALLOWED_VARIANTS = ("thumbnail", "crop", "optimized") +FORBIDDEN_FILENAME_CHARS = ("/", "\\", "\x00") +NOT_READY_STATUSES = ("queued", "processing", "failed") + + +def declared_content_type(value: str | None) -> str | None: + """Медиа-тип без параметров; None — если он не PNG/JPEG.""" + if not value: + return None + media_type = value.split(";", 1)[0].strip().lower() + return media_type if media_type in ALLOWED_CONTENT_TYPES else None + + +def validate_filename(value: str) -> str: + """filename — только отображаемое имя, но опасные символы отклоняются.""" + if not value or len(value) > 255: + raise invalid_request("filename должен содержать 1..255 code points") + if any(char in value for char in FORBIDDEN_FILENAME_CHARS): + raise invalid_request("filename не должен содержать /, \\ или NUL") + if any(ord(char) < 0x20 or ord(char) == 0x7F for char in value): + raise invalid_request("filename не должен содержать управляющие символы") + return value + + +async def _stream_body(body) -> AsyncIterator[bytes]: + """Читает S3-поток в рабочем потоке, не блокируя event loop.""" + try: + while True: + chunk = await anyio.to_thread.run_sync(body.read, 64 * 1024) + if not chunk: + break + yield chunk + finally: + close = getattr(body, "close", None) + if close is not None: + close() + + +@router.post( + "/chats/{chat_id}/attachments", + status_code=status.HTTP_202_ACCEPTED, + summary="Принять PNG/JPEG в staging и поставить задание в очередь", +) +async def upload_attachment( + chat_id: Annotated[UUID, Path()], + request: Request, + repository: RepositoryDep, + user: CurrentUser, + config: ConfigDep, + storage: StorageDep, + filename: Annotated[str, Query(min_length=1, max_length=255)], +) -> Attachment: + """Сначала доступ к чату, затем лимиты и MIME; 202 — после staging + COMMIT. + + 202 означает: полный проверенный оригинал лежит в приватном staging, а + намерение обработать его (job + outbox) закоммичено. Оно переживёт остановку + API, worker и broker; клиент узнаёт готовность через GET метаданных. + """ + await visible_chat(repository, chat_id, user) + validate_filename(filename) + expected_type = declared_content_type(request.headers.get("content-type")) + if expected_type is None: + raise unsupported_media_type("Content-Type должен быть image/png или image/jpeg") + + raw_length = request.headers.get("content-length") + if raw_length is not None: + try: + length = int(raw_length) + except ValueError: + raise invalid_request("Content-Length должен быть целым числом") from None + if length < 0: + raise invalid_request("Content-Length не может быть отрицательным") + if length > config.max_upload_bytes: + raise payload_too_large(f"Файл больше {config.max_upload_bytes} байт") + + received = await receive_image( + request, expected_content_type=expected_type, config=config + ) + try: + attachment_id = uuid4() + staging_key = storage.staging_key(str(attachment_id)) + object_key = storage.original_key(str(attachment_id), config.pipeline_version) + with open(received.path, "rb") as file: + await storage.put( + staging_key, + file, + content_type=received.info.content_type, + size_bytes=received.size_bytes, + sha256=received.sha256, + md5_hex=received.md5, + ) + if config.attachment_fault_mode == "after_s3_put": + # Учебное внедрение отказа между staging PUT и COMMIT задания. + # Строки job нет, staging-объект уберёт reconciler после retention. + raise StorageUnavailable("Смоделирован отказ после staging PUT") + traceparent, tracestate = telemetry.format_trace_context( + telemetry.current_trace_context() + ) + try: + queued = await repository.create_queued_attachment( + attachment_id=attachment_id, + chat_id=chat_id, + owner_id=user.id, + staging_key=staging_key, + object_key=object_key, + filename=filename, + content_type=received.info.content_type, + size_bytes=received.size_bytes, + sha256=received.sha256, + pipeline_version=config.pipeline_version, + max_attempts=config.job_max_attempts, + traceparent=traceparent, + tracestate=tracestate, + ) + except BaseException: + # COMMIT не прошёл: принятая работа не подтверждена, staging не + # должен пережить запрос. Ошибку удаления доберёт reconciler. + try: + await storage.delete(staging_key) + except Exception: + logger.warning( + "staging_compensation_failed", + extra={"fields": {"attachment_id": str(attachment_id)}}, + ) + raise + return Attachment.from_record(queued) + finally: + received.cleanup() + + +@router.get("/attachments/{attachment_id}", summary="Текущее состояние вложения") +async def get_attachment( + attachment_id: Annotated[UUID, Path()], + repository: RepositoryDep, + user: CurrentUser, +) -> Attachment: + """Возвращает queued/processing/ready/failed; готовность — отдельный вопрос. + + Метаданные доступны на любом состоянии: клиент опрашивает этот endpoint. + Скачивание content для неготового вложения — 409. + """ + record = await repository.attachment_for_member(attachment_id, user.id) + if record is None: + raise not_found("Вложение не найдено") + return Attachment.from_record(record) + + +@router.get("/attachments/{attachment_id}/content", summary="Скачать байты через API") +async def download_attachment( + attachment_id: Annotated[UUID, Path()], + repository: RepositoryDep, + user: CurrentUser, + storage: StorageDep, + variant: Annotated[str | None, Query()] = None, +) -> StreamingResponse: + """Оригинал или готовый вариант отдаётся потоком, без redirect/presigned URL.""" + name = "original" if variant in (None, "", "original") else variant + if name not in ("original",) + ALLOWED_VARIANTS: + raise invalid_request("variant должен быть original, thumbnail, crop или optimized") + record = await repository.attachment_for_member(attachment_id, user.id) + if record is None: + raise not_found("Вложение не найдено") + if record.status in NOT_READY_STATUSES: + raise conflict("Вложение ещё не готово") + if name == "original": + object_key = record.object_key + content_type = record.content_type + size_bytes = record.size_bytes + else: + chosen = next((item for item in record.variants if item.name == name), None) + if chosen is None: + raise not_found("Вариант вложения не найден") + object_key = chosen.object_key + content_type = chosen.content_type + size_bytes = chosen.size_bytes + try: + stored = await storage.open(object_key) + except StorageObjectMissing: + raise not_found("Объект вложения отсутствует") from None + except StorageUnavailable: + raise unavailable("Хранилище вложений недоступно") from None + if stored.size_bytes != size_bytes: + close = getattr(stored.body, "close", None) + if close is not None: + close() + raise unavailable("Размер объекта в хранилище не совпадает с метаданными") + return StreamingResponse( + _stream_body(stored.body), + media_type=content_type, + headers={"Content-Length": str(size_bytes)}, + ) \ No newline at end of file diff --git a/src/messenger/routers/auth.py b/src/messenger/routers/auth.py new file mode 100644 index 0000000..18aaaa5 --- /dev/null +++ b/src/messenger/routers/auth.py @@ -0,0 +1,78 @@ +"""Вход по Basic и отзыв текущей сессии.""" +from __future__ import annotations + +from fastapi import APIRouter, Response, status + +from ..deps import ( + BasicCredentialsDep, + BearerToken, + LoginGuardDep, + RepositoryDep, + SessionsDep, +) +from ..errors import BASIC_CHALLENGE, rate_limited, unauthorized +from ..models import Session +from ..security import ( + hash_password, + password_needs_rehash, + spend_verification_time, + verify_password, +) + +router = APIRouter(prefix="/api/v1/auth/sessions", tags=["auth"]) + +INVALID_CREDENTIALS = "Неверный username или пароль" + + +@router.post("", status_code=status.HTTP_201_CREATED, summary="Вход: Basic username:password") +async def create_session( + credentials: BasicCredentialsDep, + repository: RepositoryDep, + sessions: SessionsDep, + guard: LoginGuardDep, +) -> Session: + """Проверяет пароль и выдаёт opaque-токен сессии; тело запроса не читается. + + Неизвестный пользователь и неверный пароль неразличимы: одинаковый 401 с + Basic-челленджем и одинаковая затрата времени на KDF. Попытка учитывается + до KDF, поэтому серия дорогих проверок ограничена общим для реплик + счётчиком в PostgreSQL; `Retry-After` сообщает окно блокировки. + """ + retry_after = await guard.reserve(credentials.username) + if retry_after is not None: + raise rate_limited( + "Слишком много попыток входа; повторите позже", retry_after + ) + found = await repository.credentials_for(credentials.username) + if found is None: + async with guard.kdf_slot(): + await spend_verification_time() + raise unauthorized(INVALID_CREDENTIALS, challenge=BASIC_CHALLENGE) + user, stored_hash = found + async with guard.kdf_slot(): + valid = await verify_password(credentials.password, stored_hash) + if not valid: + raise unauthorized(INVALID_CREDENTIALS, challenge=BASIC_CHALLENGE) + if password_needs_rehash(stored_hash): + # Rehash старого хэша при успешном входе: параметры Argon2id можно + # усилить, не теряя пользователей и не требуя сброса пароля. + await repository.update_password_hash(user.id, await hash_password(credentials.password)) + await guard.reset(credentials.username) + issued = await sessions.create(user.id) + return Session.from_issued(issued, user) + + +@router.delete( + "/current", + status_code=status.HTTP_204_NO_CONTENT, + summary="Отозвать текущую сессию", +) +async def revoke_session(token: BearerToken, sessions: SessionsDep) -> Response: + """Отзыв действует сразу: тот же токен после него даёт 401. + + Ответ пустой (204), поэтому клиент не получает ни тела, ни нового состояния + сессии. Отзыв — одна атомарная DELETE по отпечатку токена в PostgreSQL. + """ + if not await sessions.revoke(token): + raise unauthorized("Сессия не найдена или истекла") + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/src/messenger/routers/chats.py b/src/messenger/routers/chats.py new file mode 100644 index 0000000..dee42e5 --- /dev/null +++ b/src/messenger/routers/chats.py @@ -0,0 +1,55 @@ +"""Создание, список и чтение чатов.""" +from __future__ import annotations + +from typing import Annotated +from uuid import UUID + +from fastapi import APIRouter, Path, Query, status + +from ..access import visible_chat +from ..cursor import KIND_CHATS +from ..deps import CursorsDep, CurrentUser, RepositoryDep +from ..domain import UnknownMembers +from ..errors import invalid_request +from ..models import DEFAULT_LIMIT, MAX_LIMIT, Chat, ChatPage, CreateChat +from ..pagination import build_next_cursor, decoded_cursor + +router = APIRouter(prefix="/api/v1/chats", tags=["chats"]) + + +@router.post("", status_code=status.HTTP_201_CREATED, summary="Создать чат") +async def create_chat(payload: CreateChat, repository: RepositoryDep, user: CurrentUser) -> Chat: + """Создаёт чат; состав участников задаётся при создании и не меняется.""" + if user.id not in payload.member_ids: + raise invalid_request("Создатель чата обязан входить в member_ids") + try: + record = await repository.create_chat(payload.title, payload.member_ids) + except UnknownMembers: + raise invalid_request("member_ids содержит неизвестных пользователей") from None + return Chat.from_record(record) + + +@router.get("", summary="Чаты текущего пользователя") +async def list_chats( + repository: RepositoryDep, + cursors: CursorsDep, + user: CurrentUser, + limit: Annotated[int, Query(ge=1, le=MAX_LIMIT)] = DEFAULT_LIMIT, + cursor: Annotated[str | None, Query(min_length=1)] = None, +) -> ChatPage: + """Список видимых чатов по (created_at, id) по возрастанию.""" + scope = str(user.id) + after = decoded_cursor(cursors, cursor, kind=KIND_CHATS, scope=scope) + records, has_more = await repository.list_chats(user.id, after, limit) + return ChatPage.from_records( + records, build_next_cursor(cursors, KIND_CHATS, scope, records, has_more) + ) + + +@router.get("/{chat_id}", summary="Получить доступный чат") +async def read_chat( + chat_id: Annotated[UUID, Path()], + repository: RepositoryDep, + user: CurrentUser, +) -> Chat: + return Chat.from_record(await visible_chat(repository, chat_id, user)) diff --git a/src/messenger/routers/health.py b/src/messenger/routers/health.py new file mode 100644 index 0000000..7ac6910 --- /dev/null +++ b/src/messenger/routers/health.py @@ -0,0 +1,46 @@ +"""Проверки живости и готовности.""" +from __future__ import annotations + +from fastapi import APIRouter, Request + +from ..deps import DatabaseDep, SessionsDep, StorageDep +from ..errors import unavailable +from ..models import Health +from ..schema import SCHEMA_REVISION + +router = APIRouter(prefix="/health", tags=["health"]) + + +@router.get("/live", summary="Процесс жив") +async def liveness() -> Health: + """Проверяет только то, что процесс обслуживает запросы. + + Зависимости здесь намеренно не проверяются: их отказ — не повод убивать + контейнер и устраивать цикл перезапусков. + """ + return Health() + + +@router.get("/ready", summary="Готов принимать трафик") +async def readiness( + request: Request, + database: DatabaseDep, + sessions: SessionsDep, + storage: StorageDep, +) -> Health: + """Готовность = процесс не на остановке и критические зависимости отвечают. + + Отказ зависимости превращается в 503 общим обработчиком: у готовности и у + бизнес-операций один и тот же признак неработоспособности. + """ + if getattr(request.app.state, "draining", False): + raise unavailable("Сервис завершает работу и не принимает новые запросы") + await database.ping() + revision = await database.schema_revision() + if revision != SCHEMA_REVISION: + raise unavailable("Схема базы данных ещё не готова") + await sessions.ping() + # S3 — критичная зависимость обязательного синхронного upload/download. + # Без него API не должен получать трафик от балансировщика. + await storage.ping() + return Health() \ No newline at end of file diff --git a/src/messenger/routers/messages.py b/src/messenger/routers/messages.py new file mode 100644 index 0000000..9d61457 --- /dev/null +++ b/src/messenger/routers/messages.py @@ -0,0 +1,74 @@ +"""Отправка и чтение истории сообщений.""" +from __future__ import annotations + +from typing import Annotated +from uuid import UUID + +from fastapi import APIRouter, Header, Path, Query, status + +from ..access import visible_chat +from ..cursor import KIND_MESSAGES +from ..deps import CursorsDep, CurrentUser, RepositoryDep +from ..domain import AttachmentNotReady, AttachmentUnknown, IdempotencyConflict +from ..errors import conflict, not_found +from ..idempotency import message_request_hash, require_idempotency_key +from ..models import DEFAULT_LIMIT, MAX_LIMIT, CreateMessage, Message, MessagePage +from ..pagination import build_next_cursor, decoded_cursor + +router = APIRouter(prefix="/api/v1/chats/{chat_id}/messages", tags=["messages"]) + + +@router.post("", status_code=status.HTTP_201_CREATED, summary="Отправить сообщение") +async def create_message( + chat_id: Annotated[UUID, Path()], + payload: CreateMessage, + repository: RepositoryDep, + user: CurrentUser, + idempotency_key: Annotated[str | None, Header(alias="Idempotency-Key")] = None, +) -> Message: + """Отправитель выводится из идентификации; sender_id в теле не принимается. + + Порядок проверок контракта: аутентификация (зависимость user), доступ к + чату (404 для чужого), затем ключ идемпотентности. Повтор с тем же ключом + и телом возвращает то же сообщение и тот же код 201. + """ + await visible_chat(repository, chat_id, user) + try: + await repository.validate_message_attachments(chat_id, payload.attachment_ids) + except AttachmentUnknown: + # Чужое и несуществующее вложение неотличимы от отсутствующего (404). + raise not_found("Вложение не найдено") from None + except AttachmentNotReady: + raise conflict("Вложение ещё не готово") from None + key = require_idempotency_key(idempotency_key) + try: + record = await repository.append_message_idempotent( + chat_id, + user.id, + payload.text, + payload.attachment_ids, + key, + message_request_hash(payload.text, payload.attachment_ids), + ) + except IdempotencyConflict: + raise conflict("Idempotency-Key уже использован с другим телом запроса") from None + return Message.from_record(record) + + +@router.get("", summary="Сообщения по (created_at, id) по возрастанию") +async def list_messages( + chat_id: Annotated[UUID, Path()], + repository: RepositoryDep, + cursors: CursorsDep, + user: CurrentUser, + limit: Annotated[int, Query(ge=1, le=MAX_LIMIT)] = DEFAULT_LIMIT, + cursor: Annotated[str | None, Query(min_length=1)] = None, +) -> MessagePage: + """Keyset-пагинация: страница читается по индексу, предыдущие не повторяются.""" + await visible_chat(repository, chat_id, user) + scope = str(chat_id) + after = decoded_cursor(cursors, cursor, kind=KIND_MESSAGES, scope=scope) + records, has_more = await repository.list_messages(chat_id, after, limit) + return MessagePage.from_records( + records, build_next_cursor(cursors, KIND_MESSAGES, scope, records, has_more) + ) \ No newline at end of file diff --git a/src/messenger/routers/users.py b/src/messenger/routers/users.py new file mode 100644 index 0000000..86dfb6b --- /dev/null +++ b/src/messenger/routers/users.py @@ -0,0 +1,34 @@ +"""Регистрация и текущий пользователь.""" +from __future__ import annotations + +from fastapi import APIRouter, status + +from ..deps import CurrentUser, RepositoryDep +from ..errors import conflict +from ..models import CreateUser, User +from ..security import hash_password + +router = APIRouter(prefix="/api/v1/users", tags=["users"]) + +USERNAME_TAKEN = "username уже занят" + + +@router.post("", status_code=status.HTTP_201_CREATED, summary="Создать пользователя") +async def register_user(payload: CreateUser, repository: RepositoryDep) -> User: + """Регистрация публична; username уникален, повтор даёт 409.""" + if await repository.username_taken(payload.username): + # Предпроверка экономит KDF на заведомо занятом username; гонку закрывает + # уникальный индекс в create_user, поэтому оба пути дают один и тот же 409. + raise conflict(USERNAME_TAKEN) + record = await repository.create_user( + payload.username, payload.display_name, await hash_password(payload.password) + ) + if record is None: + raise conflict(USERNAME_TAKEN) + return User.from_record(record) + + +@router.get("/me", summary="Текущий пользователь") +async def read_current_user(user: CurrentUser) -> User: + """Владелец Bearer-сессии; пароль и хэш пароля наружу не выходят.""" + return User.from_record(user) diff --git a/src/messenger/schema.py b/src/messenger/schema.py new file mode 100644 index 0000000..0125ae0 --- /dev/null +++ b/src/messenger/schema.py @@ -0,0 +1,414 @@ +"""Описание таблиц PostgreSQL: один источник истины для запросов и миграций.""" +from __future__ import annotations + +from sqlalchemy import ( + BigInteger, + CheckConstraint, + Column, + ForeignKey, + Index, + Integer, + MetaData, + SmallInteger, + Table, + Text, + UniqueConstraint, + text, +) +from sqlalchemy.dialects.postgresql import TIMESTAMP, UUID + +METADATA = MetaData() + +# Версия схемы, которую процесс считает совместимой с собой. Готовность +# проверяет её в alembic_version, поэтому API не начинает принимать трафик +# раньше однократной миграции. +SCHEMA_REVISION = "0006_security" + +USERS = Table( + "users", + METADATA, + Column("id", UUID(as_uuid=True), primary_key=True), + Column("username", Text, nullable=False), + Column("display_name", Text, nullable=False), + Column("password_hash", Text, nullable=False), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + UniqueConstraint("username", name="uq_users_username"), + CheckConstraint(r"username ~ '^[a-z0-9_]{3,32}$'", name="ck_users_username_format"), + CheckConstraint( + "char_length(display_name) BETWEEN 1 AND 100", name="ck_users_display_name_length" + ), +) + +# Серверная сессия: в БД лежит только SHA-256 opaque-токена. Абсолютный +# expires_at общий для всех реплик, поэтому logout/expiry не зависят от того, +# какая реплика обслужила запрос. +SESSIONS = Table( + "sessions", + METADATA, + Column("token_hash", Text, primary_key=True), + Column( + "user_id", + UUID(as_uuid=True), + ForeignKey("users.id", name="fk_sessions_user", ondelete="CASCADE"), + nullable=False, + ), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Column("expires_at", TIMESTAMP(timezone=True), nullable=False), + CheckConstraint(r"token_hash ~ '^[a-f0-9]{64}$'", name="ck_sessions_token_hash"), + Index("ix_sessions_expires_at", "expires_at"), + Index("ix_sessions_user_id", "user_id"), +) + +# Счётчик попыток входа. Одна строка на bucket (username либо глобальный +# bucket); окно и блокировка хранятся абсолютным временем, поэтому лимит +# общий для всех API-реплик и переживает их рестарт. +LOGIN_RATE_LIMITS = Table( + "login_rate_limits", + METADATA, + Column("bucket", Text, primary_key=True), + Column("window_start", TIMESTAMP(timezone=True), nullable=False), + Column("attempts", Integer, nullable=False, server_default=text("0")), + Column("blocked_until", TIMESTAMP(timezone=True), nullable=True), + CheckConstraint("attempts >= 0", name="ck_login_rate_limits_attempts"), + CheckConstraint("char_length(bucket) BETWEEN 1 AND 200", name="ck_login_rate_limits_bucket"), +) + +CHATS = Table( + "chats", + METADATA, + Column("id", UUID(as_uuid=True), primary_key=True), + Column("title", Text, nullable=False), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + CheckConstraint("char_length(title) BETWEEN 1 AND 100", name="ck_chats_title_length"), +) + +CHAT_MEMBERS = Table( + "chat_members", + METADATA, + Column( + "chat_id", + UUID(as_uuid=True), + ForeignKey("chats.id", name="fk_chat_members_chat", ondelete="CASCADE"), + primary_key=True, + ), + Column( + "user_id", + UUID(as_uuid=True), + ForeignKey("users.id", name="fk_chat_members_user", ondelete="RESTRICT"), + primary_key=True, + ), + Index("ix_chat_members_user_id_chat_id", "user_id", "chat_id"), +) + +MESSAGES = Table( + "messages", + METADATA, + Column("id", UUID(as_uuid=True), primary_key=True), + Column( + "chat_id", + UUID(as_uuid=True), + ForeignKey("chats.id", name="fk_messages_chat", ondelete="CASCADE"), + nullable=False, + ), + Column( + "sender_id", + UUID(as_uuid=True), + ForeignKey("users.id", name="fk_messages_sender", ondelete="RESTRICT"), + nullable=False, + ), + Column("text", Text, nullable=False), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + # Пустой текст допустим только вместе с вложениями; это правило проверяет + # API, потому что CHECK не может ссылаться на другую таблицу. + CheckConstraint("char_length(text) <= 4000", name="ck_messages_text_length"), + # Порядок истории (created_at, id) и keyset-предикат обслуживает один индекс. + Index("ix_messages_chat_id_created_at_id", "chat_id", "created_at", "id"), +) + +# Общая идемпотентность отправки сообщения. Область уникальности — +# (пользователь, чат, ключ); тело запроса сравнивается по каноническому хэшу. +# Строка и само сообщение пишутся одной транзакцией, поэтому подтверждённый +# ответ и побочный эффект не могут разойтись. +MESSAGE_IDEMPOTENCY = Table( + "message_idempotency", + METADATA, + Column( + "user_id", + UUID(as_uuid=True), + ForeignKey("users.id", name="fk_message_idempotency_user", ondelete="CASCADE"), + primary_key=True, + ), + Column( + "chat_id", + UUID(as_uuid=True), + ForeignKey("chats.id", name="fk_message_idempotency_chat", ondelete="CASCADE"), + primary_key=True, + ), + Column("idempotency_key", Text, primary_key=True), + Column("request_hash", Text, nullable=False), + Column( + "message_id", + UUID(as_uuid=True), + ForeignKey("messages.id", name="fk_message_idempotency_message", ondelete="CASCADE"), + nullable=False, + ), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + CheckConstraint( + "char_length(idempotency_key) BETWEEN 1 AND 128", + name="ck_message_idempotency_key_length", + ), + Index("ix_message_idempotency_created_at", "created_at"), +) + +# Вложение: метаданные в PostgreSQL, байты — в приватном S3. +# object_key — конечный ключ оригинала (final prefix), staging_key — приватный +# staging-ключ принятого тела. pipeline_version — версия конвейера, результат +# которой сейчас опубликован (0 — результата ещё нет). +ATTACHMENTS = Table( + "attachments", + METADATA, + Column("id", UUID(as_uuid=True), primary_key=True), + Column( + "chat_id", + UUID(as_uuid=True), + ForeignKey("chats.id", name="fk_attachments_chat", ondelete="CASCADE"), + nullable=False, + ), + Column( + "owner_id", + UUID(as_uuid=True), + ForeignKey("users.id", name="fk_attachments_owner", ondelete="RESTRICT"), + nullable=False, + ), + Column("object_key", Text, nullable=False), + Column("staging_key", Text, nullable=False), + Column("pipeline_version", Integer, nullable=False, server_default=text("0")), + Column("filename", Text, nullable=False), + Column("content_type", Text, nullable=False), + Column("size_bytes", BigInteger, nullable=False), + Column("sha256", Text, nullable=False), + Column("status", Text, nullable=False, server_default=text("'queued'")), + Column("error_code", Text, nullable=True), + Column("ready_at", TIMESTAMP(timezone=True), nullable=True), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Column("updated_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + UniqueConstraint("object_key", name="uq_attachments_object_key"), + UniqueConstraint("staging_key", name="uq_attachments_staging_key"), + CheckConstraint("char_length(filename) BETWEEN 1 AND 255", name="ck_attachments_filename_length"), + CheckConstraint("content_type IN ('image/png','image/jpeg')", name="ck_attachments_content_type"), + CheckConstraint( + "size_bytes > 0 AND size_bytes <= 10485760", name="ck_attachments_size_bytes" + ), + CheckConstraint("sha256 ~ '^[a-f0-9]{64}$'", name="ck_attachments_sha256"), + CheckConstraint( + "status IN ('queued','processing','ready','failed')", name="ck_attachments_status" + ), + CheckConstraint("pipeline_version >= 0", name="ck_attachments_pipeline_version"), + CheckConstraint( + "error_code IS NULL OR char_length(error_code) BETWEEN 1 AND 64", + name="ck_attachments_error_code", + ), + Index("ix_attachments_chat_id_created_at_id", "chat_id", "created_at", "id"), + Index("ix_attachments_status_updated_at", "status", "updated_at"), +) + +# Одна логическая работа на (attachment, pipeline_version). job_id не меняется +# при повторной доставке; attempts увеличивается только при управляемом +# захвате lease. replay_of ссылается на исходную failed-работу при явном replay: +# replay создаёт новый job_id, но ключ эффекта остаётся прежним. +JOBS = Table( + "jobs", + METADATA, + Column("id", UUID(as_uuid=True), primary_key=True), + Column( + "attachment_id", + UUID(as_uuid=True), + ForeignKey("attachments.id", name="fk_jobs_attachment", ondelete="CASCADE"), + nullable=False, + ), + Column("pipeline_version", Integer, nullable=False), + Column("type", Text, nullable=False, server_default=text("'attachment.process.v1'")), + Column("state", Text, nullable=False, server_default=text("'queued'")), + Column("attempts", Integer, nullable=False, server_default=text("0")), + Column("max_attempts", Integer, nullable=False), + Column("lease_token", UUID(as_uuid=True), nullable=True), + Column("worker_id", Text, nullable=True), + Column("lease_expires_at", TIMESTAMP(timezone=True), nullable=True), + Column("next_attempt_at", TIMESTAMP(timezone=True), nullable=True), + Column("last_error_code", Text, nullable=True), + # W3C trace context устойчивого принятия upload: relay/worker продолжают + # этот trace, поэтому retry остаётся в том же trace, а не создаёт новый. + Column("traceparent", Text, nullable=True), + Column("tracestate", Text, nullable=True), + Column( + "replay_of", + UUID(as_uuid=True), + ForeignKey("jobs.id", name="fk_jobs_replay_of", ondelete="SET NULL"), + nullable=True, + ), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Column("updated_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Column("finished_at", TIMESTAMP(timezone=True), nullable=True), + CheckConstraint("pipeline_version >= 1", name="ck_jobs_pipeline_version"), + CheckConstraint( + "state IN ('queued','processing','ready','failed','superseded')", + name="ck_jobs_state", + ), + CheckConstraint("attempts >= 0", name="ck_jobs_attempts"), + CheckConstraint("max_attempts >= 1", name="ck_jobs_max_attempts"), + CheckConstraint( + "last_error_code IS NULL OR char_length(last_error_code) BETWEEN 1 AND 64", + name="ck_jobs_last_error_code", + ), + Index("ix_jobs_attachment_id", "attachment_id"), + Index("ix_jobs_state_next_attempt_at", "state", "next_attempt_at"), + Index("ix_jobs_lease_expires_at", "lease_expires_at"), + # Один первичный job на версию; replay-задачи имеют replay_of и не конфликтуют. + Index( + "uq_jobs_initial_attachment_version", + "attachment_id", + "pipeline_version", + unique=True, + postgresql_where=text("replay_of IS NULL"), + ), +) + +# Transactional outbox: строка коммитится вместе с заданием и публикуется +# отдельным relay-процессом. Именно она закрывает разрыв COMMIT/publish. +OUTBOX = Table( + "outbox", + METADATA, + Column("id", BigInteger, primary_key=True, autoincrement=True), + Column( + "job_id", + UUID(as_uuid=True), + ForeignKey("jobs.id", name="fk_outbox_job", ondelete="CASCADE"), + nullable=False, + ), + Column("available_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Column("published_at", TIMESTAMP(timezone=True), nullable=True), + Column("attempts", Integer, nullable=False, server_default=text("0")), + Column("last_error", Text, nullable=True), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Index("ix_outbox_due", "published_at", "available_at"), + Index( + "uq_outbox_pending_job", + "job_id", + unique=True, + postgresql_where=text("published_at IS NULL"), + ), +) + +# Варианты изображения. Ключ эффекта — (attachment_id, pipeline_version, name): +# повторная доставка и повторный запуск версии не создают вторую строку. +# Оригинал хранится в attachments.object_key и в этой таблице не дублируется. +VARIANTS = Table( + "variants", + METADATA, + Column( + "attachment_id", + UUID(as_uuid=True), + ForeignKey("attachments.id", name="fk_variants_attachment", ondelete="CASCADE"), + primary_key=True, + ), + Column("pipeline_version", Integer, primary_key=True), + Column("name", Text, primary_key=True), + Column("content_type", Text, nullable=False), + Column("object_key", Text, nullable=False), + Column("size_bytes", BigInteger, nullable=False), + Column("sha256", Text, nullable=False), + Column("width", Integer, nullable=False), + Column("height", Integer, nullable=False), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + CheckConstraint("pipeline_version >= 1", name="ck_variants_pipeline_version"), + CheckConstraint("name IN ('thumbnail','crop','optimized')", name="ck_variants_name"), + CheckConstraint( + "content_type IN ('image/jpeg','image/png','image/webp')", + name="ck_variants_content_type", + ), + CheckConstraint("size_bytes > 0", name="ck_variants_size_bytes"), + CheckConstraint("width > 0 AND height > 0", name="ck_variants_dimensions"), + CheckConstraint("sha256 ~ '^[a-f0-9]{64}$'", name="ck_variants_sha256"), + UniqueConstraint("object_key", name="uq_variants_object_key"), + Index("ix_variants_attachment_id", "attachment_id"), +) + +# Аудит переходов job: используется оператором и как evidence. Секретов здесь нет. +JOB_EVENTS = Table( + "job_events", + METADATA, + Column("id", BigInteger, primary_key=True, autoincrement=True), + Column( + "job_id", + UUID(as_uuid=True), + ForeignKey("jobs.id", name="fk_job_events_job", ondelete="CASCADE"), + nullable=False, + ), + Column("from_state", Text, nullable=True), + Column("to_state", Text, nullable=False), + Column("attempt", Integer, nullable=True), + Column("error_code", Text, nullable=True), + Column("worker_id", Text, nullable=True), + Column("detail", Text, nullable=True), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + Index("ix_job_events_job_id_created_at", "job_id", "created_at"), +) + +# Реестр явных операторских replay: кто, когда и какую failed-задачу повторил. +JOB_REPLAYS = Table( + "job_replays", + METADATA, + Column("id", UUID(as_uuid=True), primary_key=True), + Column( + "source_job_id", + UUID(as_uuid=True), + ForeignKey("jobs.id", name="fk_job_replays_source", ondelete="CASCADE"), + nullable=False, + ), + Column( + "replay_job_id", + UUID(as_uuid=True), + ForeignKey("jobs.id", name="fk_job_replays_replay", ondelete="CASCADE"), + nullable=False, + ), + Column("requested_by", Text, nullable=False), + Column("reason", Text, nullable=False), + Column("created_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + UniqueConstraint("replay_job_id", name="uq_job_replays_replay_job"), + CheckConstraint("char_length(requested_by) BETWEEN 1 AND 128", name="ck_job_replays_requested_by"), + CheckConstraint("char_length(reason) BETWEEN 1 AND 512", name="ck_job_replays_reason"), +) + +# Тестовый fault-injection: одноразовый флаг в БД переживает restart контейнера +# и потребляется ровно один раз. В prod-окружении флаги запрещены конфигурацией. +FAULT_FLAGS = Table( + "fault_flags", + METADATA, + Column("kind", Text, primary_key=True), + Column("remaining", Integer, nullable=False), + Column("updated_at", TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")), + CheckConstraint("remaining >= 0", name="ck_fault_flags_remaining"), +) + +# Связь сообщения с вложениями. position сохраняет порядок, в котором клиент +# передал attachment_ids; FK не даёт сослаться на несуществующее вложение. +MESSAGE_ATTACHMENTS = Table( + "message_attachments", + METADATA, + Column( + "message_id", + UUID(as_uuid=True), + ForeignKey("messages.id", name="fk_message_attachments_message", ondelete="CASCADE"), + primary_key=True, + ), + Column( + "attachment_id", + UUID(as_uuid=True), + ForeignKey("attachments.id", name="fk_message_attachments_attachment", ondelete="RESTRICT"), + primary_key=True, + ), + Column("position", SmallInteger, nullable=False), + UniqueConstraint("message_id", "position", name="uq_message_attachments_position"), + CheckConstraint("position >= 0 AND position < 10", name="ck_message_attachments_position"), + Index("ix_message_attachments_attachment_id", "attachment_id"), +) \ No newline at end of file diff --git a/src/messenger/secrets_provider.py b/src/messenger/secrets_provider.py new file mode 100644 index 0000000..36b6ee3 --- /dev/null +++ b/src/messenger/secrets_provider.py @@ -0,0 +1,196 @@ +"""Получение рабочих секретов из OpenBao по AppRole, без root token. + +Bootstrap trust: оператор один раз создаёт AppRole и передаёт контейнеру +role_id/secret_id через файлы с ограниченными правами (не в Git, не в образе). +Приложение меняет их на короткоживущий token, читает ровно свой KV-path и +периодически продлевает/переполучает token. Постоянного BAO_TOKEN в +конфигурации нет; при недоступности OpenBao процесс завершается, а не +откатывается на статический секрет. +""" +from __future__ import annotations + +import json +import logging +import os +import ssl +import threading +import time +import urllib.error +import urllib.request +from pathlib import Path +from typing import Mapping + +logger = logging.getLogger("messenger.secrets") + +DEFAULT_ADDR = "https://openbao:8200" +DEFAULT_ROLE_ID_FILE = "/run/secrets/bao_role_id" +DEFAULT_SECRET_ID_FILE = "/run/secrets/bao_secret_id" +DEFAULT_SECRET_PATH = "messenger/api" +DEFAULT_TIMEOUT = 5 + +_lock = threading.Lock() +_token: str | None = None +_lease_seconds: int = 0 +_last_success_at: float = 0.0 +_last_error: str | None = None +_renewer: threading.Thread | None = None + + +class SecretsUnavailable(RuntimeError): + """OpenBao не ответил или отказал в аутентификации. Сообщение без секретов.""" + + +def _required_env(name: str) -> str: + value = os.environ.get(name, "").strip() + if not value: + raise SecretsUnavailable(f"{name} is required") + return value + + +def _file_secret(name: str, default: str) -> str: + path = os.environ.get(name, default) + try: + value = Path(path).read_text(encoding="utf-8").strip() + except OSError: + raise SecretsUnavailable(f"{name} must point to a readable file") from None + if not value: + raise SecretsUnavailable(f"{name} file is empty") + return value + + +def _request(method: str, url: str, payload: dict | None, token: str | None) -> dict: + body = None if payload is None else json.dumps(payload).encode("utf-8") + request = urllib.request.Request(url, data=body, method=method) + request.add_header("Content-Type", "application/json") + if token: + request.add_header("X-Vault-Token", token) + context = None + cacert = os.environ.get("BAO_CACERT", "").strip() + if cacert: + context = ssl.create_default_context(cafile=cacert) + context.check_hostname = True + context.verify_mode = ssl.CERT_REQUIRED + timeout = float(os.environ.get("BAO_TIMEOUT_SECONDS", str(DEFAULT_TIMEOUT))) + try: + with urllib.request.urlopen(request, timeout=timeout, context=context) as response: + return json.loads(response.read().decode("utf-8")) + except urllib.error.HTTPError as exc: + # Тело ошибки OpenBao не содержит секретов; код достаточен для диагностики. + raise SecretsUnavailable(f"OpenBao HTTP {exc.code} for {url}") from None + except (urllib.error.URLError, OSError, ValueError) as exc: + raise SecretsUnavailable(f"OpenBao unavailable: {type(exc).__name__}") from None + + +def _login(addr: str, role_id: str, secret_id: str) -> tuple[str, int]: + response = _request( + "POST", + f"{addr}/v1/auth/approle/login", + {"role_id": role_id, "secret_id": secret_id}, + None, + ) + auth = response.get("auth") or {} + token = str(auth.get("client_token") or "") + if not token: + raise SecretsUnavailable("AppRole login returned no token") + return token, int(auth.get("lease_duration") or 0) + + +def _read_kv(addr: str, path: str, token: str) -> dict[str, str]: + response = _request("GET", f"{addr}/v1/kv/data/{path.lstrip('/')}", None, token) + data = ((response.get("data") or {}).get("data")) or {} + result: dict[str, str] = {} + for key, value in data.items(): + if isinstance(value, (str, int, float, bool)): + result[str(key)] = str(value) + return result + + +def _renew_loop( + addr: str, role_id: str, secret_id: str, lease_seconds: int, interval: float +) -> None: + """Продлевает/переполучает token; ошибки только логируются без значений.""" + global _token, _lease_seconds, _last_success_at, _last_error + while True: + time.sleep(interval) + with _lock: + token = _token + try: + if token: + try: + response = _request("POST", f"{addr}/v1/auth/token/renew-self", {}, token) + auth = response.get("auth") or {} + _lease_seconds = int(auth.get("lease_duration") or lease_seconds) + _last_success_at = time.time() + _last_error = None + logger.info("secrets_token_renewed", extra={"fields": {"lease_seconds": _lease_seconds}}) + continue + except SecretsUnavailable: + # Истёкший/отозванный token: повторный AppRole login, а не + # тихое продолжение с просроченной идентичностью. + pass + new_token, new_lease = _login(addr, role_id, secret_id) + with _lock: + _token = new_token + _lease_seconds = new_lease + _last_success_at = time.time() + _last_error = None + logger.info("secrets_token_reissued", extra={"fields": {"lease_seconds": new_lease}}) + except Exception as exc: + _last_error = type(exc).__name__ + logger.error("secrets_renew_failed", extra={"fields": {"error": _last_error}}) + + +def health() -> dict[str, object]: + """Несекретное состояние для readiness/диагностики.""" + return { + "last_success_at": _last_success_at, + "last_error": _last_error, + "lease_seconds": _lease_seconds, + } + + +def load_service_secrets() -> bool: + """Читает секреты и экспортирует их в окружение до Config.from_env(). + + Возвращает False, если процесс не должен использовать OpenBao (миграции, + операторские CLI). Для API/worker/relay SECRETS_FROM_BAO=1 обязателен. + """ + global _token, _lease_seconds, _last_success_at, _last_error, _renewer + if os.environ.get("SECRETS_FROM_BAO", "").strip().lower() not in ("1", "true", "yes"): + return False + role_id = _file_secret("BAO_ROLE_ID_FILE", DEFAULT_ROLE_ID_FILE) + secret_id = _file_secret("BAO_SECRET_ID_FILE", DEFAULT_SECRET_ID_FILE) + addr = os.environ.get("BAO_ADDR", DEFAULT_ADDR).rstrip("/") + path = os.environ.get("BAO_SECRET_PATH", DEFAULT_SECRET_PATH).strip() or DEFAULT_SECRET_PATH + last_error: Exception | None = None + for attempt in range(30): + try: + token, lease = _login(addr, role_id, secret_id) + values = _read_kv(addr, path, token) + if not values: + raise SecretsUnavailable("OpenBao KV path is empty") + for key, value in values.items(): + os.environ[key] = value + with _lock: + _token = token + _lease_seconds = lease + _last_success_at = time.time() + _last_error = None + logger.info( + "secrets_loaded", + extra={"fields": {"path": path, "keys": sorted(values), "lease_seconds": lease}}, + ) + interval = max(10.0, min(lease * 0.6, 300.0)) if lease else 60.0 + if _renewer is None: + _renewer = threading.Thread( + target=_renew_loop, + args=(addr, role_id, secret_id, lease, interval), + name="openbao-renewer", + daemon=True, + ) + _renewer.start() + return True + except SecretsUnavailable as exc: + last_error = exc + time.sleep(min(2.0 + attempt, 10.0)) + raise SecretsUnavailable(str(last_error) if last_error else "OpenBao bootstrap failed") diff --git a/src/messenger/security.py b/src/messenger/security.py new file mode 100644 index 0000000..becb350 --- /dev/null +++ b/src/messenger/security.py @@ -0,0 +1,155 @@ +"""Пароли и токены: argon2id для пароля, случайный opaque-токен для доступа. + +Пароль не хранится и не передаётся дальше: в базе лежит только строка argon2id. +KDF считает десятки миллисекунд, поэтому вызывается в рабочем потоке — цикл +событий не должен ждать хэширование. +""" +from __future__ import annotations + +import base64 +import binascii +import hashlib +import secrets +from functools import lru_cache + +import anyio +from argon2 import PasswordHasher +from argon2.exceptions import Argon2Error, InvalidHashError + +# Минимальные параметры Argon2id из OWASP Password Storage Cheat Sheet: +# m=19456 КиБ (19 МиБ), t=2, p=1. Память на проверку ограничена осознанно. +TIME_COST = 2 +MEMORY_COST_KIB = 19456 +PARALLELISM = 1 +HASH_BYTES = 32 +SALT_BYTES = 16 + +TOKEN_BYTES = 32 +TOKEN_MIN_LENGTH = 32 + +BASIC_SCHEME = "basic" +BEARER_SCHEME = "bearer" + +_DUMMY_PASSWORD = "messenger-dummy-password-never-matches" + +_hasher = PasswordHasher( + time_cost=TIME_COST, + memory_cost=MEMORY_COST_KIB, + parallelism=PARALLELISM, + hash_len=HASH_BYTES, + salt_len=SALT_BYTES, +) + + +def configure_argon2(memory_kib: int, iterations: int, parallelism: int) -> None: + """Применяет параметры стенда, но не ниже минимума OWASP. + + Параметры Argon2id — часть формата хэша: существующие хэши проверяются + своими параметрами, а `password_needs_rehash` возвращает true, если + текущая конфигурация сильнее записанной. Так старый хэш без миграции + пересчитывается при следующем успешном входе. + """ + global _hasher, MEMORY_COST_KIB, TIME_COST, PARALLELISM + if memory_kib < 19456: + raise ValueError("Argon2id memory must be at least 19456 KiB") + if iterations < 2: + raise ValueError("Argon2id time_cost must be at least 2") + if parallelism < 1: + raise ValueError("Argon2id parallelism must be at least 1") + MEMORY_COST_KIB = memory_kib + TIME_COST = iterations + PARALLELISM = parallelism + _hasher = PasswordHasher( + time_cost=TIME_COST, + memory_cost=MEMORY_COST_KIB, + parallelism=PARALLELISM, + hash_len=HASH_BYTES, + salt_len=SALT_BYTES, + ) + _dummy_hash.cache_clear() + + +def _hash(password: str) -> str: + return _hasher.hash(password) + + +def _verify(password: str, stored_hash: str) -> bool: + """True только при совпадении; неподходящий или испорченный хэш — тоже «нет».""" + try: + return _hasher.verify(stored_hash, password) + except (Argon2Error, InvalidHashError): + return False + + +@lru_cache(maxsize=1) +def _dummy_hash() -> str: + """Хэш-заглушка: нужен, чтобы ответ про неизвестного пользователя стоил столько же.""" + return _hash(_DUMMY_PASSWORD) + + +async def hash_password(password: str) -> str: + """Хэширует пароль; длина пароля ограничена контрактом, усечения нет.""" + return await anyio.to_thread.run_sync(_hash, password) + + +async def verify_password(password: str, stored_hash: str) -> bool: + return await anyio.to_thread.run_sync(_verify, password, stored_hash) + + +def password_needs_rehash(stored_hash: str) -> bool: + """True, если хэш записан с более слабыми/другими параметрами.""" + try: + return _hasher.check_needs_rehash(stored_hash) + except (Argon2Error, InvalidHashError): + return True + + +async def spend_verification_time() -> None: + """Выполняет KDF впустую: время ответа не выдаёт существование пользователя.""" + await anyio.to_thread.run_sync(_verify, _DUMMY_PASSWORD, _dummy_hash()) + + +def new_token() -> str: + """Opaque-токен сессии: 256 бит энтропии, длина не меньше требуемых 32 символов.""" + return secrets.token_urlsafe(TOKEN_BYTES) + + +def token_fingerprint(token: str) -> str: + """Ключ, под которым сессия лежит в хранилище: сам токен там не появляется.""" + return hashlib.sha256(token.encode("utf-8")).hexdigest() + + +def _credentials(header: str | None, scheme: str) -> str | None: + """Хвост заголовка Authorization, если схема совпала; иначе None.""" + if not header: + return None + name, separator, value = header.strip().partition(" ") + if not separator or name.lower() != scheme: + return None + value = value.strip() + return value or None + + +def parse_basic(header: str | None) -> tuple[str, str] | None: + """Разбирает `Authorization: Basic ...` в пару (username, password). + + None означает «заголовка нет, схема не та или значение испорчено»; наружу все + эти случаи дают один и тот же 401, поэтому различать их незачем. + """ + encoded = _credentials(header, BASIC_SCHEME) + if encoded is None: + return None + try: + decoded = base64.b64decode(encoded + "=" * (-len(encoded) % 4), validate=True) + text = decoded.decode("utf-8") + except (binascii.Error, ValueError): + return None + username, separator, password = text.partition(":") + if not separator or not username: + return None + return username, password + + +def parse_bearer(header: str | None) -> str | None: + """Токен из `Authorization: Bearer ...`; None — если заголовок не подходит.""" + return _credentials(header, BEARER_SCHEME) diff --git a/src/messenger/sessions.py b/src/messenger/sessions.py new file mode 100644 index 0000000..144370d --- /dev/null +++ b/src/messenger/sessions.py @@ -0,0 +1,126 @@ +"""Сессии в PostgreSQL: opaque-токен → отпечаток, владелец и абсолютный TTL. + +Токен не хранится ни в БД, ни в логах: первичный ключ — SHA-256 токена. TTL +проверяется на сервере по абсолютному `expires_at`, поэтому перезапуск API или +БД не продлевает сессию. Хранилище общее для всех реплик, иначе logout и +expiry вели бы себя по-разному на разных процессах. +""" +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime, timedelta +from typing import Protocol +from uuid import UUID + +from sqlalchemy import delete, insert, select, text + +from .db import Database +from .domain import rfc3339_z, utc_now +from .security import new_token, token_fingerprint +from .schema import SESSIONS + +TOKEN_MIN_LENGTH = 32 + + +@dataclass(frozen=True) +class SessionState: + """Состояние сессии: владелец и границы жизни.""" + + user_id: UUID + created_at: datetime + expires_at: datetime + + +@dataclass(frozen=True) +class IssuedSession: + """Выданная сессия: сам токен клиент видит ровно один раз.""" + + token: str + state: SessionState + + +class SessionStore(Protocol): + """Контракт хранилища сессий; реализация — PostgreSQL.""" + + async def create(self, user_id: UUID) -> IssuedSession: ... + + async def resolve(self, token: str) -> SessionState | None: ... + + async def revoke(self, token: str) -> bool: ... + + async def ping(self) -> None: ... + + async def close(self) -> None: ... + + +class PostgresSessionStore: + """Сессии в PostgreSQL: общий источник истины для всех API-реплик.""" + + def __init__(self, database: Database, ttl_seconds: int) -> None: + self._database = database + self._ttl_seconds = ttl_seconds + + async def create(self, user_id: UUID) -> IssuedSession: + token = new_token() + created_at = utc_now() + expires_at = created_at + timedelta(seconds=self._ttl_seconds) + async with self._database.session() as session: + await session.execute( + insert(SESSIONS).values( + token_hash=token_fingerprint(token), + user_id=user_id, + created_at=created_at, + expires_at=expires_at, + ) + ) + # Дешёвая уборка просроченных строк: таблица не растёт бесконечно, + # даже если клиенты никогда не повторяют запрос с истёкшим токеном. + await session.execute(delete(SESSIONS).where(SESSIONS.c.expires_at <= utc_now())) + await session.commit() + return IssuedSession(token=token, state=SessionState(user_id, created_at, expires_at)) + + async def resolve(self, token: str) -> SessionState | None: + """Состояние действующей сессии; None — токен неизвестен или срок истёк.""" + async with self._database.session() as session: + row = ( + await session.execute( + select(SESSIONS.c.user_id, SESSIONS.c.created_at, SESSIONS.c.expires_at) + .where( + SESSIONS.c.token_hash == token_fingerprint(token), + SESSIONS.c.expires_at > utc_now(), + ) + .limit(1) + ) + ).first() + if row is None: + return None + return SessionState(user_id=row.user_id, created_at=row.created_at, expires_at=row.expires_at) + + async def revoke(self, token: str) -> bool: + """Отзыв одной атомарной командой; повтор уже отозванного токена — False.""" + async with self._database.session() as session: + result = await session.execute( + delete(SESSIONS) + .where(SESSIONS.c.token_hash == token_fingerprint(token)) + .returning(SESSIONS.c.token_hash) + ) + revoked = result.first() is not None + await session.commit() + return revoked + + async def ping(self) -> None: + async with self._database.session() as session: + await session.execute(text("SELECT 1")) + + async def close(self) -> None: + """Соединения принадлежат Database; отдельного клиента здесь нет.""" + return None + + +def session_debug_fields(state: SessionState) -> dict[str, str]: + """Только несекретные поля сессии для аудита/тестов.""" + return { + "user_id": str(state.user_id), + "created_at": rfc3339_z(state.created_at), + "expires_at": rfc3339_z(state.expires_at), + } diff --git a/src/messenger/storage.py b/src/messenger/storage.py new file mode 100644 index 0000000..5e74b3b --- /dev/null +++ b/src/messenger/storage.py @@ -0,0 +1,316 @@ +"""Приватное S3-хранилище: только байты и служебные операции над объектами. + +Метаданные вложений живут в PostgreSQL; этот модуль не знает о чатах и правах. +Ключ объекта всегда назначает сервер. Ошибки S3 преобразуются в два типа: +`StorageObjectMissing` (404) и `StorageUnavailable` (503), чтобы наружу не +уходили детали boto3/MinIO. +""" +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime, timezone +from typing import Any, BinaryIO + +import anyio +from botocore.config import Config as BotoConfig +from botocore.exceptions import BotoCoreError, ClientError + +from .config import Config + +CHUNK_SIZE = 64 * 1024 +MISSING_CODES = {"404", "NoSuchKey", "NotFound", "NoSuchBucket"} + + +class StorageUnavailable(RuntimeError): + """S3/MinIO не ответил или вернул ошибку, которую нельзя исправить запросом.""" + + +class StorageObjectMissing(RuntimeError): + """Объект отсутствует в bucket (оригинал потерян или ключ неверен).""" + + +@dataclass(frozen=True) +class S3Object: + """Открытый поток объекта и его наблюдаемый размер.""" + + body: Any + size_bytes: int + content_type: str | None + + +@dataclass(frozen=True) +class ObjectInfo: + """Элемент листинга bucket для сверки.""" + + key: str + size_bytes: int + last_modified: datetime + + +@dataclass(frozen=True) +class ObjectHead: + """Наблюдаемые метаданные одного объекта.""" + + key: str + size_bytes: int + content_type: str | None + etag: str + sha256: str | None + + +def _is_missing(error: ClientError) -> bool: + response = getattr(error, "response", {}) or {} + code = str((response.get("Error") or {}).get("Code", "")) + status = int((response.get("ResponseMetadata") or {}).get("HTTPStatusCode", 0) or 0) + return code in MISSING_CODES or status == 404 + + +class S3Storage: + """Один boto3-клиент на процесс; вызовы уходят в рабочий поток.""" + + def __init__(self, config: Config) -> None: + self._bucket = config.s3_bucket + self._prefix = config.s3_key_prefix + boto_config = BotoConfig( + signature_version="s3v4", + s3={"addressing_style": "path"}, + connect_timeout=config.s3_connect_timeout_seconds, + read_timeout=config.s3_read_timeout_seconds, + retries={"max_attempts": config.s3_max_attempts, "mode": "standard"}, + max_pool_connections=32, + ) + import boto3 + + # verify=CA-файл включает проверку цепочки и hostname. Отключение + # проверки (verify=False) не предусмотрено конфигурацией вообще. + verify = config.s3_ca_file if config.s3_ca_file else True + self._client = boto3.session.Session().client( + "s3", + endpoint_url=config.s3_endpoint, + region_name=config.s3_region, + aws_access_key_id=config.s3_access_key_id, + aws_secret_access_key=config.s3_secret_access_key, + verify=verify, + config=boto_config, + ) + + @property + def bucket(self) -> str: + return self._bucket + + @property + def key_prefix(self) -> str: + return self._prefix + + def _key(self, relative: str) -> str: + return f"{self._prefix}{relative}" + + def staging_key(self, attachment_id: str) -> str: + """Приватный staging-ключ принятого тела (до публикации результата).""" + return self._key(f"staging/{attachment_id}") + + def original_key(self, attachment_id: str, pipeline_version: int) -> str: + """Детерминированный конечный ключ оригинала для версии конвейера.""" + return self._key(f"final/{attachment_id}/v{int(pipeline_version)}/original") + + def variant_key(self, attachment_id: str, pipeline_version: int, name: str) -> str: + """Детерминированный ключ варианта: ключ эффекта (id, version, name).""" + if name not in ("thumbnail", "crop", "optimized"): + raise ValueError("unknown variant name") + return self._key(f"final/{attachment_id}/v{int(pipeline_version)}/{name}") + + async def ping(self) -> None: + """Готовность: листинг одного объекта под служебным префиксом. + + Это проверяет и доступность S3, и наличие bucket, и право ListBucket, + которое выдано API-пользователю только на префикс вложений. + """ + try: + await anyio.to_thread.run_sync(self._list_one) + except (BotoCoreError, ClientError, OSError) as exc: + raise StorageUnavailable("S3 не отвечает") from exc + + def _list_one(self) -> None: + # Prefix обязан попадать в разрешённый policy prefix: у API нет права + # листать весь bucket, только свои staging/final-префиксы. + self._client.list_objects_v2( + Bucket=self._bucket, Prefix=f"{self._prefix}staging/", MaxKeys=1 + ) + + async def put( + self, + key: str, + file: BinaryIO, + *, + content_type: str, + size_bytes: int, + sha256: str, + md5_hex: str, + ) -> None: + """Загружает один объект и проверяет, что S3 сохранил ровно эти байты.""" + try: + response = await anyio.to_thread.run_sync( + lambda: self._client.put_object( + Bucket=self._bucket, + Key=key, + Body=file, + ContentLength=size_bytes, + ContentType=content_type, + Metadata={"sha256": sha256}, + ) + ) + except (BotoCoreError, ClientError, OSError) as exc: + raise StorageUnavailable("S3 не принял объект") from exc + etag = str(response.get("ETag", "")).strip('"').lower() + # Для одиночного PUT ETag — MD5 тела; это дешёвая проверка целостности + # передачи. Если S3 не вернул ETag, полагаемся на SHA-256 в метаданных. + if etag and etag != md5_hex.lower(): + try: + await self.delete(key) + except StorageUnavailable: + pass + raise StorageUnavailable("S3 сохранил объект с другим ETag") + + async def open(self, key: str) -> S3Object: + """Открывает объект для потоковой отдачи без redirect.""" + try: + response = await anyio.to_thread.run_sync( + lambda: self._client.get_object(Bucket=self._bucket, Key=key) + ) + except ClientError as exc: + if _is_missing(exc): + raise StorageObjectMissing("Объект отсутствует в S3") from exc + raise StorageUnavailable("S3 не отдал объект") from exc + except (BotoCoreError, OSError) as exc: + raise StorageUnavailable("S3 не отдал объект") from exc + return S3Object( + body=response["Body"], + size_bytes=int(response.get("ContentLength", 0)), + content_type=response.get("ContentType"), + ) + + async def delete(self, key: str) -> None: + try: + await anyio.to_thread.run_sync( + lambda: self._client.delete_object(Bucket=self._bucket, Key=key) + ) + except (BotoCoreError, ClientError, OSError) as exc: + raise StorageUnavailable("S3 не удалил объект") from exc + + async def head(self, key: str) -> ObjectHead: + """Метаданные объекта без скачивания тела.""" + try: + response = await anyio.to_thread.run_sync( + lambda: self._client.head_object(Bucket=self._bucket, Key=key) + ) + except ClientError as exc: + if _is_missing(exc): + raise StorageObjectMissing("Объект отсутствует в S3") from exc + raise StorageUnavailable("S3 не отдал метаданные объекта") from exc + except (BotoCoreError, OSError) as exc: + raise StorageUnavailable("S3 не отдал метаданные объекта") from exc + metadata = response.get("Metadata") or {} + return ObjectHead( + key=key, + size_bytes=int(response.get("ContentLength", 0)), + content_type=response.get("ContentType"), + etag=str(response.get("ETag", "")).strip('"').lower(), + sha256=metadata.get("sha256"), + ) + + async def download_to(self, key: str, path: str) -> int: + """Скачивает объект в файл чанками; возвращает наблюдаемый размер.""" + stored = await self.open(key) + size = 0 + try: + with open(path, "wb") as target: + while True: + chunk = await anyio.to_thread.run_sync(stored.body.read, CHUNK_SIZE) + if not chunk: + break + target.write(chunk) + size += len(chunk) + finally: + close = getattr(stored.body, "close", None) + if close is not None: + close() + if stored.size_bytes and size != stored.size_bytes: + raise StorageUnavailable("Размер скачанного объекта не совпал с ContentLength") + return size + + async def copy(self, source_key: str, target_key: str, *, expected_size: int) -> ObjectHead: + """Серверная копия staging → финальный ключ без буферизации в API/worker.""" + try: + await anyio.to_thread.run_sync( + lambda: self._client.copy_object( + Bucket=self._bucket, + Key=target_key, + CopySource={"Bucket": self._bucket, "Key": source_key}, + MetadataDirective="COPY", + ) + ) + except ClientError as exc: + if _is_missing(exc): + raise StorageObjectMissing("Исходный объект отсутствует в S3") from exc + raise StorageUnavailable("S3 не скопировал объект") from exc + except (BotoCoreError, OSError) as exc: + raise StorageUnavailable("S3 не скопировал объект") from exc + head = await self.head(target_key) + if head.size_bytes != expected_size: + raise StorageUnavailable("Размер скопированного оригинала не совпал") + return head + + async def put_bytes( + self, + key: str, + data: bytes, + *, + content_type: str, + sha256: str, + ) -> ObjectHead: + """Публикует детерминированно сгенерированный вариант из памяти.""" + import hashlib + import io + + md5_hex = hashlib.md5(data).hexdigest() + await self.put( + key, + io.BytesIO(data), + content_type=content_type, + size_bytes=len(data), + sha256=sha256, + md5_hex=md5_hex, + ) + head = await self.head(key) + if head.size_bytes != len(data) or (head.sha256 and head.sha256 != sha256): + raise StorageUnavailable("S3 сохранил вариант с другими метаданными") + return head + + async def list_objects(self, prefix: str | None = None) -> list[ObjectInfo]: + """Объекты под префиксом (по умолчанию весь префикс вложений).""" + try: + return await anyio.to_thread.run_sync(self._list_all, prefix or self._prefix) + except (BotoCoreError, ClientError, OSError) as exc: + raise StorageUnavailable("S3 не отдал список объектов") from exc + + def _list_all(self, prefix: str) -> list[ObjectInfo]: + paginator = self._client.get_paginator("list_objects_v2") + result: list[ObjectInfo] = [] + for page in paginator.paginate(Bucket=self._bucket, Prefix=prefix): + for item in page.get("Contents", []) or []: + last_modified = item["LastModified"] + if last_modified.tzinfo is None: + last_modified = last_modified.replace(tzinfo=timezone.utc) + result.append( + ObjectInfo( + key=str(item["Key"]), + size_bytes=int(item.get("Size", 0)), + last_modified=last_modified, + ) + ) + return result + + async def close(self) -> None: + close = getattr(self._client, "close", None) + if close is not None: + await anyio.to_thread.run_sync(close) diff --git a/src/messenger/telemetry.py b/src/messenger/telemetry.py new file mode 100644 index 0000000..0eafef3 --- /dev/null +++ b/src/messenger/telemetry.py @@ -0,0 +1,498 @@ +"""OpenTelemetry SDK для API, relay и worker: OTLP/HTTP в Collector. + +Границы: +- traces, metrics и logs уходят ТОЛЬКО через OTLP в otel-collector; приложение + не пишет напрямую в Prometheus/Loki/Tempo и не знает их адресов; +- очереди batch-процессоров ограничены, поэтому недоступность telemetry backend + не приводит к бесконечному росту RAM; +- W3C trace context передаётся дальше через job/outbox (traceparent/tracestate); +- тела сообщений, пароли, токены, Authorization и signed URL не попадают в + атрибуты spans/metrics/logs. +""" +from __future__ import annotations + +import logging +import os +import time +from contextlib import contextmanager +from typing import Any, Iterator, Mapping + +from opentelemetry import metrics, trace +from opentelemetry.context import Context +from opentelemetry.baggage.propagation import W3CBaggagePropagator +from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter +from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter +from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter +from opentelemetry.instrumentation.botocore import BotocoreInstrumentor +from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor +from opentelemetry.metrics import Observation +from opentelemetry.propagate import extract, inject, set_global_textmap +from opentelemetry.propagators.composite import CompositePropagator +from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler +from opentelemetry.sdk._logs.export import BatchLogRecordProcessor +from opentelemetry.sdk.metrics import MeterProvider +from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader +from opentelemetry.sdk.resources import Resource +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor +from opentelemetry.sdk.trace.sampling import ( + ALWAYS_OFF, + ALWAYS_ON, + ParentBased, + TraceIdRatioBased, +) +from opentelemetry.trace import SpanKind +from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator + +from . import __version__ +from .logging_setup import JsonFormatter + +DEFAULT_ENDPOINT = "http://otel-collector:4318" +DEFAULT_ENVIRONMENT = "lab" + +# Явные границы гистограмм: ожидаемые задержки HTTP и фоновой обработки. +HTTP_BUCKETS = (0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0) +JOB_BUCKETS = (0.05, 0.1, 0.25, 0.5, 1.0, 2.0, 5.0, 10.0, 30.0, 60.0, 120.0) + +_ENABLED = False +_SERVICE_NAME = os.environ.get("OTEL_SERVICE_NAME", "messenger-api") +_SERVICE_INSTANCE = "" +_ENVIRONMENT = os.environ.get("OTEL_RESOURCE_ATTRIBUTES", "deployment.environment.name=lab") +_TRACER = trace.get_tracer("messenger") +_METER = metrics.get_meter("messenger") +_TRACER_PROVIDER: TracerProvider | None = None +_METER_PROVIDER: MeterProvider | None = None +_LOGGER_PROVIDER: LoggerProvider | None = None + +_http_requests: Any = None +_http_duration: Any = None +_jobs_processed: Any = None +_jobs_duration: Any = None +_attachment_ready: Any = None +_queue_depth: Any = None +_queue_in_flight: Any = None +_queue_oldest_age: Any = None +_worker_busy: Any = None +_worker_capacity: Any = None +_process_cpu: Any = None +_process_memory: Any = None +_process_memory_limit: Any = None + + +class _OtelLogHandler(LoggingHandler): + """Отправляет те же JSON-строки в OTLP, не зацикливая внутренние логи SDK.""" + + def emit(self, record: logging.LogRecord) -> None: # noqa: D401 + if record.name.startswith(("opentelemetry", "urllib3", "botocore", "boto3")): + return + super().emit(record) + + +def _env_flag(name: str, default: bool = False) -> bool: + raw = os.environ.get(name, "").strip().lower() + if not raw: + return default + return raw in ("1", "true", "yes", "on") + + +def _endpoint() -> str: + return os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT", DEFAULT_ENDPOINT).rstrip("/") + + +def _sampler(): + """Читает стандартные OTEL_TRACES_SAMPLER*: head sampling задаётся стендом.""" + name = os.environ.get("OTEL_TRACES_SAMPLER", "parentbased_always_on").strip().lower() + try: + ratio = float(os.environ.get("OTEL_TRACES_SAMPLER_ARG", "1.0")) + except ValueError: + ratio = 1.0 + ratio = min(1.0, max(0.0, ratio)) + if name in ("always_off", "parentbased_always_off"): + root = ALWAYS_OFF + return ParentBased(root) if name.startswith("parentbased") else root + if name in ("traceidratio", "parentbased_traceidratio"): + root = TraceIdRatioBased(ratio) + return ParentBased(root) if name.startswith("parentbased") else root + return ParentBased(ALWAYS_ON) + + +def _resource() -> Resource: + env_name = _environment_name() + attributes: dict[str, Any] = { + "service.name": _SERVICE_NAME, + "service.version": __version__, + "deployment.environment.name": env_name, + } + if _SERVICE_INSTANCE: + attributes["service.instance.id"] = _SERVICE_INSTANCE + return Resource.create(attributes) + + +def _environment_name() -> str: + configured = os.environ.get("OTEL_RESOURCE_ATTRIBUTES", "") + for pair in configured.split(","): + key, _, value = pair.partition("=") + if key.strip() == "deployment.environment.name" and value.strip(): + return value.strip() + return DEFAULT_ENVIRONMENT + + +def setup_telemetry(*, service_name: str, instance_id: str) -> bool: + """Инициализирует OTLP providers. Возвращает False при OTEL_SDK_DISABLED=true.""" + global _ENABLED, _SERVICE_NAME, _SERVICE_INSTANCE, _TRACER, _METER + global _TRACER_PROVIDER, _METER_PROVIDER, _LOGGER_PROVIDER + global _http_requests, _http_duration, _jobs_processed, _jobs_duration + global _attachment_ready, _queue_depth, _queue_in_flight, _queue_oldest_age + global _worker_busy, _worker_capacity, _process_cpu, _process_memory + global _process_memory_limit + + if _env_flag("OTEL_SDK_DISABLED"): + logging.getLogger("messenger.telemetry").warning("telemetry_disabled_by_env") + return False + if _ENABLED: + return True + + _SERVICE_NAME = service_name + _SERVICE_INSTANCE = instance_id + resource = _resource() + endpoint = _endpoint() + export_timeout = float(os.environ.get("OTEL_EXPORTER_OTLP_TIMEOUT", "3")) + # mTLS к Collector: сертификат клиента обязателен, проверка сервера идёт по + # внутреннему CA. Без переменной CERTIFICATE экспорт не стартует, а не + # откатывается на незашифрованный канал. + tls_options: dict[str, str] = {} + for env_name, argument in ( + ("OTEL_EXPORTER_OTLP_CERTIFICATE", "certificate_file"), + ("OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE", "client_certificate_file"), + ("OTEL_EXPORTER_OTLP_CLIENT_KEY", "client_key_file"), + ): + value = os.environ.get(env_name, "").strip() + if value: + tls_options[argument] = value + + tracer_provider = TracerProvider(resource=resource, sampler=_sampler()) + tracer_provider.add_span_processor( + BatchSpanProcessor( + OTLPSpanExporter( + endpoint=f"{endpoint}/v1/traces", timeout=export_timeout, **tls_options + ), + max_queue_size=2048, + schedule_delay_millis=2000, + max_export_batch_size=512, + export_timeout_millis=3000, + ) + ) + trace.set_tracer_provider(tracer_provider) + _TRACER_PROVIDER = tracer_provider + + metric_reader = PeriodicExportingMetricReader( + OTLPMetricExporter( + endpoint=f"{endpoint}/v1/metrics", timeout=export_timeout, **tls_options + ), + export_interval_millis=10000, + export_timeout_millis=5000, + ) + meter_provider = MeterProvider(resource=resource, metric_readers=[metric_reader]) + metrics.set_meter_provider(meter_provider) + _METER_PROVIDER = meter_provider + + logger_provider = LoggerProvider(resource=resource) + logger_provider.add_log_record_processor( + BatchLogRecordProcessor( + OTLPLogExporter( + endpoint=f"{endpoint}/v1/logs", timeout=export_timeout, **tls_options + ), + max_queue_size=2048, + schedule_delay_millis=2000, + max_export_batch_size=512, + export_timeout_millis=3000, + ) + ) + _LOGGER_PROVIDER = logger_provider + handler = _OtelLogHandler(level=logging.NOTSET, logger_provider=logger_provider) + handler.setFormatter(JsonFormatter()) + logging.getLogger().addHandler(handler) + + set_global_textmap( + CompositePropagator([TraceContextTextMapPropagator(), W3CBaggagePropagator()]) + ) + # S3-вызовы становятся span-ами бота/botocore; SQLAlchemy инструментируется + # на конкретном engine в register_db_pool(). + try: + BotocoreInstrumentor().instrument() + except Exception as exc: # инструментация не должна ронять приложение + logging.getLogger("messenger.telemetry").warning( + "botocore_instrumentation_failed", extra={"fields": {"error": type(exc).__name__}} + ) + _TRACER = trace.get_tracer("messenger") + _METER = metrics.get_meter("messenger") + + _http_requests = _METER.create_counter( + "http.server.requests", + unit="1", + description="HTTP-запросы API по шаблону маршрута и классу статуса", + ) + _http_duration = _METER.create_histogram( + "http.server.duration", + unit="s", + description="Длительность HTTP-запросов API", + explicit_bucket_boundaries_advisory=HTTP_BUCKETS, + ) + _jobs_processed = _METER.create_counter( + "jobs.processed", + unit="1", + description="Обработанные задания по типу и результату", + ) + _jobs_duration = _METER.create_histogram( + "jobs.duration", + unit="s", + description="Длительность обработки задания worker-ом", + explicit_bucket_boundaries_advisory=JOB_BUCKETS, + ) + _attachment_ready = _METER.create_histogram( + "attachment.time_to_ready", + unit="s", + description="Время от устойчивого принятия upload до публикации ready", + explicit_bucket_boundaries_advisory=JOB_BUCKETS, + ) + _queue_depth = _METER.create_gauge( + "queue.depth", unit="", description="Заданий в состоянии queued" + ) + _queue_in_flight = _METER.create_gauge( + "queue.in_flight", unit="", description="Заданий в состоянии processing" + ) + _queue_oldest_age = _METER.create_gauge( + "queue.oldest_job.age", + unit="s", + description="Возраст самой старой queued-задачи", + ) + _worker_busy = _METER.create_gauge( + "worker.busy", unit="", description="Занятые слоты worker-а" + ) + _worker_capacity = _METER.create_gauge( + "worker.capacity", unit="", description="Настроенная ёмкость worker-а" + ) + _process_cpu = None + _process_memory = None + _process_memory_limit = None + _register_process_metrics() + _ENABLED = True + logging.getLogger("messenger.telemetry").info( + "telemetry_started", extra={"fields": {"service_name": service_name, "endpoint": endpoint}} + ) + return True + + +def _read_cpu_seconds() -> float | None: + try: + with open("/proc/self/stat", encoding="ascii") as handle: + fields = handle.read().split() + ticks = int(fields[13]) + int(fields[14]) + return ticks / os.sysconf("SC_CLK_TCK") + except (OSError, ValueError, IndexError): + return None + + +def _read_rss_bytes() -> int | None: + try: + with open("/proc/self/statm", encoding="ascii") as handle: + pages = int(handle.read().split()[1]) + return pages * os.sysconf("SC_PAGE_SIZE") + except (OSError, ValueError, IndexError): + return None + + +def _read_memory_limit() -> int | None: + for path in ("/sys/fs/cgroup/memory.max", "/sys/fs/cgroup/memory/memory.limit_in_bytes"): + try: + with open(path, encoding="ascii") as handle: + raw = handle.read().strip() + if raw and raw != "max": + value = int(raw) + # cgroup v1 без лимита отдаёт огромное число. + if value < (1 << 62): + return value + except (OSError, ValueError): + continue + return None + + +def _register_process_metrics() -> None: + def cpu_callback(_options): + current = _read_cpu_seconds() + return [] if current is None else [Observation(current)] + + _METER.create_observable_counter( + "process.cpu.seconds", + callbacks=[cpu_callback], + unit="s", + description="Потреблённое процессом CPU-время (user+system), монотонно", + ) + + def rss_callback(_options): + rss = _read_rss_bytes() + return [] if rss is None else [Observation(rss)] + + _METER.create_observable_gauge( + "process.memory.usage", + callbacks=[rss_callback], + unit="By", + description="RSS процесса", + ) + + def limit_callback(_options): + limit = _read_memory_limit() + return [] if limit is None else [Observation(limit)] + + _METER.create_observable_gauge( + "process.memory.limit", + callbacks=[limit_callback], + unit="By", + description="Лимит памяти cgroup контейнера", + ) + + +def register_db_pool(engine) -> None: + """Публикует used/capacity/waiting пула SQLAlchemy (одна серия на процесс).""" + if not _ENABLED: + return + try: + SQLAlchemyInstrumentor().instrument(engine=engine.sync_engine) + except Exception as exc: + logging.getLogger("messenger.telemetry").warning( + "sqlalchemy_instrumentation_failed", extra={"fields": {"error": type(exc).__name__}} + ) + pool = engine.sync_engine.pool + + def callback(_options): + try: + checked_out = float(pool.checkedout()) + # size()/overflow() — текущие значения; ёмкость задаётся maxsize. + maxsize = getattr(getattr(pool, "_pool", None), "maxsize", None) + max_overflow = getattr(pool, "_max_overflow", 0) or 0 + capacity = float((maxsize if maxsize is not None else pool.size()) + max_overflow) + waiting = float(getattr(type(pool), "waiting", 0) or 0) + except Exception: + return [] + return [ + Observation(checked_out, {"state": "used"}), + Observation(capacity, {"state": "capacity"}), + Observation(waiting, {"state": "waiting"}), + ] + + _METER.create_observable_gauge( + "db.pool.connections", + callbacks=[callback], + unit="", + description="Соединения пула PostgreSQL: used/capacity/waiting", + ) + + +def shutdown_telemetry() -> None: + """Сбрасывает ограниченные очереди перед выходом процесса.""" + global _ENABLED + if not _ENABLED: + return + _ENABLED = False + for provider in (_TRACER_PROVIDER, _METER_PROVIDER, _LOGGER_PROVIDER): + try: + if provider is not None: + provider.shutdown() + except Exception: + pass + + +def current_trace_context() -> dict[str, str]: + """traceparent/tracestate активного span-а для сохранения в job/outbox.""" + carrier: dict[str, str] = {} + try: + inject(carrier) + except Exception: + return {} + return {key: value for key, value in carrier.items() if value} + + +def context_from_trace(traceparent: str | None, tracestate: str | None = None): + """Извлекает W3C-контекст из job/сообщения; None — новый корневой trace.""" + if not traceparent: + return None + carrier = {"traceparent": traceparent} + if tracestate: + carrier["tracestate"] = tracestate + try: + return extract(carrier) + except Exception: + return None + + +def format_trace_context(carrier: Mapping[str, str]) -> tuple[str | None, str | None]: + return carrier.get("traceparent"), carrier.get("tracestate") + + +@contextmanager +def start_span( + name: str, + *, + kind: SpanKind = SpanKind.INTERNAL, + context=None, + attributes: Mapping[str, Any] | None = None, +) -> Iterator[Any]: + """Span с автоматическим ERROR-статусом при исключении.""" + with _TRACER.start_as_current_span( + name, + context=context or Context(), + kind=kind, + attributes=dict(attributes or {}), + record_exception=True, + set_status_on_exception=True, + ) as span: + yield span + + +def record_http_request( + *, method: str, route: str, status: int, duration_seconds: float +) -> None: + if not _ENABLED: + return + attributes = { + "http.request.method": method, + "http.route": route, + "http.response.status_code": int(status), + "http.response.status_class": f"{status // 100}xx", + } + _http_requests.add(1, attributes) + _http_duration.record(duration_seconds, attributes) + + +def record_job(*, job_type: str, outcome: str, duration_seconds: float) -> None: + if not _ENABLED: + return + attributes = {"job.type": job_type, "job.outcome": outcome} + _jobs_processed.add(1, attributes) + _jobs_duration.record(duration_seconds, attributes) + + +def record_time_to_ready(*, pipeline_version: int, seconds: float) -> None: + if not _ENABLED or seconds < 0: + return + _attachment_ready.record(seconds, {"pipeline.version": int(pipeline_version)}) + + +def record_queue(*, queue: str, depth: int, in_flight: int, oldest_age: float) -> None: + if not _ENABLED: + return + attributes = {"queue.name": queue} + _queue_depth.set(depth, attributes) + _queue_in_flight.set(in_flight, attributes) + _queue_oldest_age.set(oldest_age, attributes) + + +def record_worker(*, busy: int, capacity: int) -> None: + if not _ENABLED: + return + _worker_busy.set(busy) + _worker_capacity.set(capacity) + + +def now_seconds() -> float: + return time.monotonic() \ No newline at end of file diff --git a/src/messenger/upload.py b/src/messenger/upload.py new file mode 100644 index 0000000..896ea5f --- /dev/null +++ b/src/messenger/upload.py @@ -0,0 +1,100 @@ +"""Потоковый приём тела загрузки: диск вместо RAM и ранние лимиты.""" +from __future__ import annotations + +import hashlib +import os +import tempfile +from dataclasses import dataclass + +import anyio +from starlette.requests import ClientDisconnect, Request + +from .config import Config +from .errors import payload_too_large, unsupported_media_type +from .images import ImageInfo, ImageTooLarge, UnsupportedImage, inspect_image + +READ_CHUNK = 64 * 1024 + + +@dataclass +class SpooledImage: + """Принятое тело на временном диске и его измеренные характеристики.""" + + path: str + size_bytes: int + sha256: str + md5: str + info: ImageInfo + + def cleanup(self) -> None: + try: + os.unlink(self.path) + except OSError: + pass + + +async def receive_image(request: Request, *, expected_content_type: str, config: Config) -> SpooledImage: + """Читает ровно один файл, не поднимая всё тело в память. + + `request.stream()` отдаёт чанки по мере прихода; счётчик байт обрывает + передачу сразу после превышения предела. Временный файл нужен только как + staging до S3; после запроса он удаляется (или ОС уберёт его при падении + процесса). В PostgreSQL и локальном каталоге API оригинал не остаётся. + """ + handle = tempfile.NamedTemporaryFile(prefix="upload-", suffix=".bin", delete=False) + path = handle.name + size = 0 + sha = hashlib.sha256() + md5 = hashlib.md5() + try: + try: + async for chunk in request.stream(): + if not chunk: + continue + size += len(chunk) + if size > config.max_upload_bytes: + raise payload_too_large( + f"Файл больше {config.max_upload_bytes} байт" + ) + handle.write(chunk) + sha.update(chunk) + md5.update(chunk) + except ClientDisconnect as exc: + raise unsupported_media_type("Загрузка прервана клиентом") from exc + finally: + handle.close() + if size == 0: + raise unsupported_media_type("Пустое тело загрузки") + try: + info = await anyio.to_thread.run_sync( + lambda: inspect_image( + path, + expected_content_type=expected_content_type, + max_pixels=config.max_image_pixels, + ) + ) + except ImageTooLarge: + raise payload_too_large( + f"Изображение превышает {config.max_image_pixels} пикселей" + ) from None + except UnsupportedImage: + raise unsupported_media_type( + "Содержимое не является корректным PNG/JPEG" + ) from None + return SpooledImage( + path=path, + size_bytes=size, + sha256=sha.hexdigest(), + md5=md5.hexdigest(), + info=info, + ) + except BaseException: + try: + handle.close() + except Exception: + pass + try: + os.unlink(path) + except OSError: + pass + raise diff --git a/src/messenger/worker.py b/src/messenger/worker.py new file mode 100644 index 0000000..1def82f --- /dev/null +++ b/src/messenger/worker.py @@ -0,0 +1,629 @@ +"""Worker: отдельный процесс, который выполняет задания из RabbitMQ. + +Границы: +- claim в PostgreSQL под lease — единственный способ получить право на эффект; +- S3-объекты публикуются под детерминированными ключами (id, version, variant); +- результат (variants + attachment ready + job ready) фиксируется одной + транзакцией, и только после неё отправляется consumer ack; +- ошибки делятся на постоянные и временные; временные уходят в outbox-retry с + backoff и jitter, постоянные/исчерпанные — в failed и DLQ. +""" +from __future__ import annotations + +import asyncio +import hashlib +import logging +import os +import signal +import tempfile +import time +from datetime import datetime, timezone +from pathlib import Path +from uuid import UUID + +import anyio +from aio_pika.abc import AbstractIncomingMessage +from opentelemetry.trace import SpanKind, Status, StatusCode + +from . import telemetry +from .broker import Broker, InvalidJobMessage, build_payload, parse_payload +from .config import Config, ConfigError +from .db import Database +from .jobs import Claim, JobRecord, JobRepository +from .logging_setup import configure_logging, log +from .secrets_provider import SecretsUnavailable, load_service_secrets +from .pipeline import ( + CorruptOriginal, + GeneratedVariant, + PermanentPipelineError, + PipelineError, + render_variants, +) +from .storage import S3Storage, StorageObjectMissing, StorageUnavailable + +logger = logging.getLogger("messenger.worker") + +HEARTBEAT_FILE = os.environ.get("HEARTBEAT_FILE", "/tmp/messenger-worker-heartbeat") +HEARTBEAT_SECONDS = 5.0 +EXIT_CRASH_BEFORE_OBJECTS = 42 +EXIT_CRASH_AFTER_OBJECTS = 43 + + +class TransientJobError(Exception): + """Временная ошибка: job вернётся в очередь с backoff.""" + + def __init__(self, code: str = "processing_failed", message: str = "") -> None: + super().__init__(message or code) + self.code = code + + +def _md5(path: str) -> str: + digest = hashlib.md5() + with open(path, "rb") as handle: + for chunk in iter(lambda: handle.read(64 * 1024), b""): + digest.update(chunk) + return digest.hexdigest() + + +def _sha256(path: str) -> str: + digest = hashlib.sha256() + with open(path, "rb") as handle: + for chunk in iter(lambda: handle.read(64 * 1024), b""): + digest.update(chunk) + return digest.hexdigest() + + +def _heartbeat() -> None: + try: + Path(HEARTBEAT_FILE).write_text(str(time.time()), encoding="ascii") + except OSError: + pass + + +class Worker: + def __init__(self, config: Config) -> None: + self._config = config + self._database = Database(config) + self._storage = S3Storage(config) + self._jobs = JobRepository(self._database, config) + self._broker = Broker(config, manage_topology=False) + self._semaphore = asyncio.Semaphore(config.worker_concurrency) + self._active: set[asyncio.Task] = set() + self._stop = asyncio.Event() + self._queue = None + self._deliveries = 0 + + def request_stop(self) -> None: + self._stop.set() + + async def _heartbeat_loop(self) -> None: + while not self._stop.is_set(): + _heartbeat() + try: + await asyncio.wait_for(self._stop.wait(), timeout=HEARTBEAT_SECONDS) + except asyncio.TimeoutError: + continue + + async def _metrics_loop(self) -> None: + """Публикует занятость worker-а; queue depth/age отдаёт API. + + Если бы очередь считал только worker, его остановка «замораживала» бы + gauge и скрывала причину инцидента. + """ + while not self._stop.is_set(): + try: + busy = self._config.worker_concurrency - self._semaphore._value + telemetry.record_worker( + busy=int(busy), capacity=int(self._config.worker_concurrency) + ) + except Exception as exc: + log( + logger, + logging.WARNING, + "metrics_collect_failed", + error=type(exc).__name__, + ) + try: + await asyncio.wait_for(self._stop.wait(), timeout=5.0) + except asyncio.TimeoutError: + continue + + async def run(self) -> None: + log( + logger, + logging.INFO, + "worker_startup", + worker_id=self._config.worker_id, + pipeline_version=self._config.pipeline_version, + concurrency=self._config.worker_concurrency, + prefetch=self._config.worker_prefetch, + lease_seconds=self._config.job_lease_seconds, + max_attempts=self._config.job_max_attempts, + queue=self._broker.queue_name, + ) + await self._broker.connect() + _heartbeat() + heartbeat_task = asyncio.create_task(self._heartbeat_loop()) + metrics_task = asyncio.create_task(self._metrics_loop()) + self._queue = await self._broker.consume( + self._on_message, prefetch=self._config.worker_prefetch + ) + try: + await self._stop.wait() + finally: + self._stop.set() + if self._queue is not None: + try: + await self._queue.cancel() + except Exception: + pass + pending = [task for task in self._active if not task.done()] + if pending: + log( + logger, + logging.INFO, + "worker_drain", + active=len(pending), + timeout_seconds=self._config.graceful_shutdown_seconds, + ) + done, still = await asyncio.wait( + pending, timeout=self._config.graceful_shutdown_seconds + ) + for task in still: + task.cancel() + if still: + await asyncio.gather(*still, return_exceptions=True) + heartbeat_task.cancel() + metrics_task.cancel() + await asyncio.gather(heartbeat_task, metrics_task, return_exceptions=True) + await self._broker.close() + await self._storage.close() + await self._database.dispose() + log(logger, logging.INFO, "worker_stopped", deliveries=self._deliveries) + + async def _on_message(self, message: AbstractIncomingMessage) -> None: + task = asyncio.current_task() + if task is not None: + self._active.add(task) + started = time.perf_counter() + outcome = "error" + try: + async with self._semaphore: + outcome = await self._handle(message) + except asyncio.CancelledError: + raise + except Exception as exc: # последняя линия: не терять сообщение молча + log( + logger, + logging.ERROR, + "worker_handle_failed", + exc_info=exc, + error=type(exc).__name__, + ) + try: + await message.nack(requeue=True) + except Exception: + pass + finally: + telemetry.record_job( + job_type="attachment.process.v1", + outcome=outcome, + duration_seconds=time.perf_counter() - started, + ) + if task is not None: + self._active.discard(task) + + async def _handle(self, message: AbstractIncomingMessage) -> str: + self._deliveries += 1 + delivery_count = (message.headers or {}).get("x-delivery-count") + try: + payload = parse_payload(message.body) + except InvalidJobMessage as exc: + log( + logger, + logging.WARNING, + "invalid_job_message", + error=str(exc), + delivery_count=delivery_count, + ) + await message.nack(requeue=False) + return "invalid" + job_id = UUID(payload["job_id"]) + parent = telemetry.context_from_trace( + payload.get("traceparent"), payload.get("tracestate") + ) + with telemetry.start_span( + "job.process " + str(payload["type"]), + kind=SpanKind.CONSUMER, + context=parent, + attributes={ + "messaging.system": "rabbitmq", + "messaging.destination.name": self._broker.queue_name, + "messaging.operation": "process", + "job.id": str(job_id), + "job.type": payload["type"], + "job.attempt": payload["attempt"], + }, + ) as span: + return await self._handle_claim(message, payload, job_id, delivery_count, span) + + async def _handle_claim( + self, + message: AbstractIncomingMessage, + payload: dict, + job_id: UUID, + delivery_count, + span, + ) -> str: + claim = await self._jobs.claim( + job_id, worker_id=self._config.worker_id, lease_seconds=self._config.job_lease_seconds + ) + if not claim.granted: + span.set_attribute("job.outcome", "noop") + span.set_attribute("job.noop_reason", claim.reason) + log( + logger, + logging.INFO, + "delivery_noop", + job_id=str(job_id), + reason=claim.reason, + message_attempt=payload["attempt"], + delivery_count=delivery_count, + ) + await message.ack() + return "noop" + + assert claim.job is not None and claim.attachment is not None and claim.lease_token is not None + job = claim.job + span.set_attribute("job.pipeline_version", job.pipeline_version) + span.set_attribute("job.attempts", job.attempts) + span.set_attribute("attachment.id", str(job.attachment_id)) + log( + logger, + logging.INFO, + "job_claimed", + job_id=str(job.id), + attachment_id=str(job.attachment_id), + pipeline_version=job.pipeline_version, + attempt=job.attempts, + worker_id=self._config.worker_id, + message_attempt=payload["attempt"], + delivery_count=delivery_count, + ) + fault = await self._jobs.consume_fault() + if fault == "crash_before_objects": + log(logger, logging.WARNING, "fault_crash_before_objects", job_id=str(job.id)) + os._exit(EXIT_CRASH_BEFORE_OBJECTS) + if fault in ("transient_once", "transient_always"): + log( + logger, + logging.WARNING, + "fault_transient", + job_id=str(job.id), + kind=fault, + ) + span.set_attribute("fault.kind", fault) + span.set_status(Status(StatusCode.ERROR)) + outcome = await self._jobs.fail( + job_id=job.id, + lease_token=claim.lease_token, + worker_id=self._config.worker_id, + error_code="storage_unavailable", + permanent=False, + ) + await message.ack() + return "retry" if outcome == "retry" else "failed" + if fault == "permanent_once": + log(logger, logging.WARNING, "fault_permanent_once", job_id=str(job.id)) + span.set_attribute("fault.kind", fault) + span.set_status(Status(StatusCode.ERROR)) + outcome = await self._jobs.fail( + job_id=job.id, + lease_token=claim.lease_token, + worker_id=self._config.worker_id, + error_code="invalid_image", + permanent=True, + ) + await message.nack(requeue=False) + return "failed" if outcome == "failed" else outcome + + lease_stop = asyncio.Event() + if fault == "stuck_before_commit": + # Учебный зависший worker: lease не продлевается, reaper вернёт job + # в очередь, а более поздний commit старого attempt будет отклонён. + stuck_seconds = self._config.job_lease_seconds + 5.0 + log( + logger, + logging.WARNING, + "fault_stuck_before_commit", + job_id=str(job.id), + seconds=stuck_seconds, + ) + span.set_attribute("fault.kind", fault) + await asyncio.sleep(stuck_seconds) + lease_task = asyncio.create_task(self._lease_loop(job, claim.lease_token, lease_stop)) + tempdir = tempfile.mkdtemp(prefix=f"job-{job.id}-") + generated: list[GeneratedVariant] = [] + try: + generated, outcome = await asyncio.wait_for( + self._process(job, claim, tempdir, fault), + timeout=self._config.job_timeout_seconds, + ) + span.set_attribute("job.outcome", outcome) + if outcome == "ready": + ready_seconds = (datetime.now(timezone.utc) - claim.attachment.created_at).total_seconds() + telemetry.record_time_to_ready( + pipeline_version=job.pipeline_version, seconds=ready_seconds + ) + else: + span.set_status(Status(StatusCode.ERROR)) + await message.ack() + return outcome + except PermanentPipelineError as exc: + span.set_attribute("error.code", exc.code) + span.set_status(Status(StatusCode.ERROR)) + return await self._fail(job, claim, message, exc.code, permanent=True, requeue=False) + except StorageObjectMissing as exc: + span.set_status(Status(StatusCode.ERROR)) + return await self._fail( + job, claim, message, "original_missing", permanent=True, requeue=False + ) + except asyncio.TimeoutError: + log( + logger, + logging.WARNING, + "job_timeout", + job_id=str(job.id), + timeout_seconds=self._config.job_timeout_seconds, + ) + span.set_attribute("error.code", "processing_timeout") + span.set_status(Status(StatusCode.ERROR)) + return await self._fail(job, claim, message, "processing_timeout", permanent=False, requeue=True) + except (StorageUnavailable, TransientJobError) as exc: + code = getattr(exc, "code", "storage_unavailable") + span.set_attribute("error.code", code) + span.set_status(Status(StatusCode.ERROR)) + return await self._fail(job, claim, message, code, permanent=False, requeue=True) + except PipelineError as exc: + span.set_attribute("error.code", exc.code) + span.set_status(Status(StatusCode.ERROR)) + return await self._fail( + job, claim, message, exc.code, permanent=exc.permanent, requeue=not exc.permanent + ) + except Exception as exc: + log( + logger, + logging.ERROR, + "job_processing_exception", + exc_info=exc, + job_id=str(job.id), + error=type(exc).__name__, + ) + span.set_status(Status(StatusCode.ERROR)) + return await self._fail( + job, claim, message, "processing_failed", permanent=False, requeue=True + ) + finally: + lease_stop.set() + lease_task.cancel() + await asyncio.gather(lease_task, return_exceptions=True) + for item in generated: + item.cleanup() + try: + for name in os.listdir(tempdir): + try: + os.unlink(os.path.join(tempdir, name)) + except OSError: + pass + os.rmdir(tempdir) + except OSError: + pass + + async def _fail( + self, + job: JobRecord, + claim: Claim, + message: AbstractIncomingMessage, + code: str, + *, + permanent: bool, + requeue: bool, + ) -> str: + assert claim.lease_token is not None + try: + outcome = await self._jobs.fail( + job_id=job.id, + lease_token=claim.lease_token, + worker_id=self._config.worker_id, + error_code=code, + permanent=permanent, + ) + except Exception as exc: + log( + logger, + logging.ERROR, + "job_fail_persist_failed", + exc_info=exc, + job_id=str(job.id), + ) + # Не подтверждаем сообщение, если не смогли сохранить причину. + await message.nack(requeue=True) + return "error" + log( + logger, + logging.INFO, + "job_failed" if outcome == "failed" else "job_retry_scheduled", + job_id=str(job.id), + outcome=outcome, + error_code=code, + attempts=job.attempts, + permanent=permanent, + ) + if outcome == "failed": + await message.nack(requeue=False) + return "failed" + if outcome == "retry": + await message.ack() + return "retry" + await message.ack() + return outcome + + async def _lease_loop(self, job: JobRecord, token: UUID, stop: asyncio.Event) -> None: + interval = max(1.0, self._config.job_lease_seconds / 3.0) + while not stop.is_set(): + try: + await asyncio.wait_for(stop.wait(), timeout=interval) + return + except asyncio.TimeoutError: + pass + try: + extended = await self._jobs.extend_lease( + job.id, token, self._config.job_lease_seconds + ) + except Exception as exc: + log( + logger, + logging.WARNING, + "lease_extend_failed", + exc_info=exc, + job_id=str(job.id), + ) + continue + if not extended: + log(logger, logging.WARNING, "lease_lost", job_id=str(job.id)) + return + + async def _process( + self, + job: JobRecord, + claim: Claim, + tempdir: str, + fault: str | None, + ) -> tuple[list[GeneratedVariant], str]: + attachment = claim.attachment + assert attachment is not None and claim.lease_token is not None + original_path = os.path.join(tempdir, "original") + downloaded = await self._storage.download_to(attachment.staging_key, original_path) + if downloaded != attachment.size_bytes or _sha256(original_path) != attachment.sha256: + raise CorruptOriginal("Оригинал в staging повреждён") + generated = await anyio.to_thread.run_sync( + lambda: render_variants( + original_path, + pipeline_version=job.pipeline_version, + workdir=tempdir, + max_pixels=self._config.max_image_pixels, + ) + ) + original_key = self._storage.original_key(str(attachment.id), job.pipeline_version) + await self._storage.copy( + attachment.staging_key, original_key, expected_size=attachment.size_bytes + ) + variant_keys: dict[str, str] = {} + for variant in generated: + key = self._storage.variant_key( + str(attachment.id), job.pipeline_version, variant.name + ) + with open(variant.path, "rb") as handle: + await self._storage.put( + key, + handle, + content_type=variant.content_type, + size_bytes=variant.size_bytes, + sha256=variant.sha256, + md5_hex=_md5(variant.path), + ) + variant_keys[variant.name] = key + if fault == "crash_after_objects": + log( + logger, + logging.WARNING, + "fault_crash_after_objects_before_commit", + job_id=str(job.id), + objects=len(variant_keys) + 1, + ) + os._exit(EXIT_CRASH_AFTER_OBJECTS) + outcome = await self._jobs.complete( + job_id=job.id, + lease_token=claim.lease_token, + worker_id=self._config.worker_id, + original_key=original_key, + variants=generated, + variant_keys=variant_keys, + ) + if outcome != "ready": + log( + logger, + logging.WARNING, + "job_complete_not_applied", + job_id=str(job.id), + outcome=outcome, + ) + return generated, outcome + # Staging — общий вход для всех версий. Удаляем его только когда нет + # другой активной job этого вложения (например, более новой версии). + try: + if await self._jobs.has_other_active_jobs(attachment.id, job.id): + log( + logger, + logging.INFO, + "staging_cleanup_deferred_active_job", + job_id=str(job.id), + attachment_id=str(attachment.id), + ) + else: + await self._storage.delete(attachment.staging_key) + except Exception as exc: + log( + logger, + logging.WARNING, + "staging_cleanup_deferred", + exc_info=exc, + job_id=str(job.id), + ) + log( + logger, + logging.INFO, + "job_ready", + job_id=str(job.id), + attachment_id=str(attachment.id), + pipeline_version=job.pipeline_version, + variants=[variant.name for variant in generated], + attempt=job.attempts, + ) + return generated, "ready" + + +async def _run() -> int: + try: + load_service_secrets() + config = Config.from_env() + config.require_broker() + except (ConfigError, SecretsUnavailable) as exc: + print(f"config error: {exc}", file=os.sys.stderr) + return 2 + logger_root = configure_logging(config.log_level, config.env) + telemetry.setup_telemetry(service_name="messenger-worker", instance_id=config.worker_id) + worker = Worker(config) + telemetry.register_db_pool(worker._database.engine) + loop = asyncio.get_running_loop() + for sig in (signal.SIGTERM, signal.SIGINT): + try: + loop.add_signal_handler(sig, worker.request_stop) + except (NotImplementedError, RuntimeError): + signal.signal(sig, lambda *_: worker.request_stop()) + try: + await worker.run() + except Exception as exc: + log(logger_root, logging.ERROR, "worker_fatal", exc_info=exc) + return 1 + finally: + telemetry.shutdown_telemetry() + return 0 + + +def main() -> int: + return asyncio.run(_run()) + + +if __name__ == "__main__": + raise SystemExit(main()) \ No newline at end of file diff --git a/src/messenger/worker_health.py b/src/messenger/worker_health.py new file mode 100644 index 0000000..ff682d8 --- /dev/null +++ b/src/messenger/worker_health.py @@ -0,0 +1,22 @@ +"""Проверка живости worker/relay по heartbeat-файлу для Docker HEALTHCHECK.""" +from __future__ import annotations + +import os +import time +from pathlib import Path + +DEFAULT_TIMEOUT_SECONDS = 30.0 + + +def main() -> int: + path = Path(os.environ.get("HEARTBEAT_FILE", "/tmp/messenger-worker-heartbeat")) + timeout = float(os.environ.get("HEARTBEAT_TIMEOUT_SECONDS", DEFAULT_TIMEOUT_SECONDS)) + try: + age = time.time() - path.stat().st_mtime + except OSError: + return 1 + return 0 if age <= timeout else 1 + + +if __name__ == "__main__": + raise SystemExit(main())