Open Workers operates with zero persistent databases and zero client-side secret storage. Every privileged GitHub mutation runs on the Node.js backend using short-lived installation access tokens minted on demand via @octokit/app.
- Raw Body Hashing:
src/server.jsmountsexpress.raw({ type: '*/*', limit: '1mb' })on/api/webhooksbeforeexpress.json().@octokit/webhookscomputes HMAC SHA-256 over the exact unparsed UTF-8 payload bytes againstX-Hub-Signature-256. - Fail-Closed Behavior: If
GITHUB_WEBHOOK_SECRETis unset,POST /api/webhooksreturns503 Service Unavailable. Missing signatures or tampered payloads return401 Unauthorized. MissingX-GitHub-EventorX-GitHub-Deliveryheaders return400 Bad Request. - Post-Auth Deduplication: Duplicate delivery protection (
X-GitHub-DeliveryboundedSetcapped at1000entries) executes only after HMAC verification passes. An unauthenticated sender cannot poison delivery IDs or block authentic retries.
- Mutation endpoints (
POST /api/trigger-pr,POST /api/community/trigger-pr,POST /api/security/trigger-pr) require caller authorization. - The caller passes a Personal Access Token in the
Authorization: Bearer <token>header. - The server checks the caller's collaborator permissions on the target repository (
admin,maintain, orwrite). - Tokens are held strictly in memory for the duration of the request and are never logged, cached, or saved to disk.
.gitignorestrictly excludes.env,.env.local,.env.*.local,*.pem,*.key,*.p12,*.crt,private-key*, andgithub-app-key*.loadPrivateKey()validates PEM envelope headers (-----BEGIN ... PRIVATE KEY-----) from eitherGITHUB_PRIVATE_KEY(inline escaped\n) orGITHUB_PRIVATE_KEY_PATH.GET /api/configandGET /api/healthreturn only public non-secret metadata (appSlug,installUrl, boolean readiness flags, and permission scopes).
- No Direct Default-Branch Writes: Commits are written exclusively to an isolated feature branch (
chore/add-license-<spdx>,chore/add-community-files-*, orchore/configure-security). - Non-Overwrite Guarantee: Before branching or committing, services inspect the default branch tree. If target files already exist, operations fail with
409 Conflictunless explicitreplaceExisting: trueopt-in is provided. - Permission Verification & Workflow Safety: Installation tokens are checked for
contents: writeandpull_requests: write. Furthermore, committing files under.github/workflows/(such ascodeql.yml) requires explicitworkflows: writepermission. Whenworkflows: writeis not granted, Open Workers refuses to attempt an unauthorized workflow write and provides users with a direct YAML copy/download option or instructions to grant workflow permissions in GitHub App settings. Dependabot configurations (.github/dependabot.yml) only requirecontents: writeand proceed normally. - Input Sanitization:
parseRepoInput()restricts owners/repos to[A-Za-z0-9_.-]+and blocks./..traversal or non-github.comhosts. Form text is sanitized and length-capped.
- Helmet CSP:
script-src 'self',object-src 'none',frame-ancestors 'none',base-uri 'self',form-action 'self', andconnect-src 'self' https://api.github.com. - CORS Allowlist: Configured via
ALLOWED_ORIGINS(defaults toAPP_URL). - XSS Prevention: Client UI builds DOM nodes via
document.createElementandtextContentrather than injecting repository metadata intoinnerHTML. External links are verified against safehttps:/http:protocols.
Please do not open public issues for suspected security vulnerabilities or leaked credentials. Contact the maintainer directly at ayush_24a12res897@iitp.ac.in.
- Configuration Hygiene vs Vulnerability Scanning: Open Workers Security inspects repository configuration files (
SECURITY.md,.github/dependabot.yml,.github/workflows/codeql.yml), branch protection settings, and security features. It does not execute arbitrary repository code, clone repositories to disk, or perform deep static application security testing (SAST). CodeQL workflow execution occurs inside GitHub Actions runners upon merge. - Transparent Unverified Handling: Checks that require administrative permissions (such as branch protection rules or secret scanning push protection) report "Not verified" rather than reporting failures when APIs return 403 or 404 due to lack of admin permissions. Unverified checks are excluded from the health score denominator to ensure an accurate, transparent assessment.