Skip to content

fix(ci): download nginx over HTTPS and verify PGP signature (S2)#52

Merged
eilandert merged 1 commit into
masterfrom
fix/s2-ci-build-https
Jun 12, 2026
Merged

fix(ci): download nginx over HTTPS and verify PGP signature (S2)#52
eilandert merged 1 commit into
masterfrom
fix/s2-ci-build-https

Conversation

@eilandert

Copy link
Copy Markdown
Owner

Issue S2 (High — security)

tools/ci-build.sh downloaded the nginx source tarball over plain http://nginx.org, while resolving the version over HTTPS. A network attacker could replace the source that is then configured and compiled. This is the documented local build path.

Fix

  • Fetch tarball over HTTPS.
  • Download the detached .asc signature.
  • Import nginx release-signing public keys from https://nginx.org/keys/ (tries the known signer set incl. pluknet, the current mainline signer).
  • gpg --verify before unpacking; fail the build on bad/missing signature (exit code is checked directly, not masked through a pipe).
  • Quote all version-derived paths.

Verification

Tested locally against current mainline (1.31.1):

gpg: Good signature from "Sergey Kandaurov <s.kandaurov@f5.com>"
exit=0

tools/ci-build.sh fetched the nginx source tarball over plain HTTP, so a
network attacker could swap the source that is then configured and compiled.
Fetch over HTTPS, download the detached .asc, import the nginx release-signing
keys from nginx.org, and gpg --verify before unpacking; fail the build on a
bad or missing signature. Quote all version-derived paths.

Addresses audit S2.
@eilandert eilandert merged commit da5cba4 into master Jun 12, 2026
14 checks passed
@eilandert eilandert deleted the fix/s2-ci-build-https branch June 12, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant