CVE-2021-21423

Exposure of Version-Control Repository to an Unauthorized Control Sphere in projen

6.8 medium EPSS 1.39%

Published 6 Apr 2021 Updated 3 Aug 2024 CNA: GitHub_M

Check your servers for CVE-2021-21423

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-21423 affects projen, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

`projen` is a project generation tool that synthesizes project configuration files such as `package.json`, `tsconfig.json`, `.gitignore`, GitHub Workflows, `eslint`, `jest`, and more, from a well-typed definition written in JavaScript. Users of projen's `NodeProject` project type (including any project type derived from it) include a `.github/workflows/rebuild-bot.yml` workflow that may allow any GitHub user to trigger execution of un-trusted code in the context of the "main" repository (as opposed to that of a fork). In some situations, such untrusted code may potentially be able to commit to the "main" repository. The rebuild-bot workflow is triggered by comments including `@projen rebuild` on pull-request to trigger a re-build of the projen project, and updating the pull request with the updated files. This workflow is triggered by an `issue_comment` event, and thus always executes with a `GITHUB_TOKEN` belonging to the repository into which the pull-request is made (this is in contrast with workflows triggered by `pull_request` events, which always execute with a `GITHUB_TOKEN` belonging to the repository from which the pull-request is made). Repositories that do not have branch protection configured on their default branch (typically `main` or `master`) could possibly allow an untrusted user to gain access to secrets configured on the repository (such as NPM tokens, etc). Branch protection prohibits this escalation, as the managed `GITHUB_TOKEN` would not be able to modify the contents of a protected branch and affected workflows must be defined on the default branch.

Severity (CVSS)

6.8 medium CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 1.39%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 73.1% of all scored CVEs. Scores of 1 Dec 2026.

Weakness

  • CWE-527 Exposure of Version-Control Repository to an Unauthorized Control Sphere

Affected products

As the CNA lists them.

ProductVersions
projen
affected >= 0.6.0, < 0.16.41

Is my server affected?

Find the installed version of projen and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i projen
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-21423 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-21423

RHEL, Rocky, Alma, Fedora

rpm -q projen
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-21423

Alpine

apk list --installed | grep -i projen

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2021-21423
trivy image --scanners vuln IMAGE | grep CVE-2021-21423

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2021-21423 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.