Repository navigation
Description
Summary
A security scan using Trivy has detected 5 vulnerabilities (1 CRITICAL, 4 HIGH) in the torrust/tracker:develop Docker image. These vulnerabilities affect core system libraries in the Debian 12.11 base image.
Scan Results
Command executed:
trivy image \
--severity HIGH,CRITICAL \
--exit-code 1 \
torrust/tracker:developOutput:
torrust/tracker:develop (debian 12.11)
======================================
Total: 5 (HIGH: 4, CRITICAL: 1)
+---------+------------------+----------+-------------------+--------------+-----------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION| TITLE |
+---------+------------------+----------+-------------------+--------------+-----------------------------------------+
| libc6 | CVE-2019-1010022 | CRITICAL | 2.36-9+deb12u10 | | glibc: stack guard protection bypass |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1010022 |
+ +------------------+----------+ +--------------+-----------------------------------------+
| | CVE-2018-20796 | HIGH | | | glibc: uncontrolled recursion in |
| | | | | | function check_dst_limits_calc_pos_1 |
| | | | | | in posix/regexec.c |
| | | | | | -->avd.aquasec.com/nvd/cve-2018-20796 |
+ +------------------+ + +--------------+-----------------------------------------+
| | CVE-2019-1010023 | | | | glibc: running ldd on malicious ELF |
| | | | | | leads to code execution because of... |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1010023 |
+ +------------------+ + +--------------+-----------------------------------------+
| | CVE-2019-9192 | | | | glibc: uncontrolled recursion in |
| | | | | | function check_dst_limits_calc_pos_1 |
| | | | | | in posix/regexec.c |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-9192 |
+---------+------------------+ +-------------------+--------------+-----------------------------------------+
| libssl3 | CVE-2023-0286 | | 3.0.16-1~deb12u1 | | X.400 address type confusion |
| | | | | | in X.509 GeneralName |
| | | | | | -->avd.aquasec.com/nvd/cve-2023-0286 |
+---------+------------------+----------+-------------------+--------------+-----------------------------------------+
Vulnerabilities Breakdown
Critical
- CVE-2019-1010022 (libc6): glibc stack guard protection bypass
High
- CVE-2018-20796 (libc6): glibc uncontrolled recursion in posix/regexec.c
- CVE-2019-1010023 (libc6): glibc ldd on malicious ELF leads to code execution
- CVE-2019-9192 (libc6): glibc uncontrolled recursion in posix/regexec.c
- CVE-2023-0286 (libssl3): OpenSSL X.400 address type confusion in X.509 GeneralName
Related Work
Similar periodic security checks have been proposed for the deployer repository: torrust/torrust-tracker-deployer#251
We should consider implementing a similar automated workflow in this repository to catch security vulnerabilities early.
Note on Snyk.io: We previously considered using https://snyk.io/ for automated security scanning, but it doesn't automatically detect containers when using Containerfile instead of Dockerfile.
Proposed Solution
The vulnerabilities are in the base Debian system libraries. Here are potential solutions:
Option 1: Update Base Image (Recommended)
Update the Containerfile to use a newer Debian base image or rebuild with the latest security patches:
# Ensure we're using the latest Debian security updates
RUN apt-get update && apt-get upgrade -y && apt-get cleanOption 2: Switch to Distroless/Alpine Base
Consider migrating to a more minimal base image:
- Distroless images: Contain only the application and runtime dependencies, significantly reducing the attack surface
- Alpine Linux: Smaller footprint and often faster security updates
Option 3: Multi-stage Build Optimization
Ensure the final image only contains the runtime binary and minimal dependencies:
FROM rust:latest as builder
# ... build steps ...
FROM debian:bookworm-slim
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/torrust-tracker /usr/local/bin/Option 4: Implement Automated Security Scanning
Add a GitHub Actions workflow (similar to #251 in torrust-tracker-deployer) to:
- Run Trivy scans on every build
- Fail CI if HIGH/CRITICAL vulnerabilities are detected
- Generate security reports
- Schedule periodic scans of published images
Action Items
- Review current Containerfile and base image selection
- Implement solution to address current vulnerabilities
- Set up automated security scanning workflow
- Document security scanning process
- Establish policy for handling security vulnerabilities
Priority
This should be prioritized due to the CRITICAL severity vulnerability that could allow stack guard protection bypass.
cc @da2ce7
Activity
fix: [torrust#1628] upgrade to Debian 13 (Trixie) to resolve security…
Merge torrust#1629: fix: upgrade to Debian 13 (Trixie) to resolve sec…