Repository navigation
bring in V22.21.1 patches into v22.23.4 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
6f70fb0
Initial patch
JackStrohm-asana a8d4c9b
s3 staging script
JackStrohm-asana 0c1288a
script to build locally instead of using docker containers which don'…
JackStrohm-asana 5e0424e
update github actions to build node fibers
JackStrohm-asana 2d64ee8
fix node-fibers branchname
JackStrohm-asana b9b6b32
update staging directory
JackStrohm-asana b577cda
Add fips build workflow
JackStrohm-asana ba48e86
change fiber and package build triggers
JackStrohm-asana 9977ae6
try to fix network errors on apt-get
JackStrohm-asana 2118248
working on apt-get failures
JackStrohm-asana 5122fc2
removed push trigger
JackStrohm-asana 9260bf1
another test
JackStrohm-asana cf4884d
switch FIPS Dockerfile to Ubuntu 20.04
JackStrohm-asana 3814757
revert FIPS Dockerfile to Ubuntu 22.04
JackStrohm-asana 0824123
add robust retry logic to FIPS Dockerfile apt-get
JackStrohm-asana 39bd639
consolidate all apt-get commands into single retry block
JackStrohm-asana 18a6979
add robust retry logic to regular Node Dockerfile
JackStrohm-asana 99fede0
rename build workflows for clarity
JackStrohm-asana 0f26935
added fips to the staging script to make sure we don't have cache issues
JackStrohm-asana 829e1c9
make staging do fips and update asana codez codebase
JackStrohm-asana 6dad6fe
update lockfile instructions
JackStrohm-asana ab57e94
fix staging script: validate fibers archive and fix node_setup.bzl up…
JackStrohm-asana bd560ee
Untested support for profiler
JackStrohm-asana d2b5f7f
Install node-gyp before rebuilding pprof native binding
JackStrohm-asana 17f3b44
Fix pprof native build: use --build-from-source and find .node output
JackStrohm-asana c0bc534
deps: brotli: cherry-pick 0ed4268a4401abcb44720963
eustas c4fecfb
src: expose `BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH`
aduh95 d3cff29
Merge pull request #25 from jrsells/cve-2026-111497
jrsells File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: Build Custom Fibers | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_run: | ||
| workflows: ["Build Node (Standard)"] | ||
| types: | ||
| - completed | ||
| branches: | ||
| - v22.21.1 | ||
|
|
||
| jobs: | ||
| build-fibers: | ||
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - platform: linux | ||
| arch: x64 | ||
| runs_on: ubuntu-22.04 | ||
| - platform: linux | ||
| arch: arm64 | ||
| runs_on: ubuntu-22.04-arm | ||
| runs-on: ${{ matrix.runs_on }} | ||
|
|
||
| env: | ||
| NODE_VERSION: v22.21.1 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Debug Matrix Values | ||
| run: | | ||
| echo "Matrix platform: ${{ matrix.platform }}" | ||
| echo "Matrix arch: ${{ matrix.arch }}" | ||
|
|
||
| - name: Download Node archive | ||
| run: | | ||
| gh release download node-${{ env.NODE_VERSION }}-release \ | ||
| --repo asana/node \ | ||
| --pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz" | ||
| mv node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz node.tar.xz | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Execute the Dockerfile | ||
| run: | | ||
| pwd | ||
| docker build -t node22_fibers_build -f Dockerfile.Fibers . | ||
|
|
||
| - name: Extract resources | ||
| run: | | ||
| docker create --name temp_node_fibers_extract node22_fibers_build | ||
| docker cp temp_node_fibers_extract:/usr/src/node/node-fibers $GITHUB_WORKSPACE/node-fibers | ||
| docker rm temp_node_fibers_extract | ||
|
|
||
| - name: Find and archive fibers.node | ||
| run: | | ||
| # Find the directory under bin/ that contains fibers.node | ||
| FIBERS_PATH=$(find ./node-fibers/bin -type f -name fibers.node | head -n1) | ||
| FIBERS_DIR=$(dirname "$FIBERS_PATH") | ||
| ARCHIVE_NAME=$(basename "$FIBERS_DIR").tar.gz | ||
| echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV | ||
| tar -czf "$ARCHIVE_NAME" -C "$(dirname "$FIBERS_DIR")" "$(basename "$FIBERS_DIR")" | ||
|
|
||
| - name: Upload archive to release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-LATEST | ||
| tag_name: node-${{ env.NODE_VERSION }}-release | ||
| files: ${{ env.ARCHIVE_NAME }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: Build Node (FIPS) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| BUILD_REF: | ||
| description: 'Git ref to build Node.js from' | ||
| required: true | ||
| default: 'v22.21.1' | ||
| type: string | ||
| DOCKER_FILE: | ||
| description: 'Dockerfile to use for building Node.js' | ||
| required: true | ||
| default: 'Dockerfile.Node22fips' | ||
| type: string | ||
|
|
||
| jobs: | ||
| build-node: | ||
| name: Build ${{ matrix.platform }}-${{ matrix.arch }} with FIPS OpenSSL | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - platform: linux | ||
| arch: x64 | ||
| runs_on: ubuntu-22.04 | ||
| - platform: linux | ||
| arch: arm64 | ||
| runs_on: ubuntu-22.04-arm | ||
| runs-on: ${{ matrix.runs_on }} | ||
|
|
||
| steps: | ||
| - name: Checkout Node fork | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: Asana/node | ||
| path: node | ||
| ref: ${{ inputs.BUILD_REF }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract Node Version | ||
| id: extract-node-version | ||
| run: | | ||
| NODE_MAJOR_VERSION=$(grep '#define NODE_MAJOR_VERSION' node/src/node_version.h | awk '{print $3}') | ||
| NODE_MINOR_VERSION=$(grep '#define NODE_MINOR_VERSION' node/src/node_version.h | awk '{print $3}') | ||
| NODE_PATCH_VERSION=$(grep '#define NODE_PATCH_VERSION' node/src/node_version.h | awk '{print $3}') | ||
| NODE_VERSION="v${NODE_MAJOR_VERSION}.${NODE_MINOR_VERSION}.${NODE_PATCH_VERSION}" | ||
| echo "NODE_VERSION=${NODE_VERSION}" >> $GITHUB_ENV | ||
|
|
||
| - name: Set build metadata | ||
| id: meta | ||
| working-directory: node | ||
| run: | | ||
| TIMESTAMP=$(date -u +%Y-%m-%dT%H-%M) | ||
| SHORT_SHA=$(git rev-parse --short HEAD) | ||
| echo "BUILD_ID=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_ENV | ||
| echo "build_id=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Execute the Dockerfile | ||
| working-directory: node | ||
| run: | | ||
| docker build -t node22_fips_build -f ./${{ inputs.DOCKER_FILE }} . | ||
|
|
||
| - name: Extract resources | ||
| run: | | ||
| docker create --name temp_node_extract node22_fips_build | ||
| docker cp temp_node_extract:/usr/src/node/node-install $GITHUB_WORKSPACE/node-install | ||
| docker rm temp_node_extract | ||
|
|
||
| - name: Archive Node | ||
| run: | | ||
| mkdir -p artifacts | ||
| FILENAME=node-${NODE_VERSION}-fips-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz | ||
| FILENAME_LATEST=node-${NODE_VERSION}-fips-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz | ||
| tar -C node-install -cJf artifacts/$FILENAME . | ||
| cp artifacts/$FILENAME artifacts/$FILENAME_LATEST | ||
| echo "NODE_ARCHIVE=$FILENAME" >> $GITHUB_ENV | ||
| echo "NODE_ARCHIVE_LATEST=$FILENAME_LATEST" >> $GITHUB_ENV | ||
|
|
||
| - name: Upload Node archive | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-fips-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }} | ||
| path: artifacts/${{ env.NODE_ARCHIVE }} | ||
|
|
||
| - name: Upload Node archive latest | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-fips-${{ matrix.platform }}-${{ matrix.arch }}-LATEST | ||
| path: artifacts/${{ env.NODE_ARCHIVE_LATEST }} | ||
|
|
||
| - name: Upload Node archive to release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-fips-LATEST | ||
| tag_name: node-${{ env.NODE_VERSION }}-fips-release | ||
| files: ./artifacts/${{ env.NODE_ARCHIVE_LATEST }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: Build Node-Packages | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_run: | ||
| workflows: ["Build Node (Standard)"] | ||
| types: | ||
| - completed | ||
| branches: | ||
| - v22.21.1 | ||
|
|
||
| jobs: | ||
| build-packages: | ||
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - platform: linux | ||
| arch: x64 | ||
| runs_on: ubuntu-22.04 | ||
| - platform: linux | ||
| arch: arm64 | ||
| runs_on: ubuntu-22.04-arm | ||
| runs-on: ${{ matrix.runs_on }} | ||
|
|
||
| env: | ||
| NODE_VERSION: v22.21.1 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Debug Matrix Values | ||
| run: | | ||
| echo "Matrix platform: ${{ matrix.platform }}" | ||
| echo "Matrix arch: ${{ matrix.arch }}" | ||
|
|
||
| - name: Download Node archive | ||
| run: | | ||
| gh release download node-${{ env.NODE_VERSION }}-release \ | ||
| --repo asana/node \ | ||
| --pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz" | ||
| mv node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz node.tar.xz | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Execute the Dockerfile | ||
| run: | | ||
| pwd | ||
| docker build -t node22_packages_build -f Dockerfile.Packages . | ||
|
|
||
| - name: Extract resources | ||
| run: | | ||
| docker create --name temp_node_packages_extract node22_packages_build | ||
| docker cp temp_node_packages_extract:/usr/src/node/node_modules $GITHUB_WORKSPACE/node_modules | ||
| docker rm temp_node_packages_extract | ||
|
|
||
| - name: Tar node-packages | ||
| run: | | ||
| mkdir -p ./bcrypt@5.1.0/node_modules | ||
| mkdir -p ./cld@2.9.1/node_modules | ||
| mkdir -p ./unix-dgram@2.0.6/node_modules | ||
| mkdir -p "./@datadog+pprof@5.8.0/node_modules/@datadog" | ||
| mv node_modules/bcrypt ./bcrypt@5.1.0/node_modules/ | ||
| mv node_modules/cld ./cld@2.9.1/node_modules/ | ||
| mv node_modules/unix-dgram ./unix-dgram@2.0.6/node_modules/ | ||
| mv "node_modules/@datadog/pprof" "./@datadog+pprof@5.8.0/node_modules/@datadog/" | ||
| tar --hard-dereference -cvzf packages_${{matrix.arch}}.tar.gz bcrypt@5.1.0 cld@2.9.1 unix-dgram@2.0.6 "@datadog+pprof@5.8.0" | ||
|
|
||
| - name: Upload archive to release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-LATEST | ||
| tag_name: node-${{ env.NODE_VERSION }}-release | ||
| files: packages_${{matrix.arch}}.tar.gz | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: Build Node (Standard) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-node: | ||
| name: Build ${{ matrix.platform }}-${{ matrix.arch }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - platform: linux | ||
| arch: x64 | ||
| runs_on: ubuntu-22.04 | ||
| - platform: linux | ||
| arch: arm64 | ||
| runs_on: ubuntu-22.04-arm | ||
| runs-on: ${{ matrix.runs_on }} | ||
|
|
||
| env: | ||
| S3_BUCKET: your-bucket-name | ||
| AWS_REGION: us-east-1 | ||
|
|
||
| steps: | ||
| - name: Checkout Node fork | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: Asana/node | ||
| path: node | ||
| ref: ${{ github.event_name == 'pull_request' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref_name }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract Node Version | ||
| id: extract-node-version | ||
| run: | | ||
| NODE_MAJOR_VERSION=$(grep '#define NODE_MAJOR_VERSION' node/src/node_version.h | awk '{print $3}') | ||
| NODE_MINOR_VERSION=$(grep '#define NODE_MINOR_VERSION' node/src/node_version.h | awk '{print $3}') | ||
| NODE_PATCH_VERSION=$(grep '#define NODE_PATCH_VERSION' node/src/node_version.h | awk '{print $3}') | ||
| NODE_VERSION="v${NODE_MAJOR_VERSION}.${NODE_MINOR_VERSION}.${NODE_PATCH_VERSION}" | ||
| echo "NODE_VERSION=${NODE_VERSION}" >> $GITHUB_ENV | ||
|
|
||
| - name: Set build metadata | ||
| id: meta | ||
| working-directory: node | ||
| run: | | ||
| TIMESTAMP=$(date -u +%Y-%m-%dT%H-%M) | ||
| SHORT_SHA=$(git rev-parse --short HEAD) | ||
| echo "BUILD_ID=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_ENV | ||
| echo "build_id=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Execute the Dockerfile | ||
| working-directory: node | ||
| run: | | ||
| docker build -t node22_build -f ./Dockerfile.Node22 . | ||
|
|
||
| - name: Extract resources | ||
| run: | | ||
| docker create --name temp_node_extract node22_build | ||
| docker cp temp_node_extract:/usr/src/node/node-install $GITHUB_WORKSPACE/node-install | ||
| docker rm temp_node_extract | ||
|
|
||
| - name: Archive Node | ||
| run: | | ||
| mkdir -p artifacts | ||
| FILENAME=node-${NODE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz | ||
| FILENAME_LATEST=node-${NODE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz | ||
| tar -C node-install -cJf artifacts/$FILENAME . | ||
| cp artifacts/$FILENAME artifacts/$FILENAME_LATEST | ||
| echo "NODE_ARCHIVE=$FILENAME" >> $GITHUB_ENV | ||
| echo "NODE_ARCHIVE_LATEST=$FILENAME_LATEST" >> $GITHUB_ENV | ||
|
|
||
| - name: Upload Node archive | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }} | ||
| path: artifacts/${{ env.NODE_ARCHIVE }} | ||
|
|
||
| - name: Upload Node archive latest | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST | ||
| path: artifacts/${{ env.NODE_ARCHIVE_LATEST }} | ||
|
|
||
| - name: Upload Node archive to release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: node-${{ env.NODE_VERSION }}-LATEST | ||
| tag_name: node-${{ env.NODE_VERSION }}-release | ||
| files: ./artifacts/${{ env.NODE_ARCHIVE_LATEST }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Stage 1 | ||
| FROM ubuntu:20.04 AS base | ||
|
|
||
| # Set non-interactive mode to avoid prompts during installation | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Install necessary dependencies | ||
| RUN apt-get update | ||
| RUN apt-get install -y software-properties-common | ||
| RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
| RUN apt-get update | ||
| RUN apt-get install -y build-essential python3 python3-distutils g++-10 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim | ||
|
|
||
| # Copy local Node.js source into the image | ||
| WORKDIR /usr/src/node | ||
| COPY node.tar.xz . | ||
|
|
||
| RUN mkdir -p node-install && tar -C node-install -xJf node.tar.xz | ||
|
|
||
| ENV PATH="/usr/src/node/node-install/usr/local/bin:$PATH" | ||
|
|
||
| RUN which node | ||
| RUN node -v | ||
| RUN node -p "process.arch" | ||
| RUN echo ------------------- | ||
| RUN git clone --branch jackstrohm_node20_fibers --depth 1 https://github.com/asana/node-fibers.git node-fibers | ||
|
|
||
| WORKDIR /usr/src/node/node-fibers | ||
| RUN npm install --nodedir="/usr/src/node/node-install/usr/local" | ||
| RUN npm test || true | ||
| RUN rm bin/repl | ||
| RUN find . | ||
|
|
||
|
|
||
| CMD ["bash"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:
Using variable interpolation
${{...}}withgithubcontext data in arun:step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code.githubcontext data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable withenv:to store the data and use the environment variable in therun:script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".To resolve this comment:
🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.
💬 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 reasonsAlternatively, 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.