Vulnerabilidades na imagem oficial do Docker

Olá! Recentemente, baixei a imagem oficial do Docker do Discourse e a analisei com o Trivy (um scanner de segurança e vulnerabilidades). O resultado mostra várias vulnerabilidades:

$ trivy image --vuln-type library discourse/base:release
...
Node.js (node-pkg)

Total: 19 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 15, CRITICAL: 2)

┌─────────────────────────────────────┬─────────────────────┬──────────┬───────────────────┬────────────────────────────┬──────────────────────────────────────────────────────────────┐
│               Library               │    Vulnerability    │ Severity │ Installed Version │       Fixed Version        │                            Title                             │
├─────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ ansi-html (package.json)            │ CVE-2021-23424      │ HIGH     │ 0.0.7             │ 0.0.8                      │ nodejs-ansi-html: ReDoS via crafted string                   │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2021-23424                   │
├─────────────────────────────────────┼─────────────────────┤          ├───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ ansi-regex (package.json)           │ CVE-2021-3807       │          │ 3.0.0             │ 3.0.1, 4.1.1, 5.0.1, 6.0.1 │ nodejs-ansi-regex: Regular expression denial of service      │
│                                     │                     │          │                   │                            │ (ReDoS) matching ANSI escape codes                           │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2021-3807                    │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          ├───────────────────┤                            │                                                              │
│                                     │                     │          │ 4.1.0             │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
├─────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ clean-css (package.json)            │ GHSA-wxhq-pm8v-cw75 │ LOW      │ 3.4.28            │ 4.1.11                     │ Regular Expression Denial of Service in clean-css            │
│                                     │                     │          │                   │                            │ https://github.com/advisories/GHSA-wxhq-pm8v-cw75            │
├─────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ engine.io (package.json)            │ CVE-2023-31125      │ MEDIUM   │ 6.2.1             │ 6.4.2                      │ Uncaught exception in engine.io                              │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2023-31125                   │
├─────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ http-cache-semantics (package.json) │ CVE-2022-25881      │ HIGH     │ 4.1.0             │ 4.1.1                      │ Regular Expression Denial of Service (ReDoS) vulnerability   │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2022-25881                   │
├─────────────────────────────────────┼─────────────────────┤          ├───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ json5 (package.json)                │ CVE-2022-46175      │          │ 0.5.1             │ 1.0.2, 2.2.2               │ json5: Prototype Pollution in JSON5 via Parse Method         │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2022-46175                   │
│                                     │                     │          ├───────────────────┤                            │                                                              │
│                                     │                     │          │ 1.0.1             │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
├─────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ loader-utils (package.json)         │ CVE-2022-37601      │ CRITICAL │ 2.0.2             │ 1.4.1, 2.0.3               │ loader-utils: prototype pollution in function parseQuery in  │
│                                     │                     │          │                   │                            │ parseQuery.js                                                │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2022-37601                   │
│                                     ├─────────────────────┼──────────┤                   ├────────────────────────────┼──────────────────────────────────────────────────────────────┤
│                                     │ CVE-2022-37599      │ HIGH     │                   │ 3.2.1, 2.0.4, 1.4.2        │ A Regular expression denial of service (ReDoS) flaw was      │
│                                     │                     │          │                   │                            │ found in Funct...                                            │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2022-37599                   │
│                                     ├─────────────────────┤          │                   │                            ├──────────────────────────────────────────────────────────────┤
│                                     │ CVE-2022-37603      │          │                   │                            │ loader-utils:Regular expression denial of service            │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2022-37603                   │
├─────────────────────────────────────┼─────────────────────┤          ├───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ minimatch (package.json)            │ CVE-2016-10540      │          │ 0.2.14            │ 3.0.2                      │ Minimatch is a minimal matching utility that works by        │
│                                     │                     │          │                   │                            │ converting glob ...                                          │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2016-10540                   │
│                                     ├─────────────────────┤          │                   ├────────────────────────────┼──────────────────────────────────────────────────────────────┤
│                                     │ CVE-2022-3517       │          │                   │ 3.0.5                      │ ReDoS via the braceExpand function                           │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2022-3517                    │
│                                     ├─────────────────────┤          │                   ├────────────────────────────┼──────────────────────────────────────────────────────────────┤
│                                     │ NSWG-ECO-118        │          │                   │ >=3.0.2                    │ Regular Expression Denial of Service                         │
├─────────────────────────────────────┼─────────────────────┤          ├───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ taffydb (package.json)              │ CVE-2019-10790      │          │ 2.6.2             │                            │ TaffyDB can allow access to any data items in the DB         │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2019-10790                   │
│                                     │                     │          ├───────────────────┼────────────────────────────┤                                                              │
│                                     │                     │          │ 2.7.3             │                            │                                                              │
│                                     │                     │          │                   │                            │                                                              │
├─────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ underscore (package.json)           │ CVE-2021-23358      │ CRITICAL │ 1.3.3             │ 1.12.1                     │ nodejs-underscore: Arbitrary code execution via the template │
│                                     │                     │          │                   │                            │ function                                                     │
│                                     │                     │          │                   │                            │ https://avd.aquasec.com/nvd/cve-2021-23358                   │
└─────────────────────────────────────┴─────────────────────┴──────────┴───────────────────┴────────────────────────────┴──────────────────────────────────────────────────────────────┘
2023-05-16T18:33:20.715+0200	INFO	Table result includes only package filenames. Use '--format json' option to get the full path to the package file.
...

Esta é uma parte das vulnerabilidades relatadas, com a lista completa incluindo mais de 20:

CVE-2015-9284, CVE-2016-10540, CVE-2019-10790, CVE-2020-26235, CVE-2021-23358, CVE-2021-23424, CVE-2021-32810, CVE-2021-3807, CVE-2022-23639, CVE-2022-24713, CVE-2022-25881, CVE-2022-32149, CVE-2022-3517, CVE-2022-37599, CVE-2022-37601, CVE-2022-37603, CVE-2022-46175, CVE-2023-31125, GHSA-2qv5-7mw5-j3cg, GHSA-f85w-wvc7-crwc, GHSA-mc8h-8q98-g5hr, GHSA-rc23-xxgq-x27g, GHSA-wxhq-pm8v-cw75, NSWG-ECO-118 

Qual é o status dessas vulnerabilidades? Vocês planejam corrigi-las em uma próxima versão?

Muito obrigado antecipadamente!

Olá @jcarmona, nossas próprias ferramentas também detectaram esses pacotes NPM ‘vulneráveis’. A grande maioria está relacionada a ferramentas de compilação/desenvolvimento. Para os poucos que são dependências transitivas do aplicativo JavaScript do lado do cliente do Discourse, estamos satisfeitos que as vulnerabilidades não sejam exploráveis.

Dito isso, estamos sempre trabalhando para atualizar nossas dependências, então esperamos atualizá-las todas em um futuro não muito distante.