Security mode
A first security run, from one workflow file.
Credda runs exploit probes against your package inside your own GitHub Actions runner. It reports a finding only when an exploit proved it, and each finding carries that exploit so anyone can run it again. Credda stores none of your code and none of the results.
01What you need
A repository, Actions, and a Linux runner.
No account, no app to install, and no key on a public repository.
- A GitHub repository
- With a JavaScript or TypeScript package, or a Python package, with its manifest at the repository root.
- GitHub Actions
- Turned on for that repository. The run uses your own Actions minutes.
- A Linux runner
- ubuntu-latest works. The probes run in Docker, and the job stops on any other runner.
What it runs
Probes for prototype pollution, regular expressions that take super-linear time, archive and path traversal, credentials sent across a redirect, and signature or certificate-chain verification bypass. Then it fuzzes the package’s exported functions for about a minute. A fuzz hit counts only when a reproducer proves it again in a fresh container. Three newer classes are off until you turn them on.
What it reaches
Your package is loaded the way a consumer loads it. When there is no build output to load, the source is loaded instead, TypeScript included, with Node’s own type stripping. Nothing is built and no build script runs.
02The workflow
Commit one file to main, and it runs.
It also runs every Monday at 06:00 UTC. If your default branch is not main, change that line.
on:
push:
branches: [main]
schedule:
- cron: '0 6 * * 1'
permissions:
contents: read
id-token: write
security-events: write
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Credda-io/action@v1
with:
mode: security
The permissions: block is the whole grant. It reads the code, mints the token that fetches the engine, and uploads findings to code scanning. Nothing in it can write to your code. Pin Credda-io/action@v1. A branch is whatever was last pushed to it. Pinning one means agreeing in advance to run code nobody has shown you, in your own repository, with your own token.
On a private repository, add license: ${{ secrets.CREDDA_LICENSE }} under with:.
03What you will see
Proven findings, with the exploit beside each one.
The security-findings output counts proven findings only, so you can gate a merge on it.
- The job summary
- A section headed Credda security. Each proven finding is listed with its class, its CWE, where it is, and the exploit program that proved it, so anyone can run it again. When an exploit is too long for the summary, the summary says where to find it in the SARIF file.
- What this run reached
- A section under the findings: the probes and how each ended, the functions fuzzed and the calls made, and, when your package was loaded from source, each module that failed and why. It is built only from what the engine wrote.
- A warning, when it applies
- When a run proved nothing and could not exercise your code, the summary opens with “Credda could not exercise this repository’s code”, says why, and quotes the engine. That run says nothing about whether the code is safe.
- The Security tab
- The same proven findings, as code scanning alerts. If the upload is refused, the job stays green and the findings stay on the summary. On a private repository, code scanning has to be available to you.
- The job itself
- Green whatever is found, and green when the code could not be exercised. Red only when the probes could not run, because a count of zero from a run that never happened would read like a clean repository. To fail it yourself, see the gates below.
What the words mean
Each probe’s own verdict is kept in security.json on the runner. Only a proven one is ever called a finding.
- Proven
- The exploit ran against your package and printed its finding. Only these are findings.
- Clean
- The probe ran against code it could drive, and its exploit did not succeed.
- Abstained
- The probe had nothing it could drive or measure, so it says nothing about that class.
- Timed out, crashed, not run
- These say nothing about that class either. A crash is Credda’s failure, not yours.
- NOT TESTED
- Your package itself was never exercised: the install failed, the entry threw on import, or there was nothing to load. The engine says NOT TESTED with the reason. When nothing was proven, the job summary opens with the warning above.
- Zero findings
- No exploit succeeded. That is not an audit. It says the probes Credda has did not prove a finding in the code they reached.
A run you can read
On Credda’s own demo repository, with extra-probes: xss, the run proved the seeded reflected cross-site scripting. It loaded 12 source files from its unbuilt TypeScript and fuzzed 36 functions. The same workflow scanned two public packages before and after a fix: flat 5.0.0 had 3 findings proven and 5.0.2 had none, and gdown had its archive traversal proven before the fix and nothing proven at it. minimist 1.2.5 had its prototype pollution proven and 1.2.6 had none. On a public monorepo of 8 packages it exercised 2 and named the 6 it did not, each with the reason. On a public Next.js app it loaded 64 source files and fuzzed 27 functions. The pull request and its runs.
04What it costs
Free on a public repository. A licence on a private one.
- Public repository
- No licence key and no account. GitHub signs whether the repository is public.
- Private repository
- A private repository needs a licence key. Without one the job stops at the engine fetch with 402 Payment Required, before anything runs. Trial licences are issued by hand. Write to support@credda.io with the repository it is for, and add it as the CREDDA_LICENSE secret.
- Your runner
- Your own Actions minutes: a Linux runner, Docker, and an install of your package in a container.
05Privacy and safety
Your code runs on your runner, in containers.
- Where it runs
- The Action runs in your own CI on your own token. The engine is fetched into your runner, and Credda receives no copy of your code.
- The one request to Credda
- The engine download. The job presents a short-lived token GitHub signs, which says which repository is running. It gives Credda no access to your repository. The engine is checked against a digest pinned in the Action before anything runs.
- Containers
- Your checkout is copied first, so nothing is written into it. Your package is installed in one container. Every probe runs in a second container with no network, a memory cap and a timeout.
- Install scripts
- npm installs with install scripts off. pip has no such switch, so a Python package’s build code does run in the install container.
- What it posts
- Nothing, by default. No issue, no comment, no pull request. Findings go to the job summary and to code scanning, and Credda stores none of them. The options below can open a pull request or send findings to your own Slack, Linear or Jira, each only when you set its inputs.
06Where it stops today
What a run will not do yet.
A monorepo is exercised in part
Each package of a workspace is scanned, at most 10 of them in full. An unbuilt package that another one imports is loaded from its source. A package with nothing to call, such as types only or a docs site, is named as not tested. The summary says how many were exercised, and names each one that was not, with the reason.
Some source is not loaded
JSX, TSX, decorators and tsconfig path aliases load, and so does a Next.js app’s lib, app and pages/api code. React components are set aside and not called. A module that needs a database, an environment variable or a generated client to import does not load, and neither does one that imports a stylesheet or an image. Each is named with its reason.
Cross-site scripting is JavaScript only
The cross-site scripting probe reads JavaScript and TypeScript, and is off unless you turn it on with extra-probes.
Fixes have not been run with a real model
Proposing fixes needs your own model key. Credda has exercised it only with a stand-in model so far.
Slack, Linear and Jira are untested against the live services
Each was tested against a local server standing in for the service. Jira Server and Data Center are not supported.
Not a test of a running system
The probes load your package the way a consumer does. They do not attack a deployed service.
07Optional
Proposing fixes.
With fix: 'true', your own model writes a patch for each class of finding an exploit proved.
The patch is applied to a temporary copy, never to your checkout. It is kept only when the exploit, a fixed list of its variants and a fuzz of the patched functions stop firing, a functional control holds, and your test suite runs. The summary gets a Fixes section that says, per class, whether the fix was proven, rejected or not attempted.
It needs a model key: anthropic-api-key, or model-api-key with model-base-url and, if you like, model-name. Without one, nothing is attempted and the summary says so.
To have each proven fix opened as a pull request, set open-pull-request: 'true' and grant contents: write and pull-requests: write. Either way, each proven patch is in the directory the fix-patches output names. A run on a pull request event scans a merge commit, so its fixes are attached and not proposed. A person should review each pull request. Credda never merges.
Credda has run this only with a stand-in model so far, not yet with a real one.
on:
push:
branches: [main]
permissions:
contents: write # push the fix branch
pull-requests: write # open the proposal
id-token: write
security-events: write
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Credda-io/action@v1
id: credda
with:
mode: security
fix: 'true'
open-pull-request: 'true'
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
# Without open-pull-request, keep the proven patches as an artifact.
- if: steps.credda.outputs.fix-patches != ''
uses: actions/upload-artifact@v4
with:
name: credda-fixes
path: ${{ steps.credda.outputs.fix-patches }}
08Optional
Sending findings to Slack, Linear or Jira Cloud.
Each is off by default and turns on only when its own inputs are set.
- Slack
- One message with the repository, the outcome and the count of proven findings. It lists up to 5 proven findings and links the run. It never carries an exploit program. With notify-on: findings, the default, a run that proved nothing sends nothing.
- Linear
- One issue per proven finding, with the exploit program in it when it fits. A finding that already has an open issue is skipped.
- Jira Cloud
- The same, as a Bug or the issue type you name. Jira Server and Data Center are not supported.
- Where it goes
- From your runner to the service you named. Nothing is sent to Credda. A failed request is one line in the log and the summary, and cannot fail your job. max-issues caps the issues one run creates in each tracker.
# REPLACE the Credda step in your security workflow. Keep only the lines you use.
- uses: Credda-io/action@v1
with:
mode: security
# Slack. One message when something was proven.
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
notify-on: findings # or 'always'
# Linear. One issue per proven finding.
linear-api-key: ${{ secrets.LINEAR_API_KEY }}
linear-team-id: ${{ vars.LINEAR_TEAM_ID }}
# Jira Cloud. One issue per proven finding.
jira-base-url: https://acme.atlassian.net
jira-email: ${{ secrets.JIRA_EMAIL }}
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
jira-project-key: SEC
max-issues: '10'
Pass every key and token from your own secrets. These steps were tested against a local server standing in for each service, not yet against the live services.
09Optional
More probes, the report, and gates.
Newer probe classes
extra-probes takes a comma-separated list: injection (injection to execution, JavaScript and Python), ssrf (server-side request forgery, JavaScript and Python) and xss (reflected cross-site scripting, JavaScript). Each still reports only what an exploit proved. The summary gets one line per class, and an unknown name fails the job.
Keeping the report
The report is deleted with the job. keep-report: 'true' copies it to a directory named in the security-report-path output, and your workflow uploads it. The files hold the exploit programs, so anyone who can download the run’s artifacts can read and run them.
- uses: Credda-io/action@v1
id: credda
with:
mode: security
keep-report: 'true'
- uses: actions/upload-artifact@v4
with:
name: credda-security-report
path: ${{ steps.credda.outputs.security-report-path }}
Failing the job yourself
Give the step an id, then gate on security-findings, the count of proven findings, or on the limited field of security-reach, which is true when the run proved nothing and could not exercise your code.
- uses: Credda-io/action@v1
id: credda
with:
mode: security
# Fail when an exploit proved a finding.
- if: steps.credda.outputs.security-findings != '0'
run: |
echo "::error::Credda proved a finding. See the job summary."
exit 1
# Fail when Credda could not exercise the code.
- if: fromJSON(steps.credda.outputs.security-reach).limited
run: |
echo "::error::Credda could not exercise this repository's code. See the job summary."
exit 1