Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
directory: /
schedule:
interval: weekly
day: monday
time: "06:00"
open-pull-requests-limit: 10
time: "10:00"
timezone: Etc/UTC
open-pull-requests-limit: 8
labels:
- "dependencies"
ignore:
# Ignore major version bumps — review those manually
- dependency-name: "*"
update-types: ["version-update:semver-major"]
- dependencies
groups:
production-dependencies:
dependency-type: production
update-types:
- minor
- patch
development-dependencies:
dependency-type: development
update-types:
- minor
- patch
major-dependencies:
update-types:
- major

- package-ecosystem: github-actions
directory: "/"
directory: /
schedule:
interval: weekly
day: monday
time: "06:00"
time: "10:30"
timezone: Etc/UTC
open-pull-requests-limit: 5
labels:
- dependencies
- github-actions
groups:
github-actions:
patterns:
- "*"
40 changes: 40 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CodeQL

on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: "26 7 * * 2"

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'schedule' && 'schedule' || github.ref }}
cancel-in-progress: ${{ github.event_name != 'schedule' }}

permissions:
contents: read
security-events: write

jobs:
analyze:
name: Analyze JavaScript and TypeScript
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Initialize CodeQL
uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4
with:
languages: javascript-typescript

- name: Autobuild
uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4

- name: Perform CodeQL analysis
Comment on lines +28 to +39

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 All four uses: references use mutable version tags (@v4) rather than immutable commit SHAs. If a tag is forcibly moved—whether through a supply chain compromise or an accidental re-tag—the workflow silently adopts the new code. This is especially risky here because the job runs with security-events: write and checkout access, so compromised action code could tamper with SARIF results or exfiltrate secrets. Pin each action to its full SHA (e.g., actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4) and reference the tag in a comment for readability.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/codeql.yml
Line: 28-39

Comment:
All four `uses:` references use mutable version tags (`@v4`) rather than immutable commit SHAs. If a tag is forcibly moved—whether through a supply chain compromise or an accidental re-tag—the workflow silently adopts the new code. This is especially risky here because the job runs with `security-events: write` and checkout access, so compromised action code could tamper with SARIF results or exfiltrate secrets. Pin each action to its full SHA (e.g., `actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4`) and reference the tag in a comment for readability.

How can I resolve this? If you propose a fix, please make it concise.

uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4
4 changes: 4 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ Please report security vulnerabilities through GitHub's Security Advisory featur
[https://github.com/paperclipai/paperclip/security/advisories/new](https://github.com/paperclipai/paperclip/security/advisories/new)

Do not open public issues for security vulnerabilities.

## Scanning and Remediation

See [docs/security-scanning-playbook.md](docs/security-scanning-playbook.md) for CodeQL, Dependabot, triage ownership, remediation SLA, and escalation expectations.
6 changes: 6 additions & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
"guides/agent-developer/handling-approvals",
"guides/agent-developer/cost-reporting"
]
},
{
"group": "Security",
"pages": [
"security-scanning-playbook"
]
}
]
},
Expand Down
51 changes: 51 additions & 0 deletions docs/security-scanning-playbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Security Scanning Playbook

Paperclip uses GitHub CodeQL for source scanning and Dependabot for dependency and GitHub Actions update pull requests.

## Ownership

The CTO owns security alert triage. The assignee for the alert or remediation issue owns the code change until the fix is merged and verified. If an alert has no assignee after one business day, the CTO assigns it directly or creates a Paperclip issue for the relevant engineer.

## Alert Intake

1. Review new GitHub Security alerts every business day.
2. Confirm whether the alert affects supported Paperclip code, release artifacts, or CI/CD execution.
3. Create or update a Paperclip issue for every actionable alert. Link the GitHub alert, affected package or source path, severity, and planned remediation.
4. Close false positives only after documenting the reason in the GitHub alert or linked issue.

## Remediation SLA

| Severity | First response | Remediation target |
| --- | --- | --- |
| Critical | Same business day | 2 business days |
| High | 1 business day | 5 business days |
| Medium | 2 business days | 10 business days |
| Low | 5 business days | Next planned maintenance window |

If a fix cannot meet its target, the owner must update the Paperclip issue with the blocker, temporary mitigation, and new target date.

## Dependabot Pull Requests

Dependabot runs weekly for npm dependencies and GitHub Actions. Minor and patch updates are grouped by dependency type to reduce review noise; major updates are grouped separately so breaking-change risk is explicit.

For each Dependabot PR:

1. Review release notes and lockfile changes.
2. Run the smallest relevant local verification, then rely on required CI for broad coverage.
3. Merge low-risk patch and minor updates once checks pass.
4. Split or defer grouped updates if one dependency causes failures.

## CodeQL Alerts

CodeQL runs on pull requests, pushes to `master`, and a weekly scheduled scan. Pull request findings should be fixed before merge unless the CTO accepts the risk in writing. Default-branch findings follow the SLA table above.

When fixing a CodeQL alert:

1. Identify the vulnerable data flow or unsafe API use.
2. Add a regression test or guardrail when practical.
3. Reference the alert and verification in the pull request description.
4. Confirm the alert is closed or dismissed with rationale after the fix lands on `master`.

## Escalation

Escalate to the CTO immediately when an alert indicates exploitable remote code execution, credential exposure, authentication bypass, cross-company data access, or a compromised dependency. The CTO decides whether to pause releases, request board approval, or coordinate a private security advisory.
Loading