Skip to content

feat(labeler): signed DIP-0036 labels from CrushAV (v0.16.0) - #485

Merged
ralyodio merged 1 commit into
masterfrom
feat/labeler-dip-0036
Nov 22, 2026
Merged

ralyodio merged 1 commit into
masterfrom
feat/labeler-dip-0036

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

ThreatCrush becomes the first labeler under c0mpute DIP-0036 (profullstack/c0mpute#437). Closes #484.

Endpoints

  • POST /api/v1/labels/scan (needs a token): runs CrushAV, hash reputation and reputation of the domains each file actively uses, then returns ed25519-signed labels on sha256:<hex>.
  • POST /api/v1/labels/query (public, rate limited): returns the labels currently in force, after a live reputation re-check.
  • GET /api/v1/labels/log: the append-only public log.
  • GET /api/v1/labels/manifest: labeler DID, public key, label values and appeal address.
  • POST /api/v1/labels/negate (admins only): grants an appeal by appending a signed neg record.

New CrushAV rules

  • CrushAV.Web.PhishKitExfil: a page that sends passwords to a Telegram bot or Discord webhook.
  • CrushAV.Web.BrowserMiner: an in-browser miner that is actually started, or a script loaded from a miner pool.

Hardening

  • Only detections with impact malicious produce a label.
  • The scan token is stored as a SHA-256 and compared in constant time.
  • Request bodies are capped while streaming, so a false Content-Length doesn't get past the limit.
  • Paths are validated against traversal and control characters, and base64 is validated.
  • At most 25 domains are checked per scan, and only domains a file actively uses. Domains mentioned in text are ignored.
  • Lookups fail open.
  • The log table refuses UPDATE and DELETE via a trigger, even for the service role.

Tests

  • 25 new labeler tests: forged and tampered signatures, injection, traversal, oversize bodies, token checks, retraction ordering, fail-open.
  • 7 new rule tests, including false-positive cases.
  • Full web suite: 1169 passed. tsc is clean, and the pre-commit build passed.

The migration 20261122150000_labeler_labels.sql is applied with migrate-dev2.

🤖 Generated with Claude Code

…owser-miner rules; v0.16.0

ThreatCrush becomes the first c0mpute labeler (c0mpute DIP-0036, closes #484):
- POST /api/v1/labels/scan (token): CrushAV + hash reputation + reputation of
  domains a file actively uses -> ed25519-signed labels on sha256:<hex>
- POST /api/v1/labels/query (public): labels in force, live reputation re-check
- GET /api/v1/labels/log (public, append-only), GET /api/v1/labels/manifest
- POST /api/v1/labels/negate (admins): appeals as signed neg records
- labeler_labels: append-only (trigger refuses UPDATE/DELETE), RLS, service_role
  SELECT/INSERT only
- CrushAV: CrushAV.Web.PhishKitExfil (password -> Telegram bot / Discord
  webhook), CrushAV.Web.BrowserMiner (miner started or loaded from a pool)

Only malicious-impact detections label. Signature is over a line-framed
canonical string a Rust verifier rebuilds byte for byte.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread packages/av/src/rules.ts
const t = c.text;
// The miner being started, not merely named: constructor plus .start(), or a script tag from a miner pool.
const started = /\b(?:CoinHive|CoinImp|Client|CRLT|WMP|deepMiner|Minero)\.(?:Anonymous|User|Init)\s*\(\s*["'`][\w$]{8,}["'`][\s\S]{0,400}?\.start\s*\(/.test(t);
const poolScript = /<script\b[^>]*\bsrc\s*=\s*["']?(?:https?:)?\/\/(?:[\w-]+\.)*(?:coinhive\.com|coin-hive\.com|authedmine\.com|crypto-loot\.(?:com|org)|cryptoloot\.pro|webminepool\.com|coinimp\.com|www\.hostingcloud\.racing|minero\.cc|jsecoin\.com|monerominer\.rocks|webmine\.cz)\//i.test(t);
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

Local report — repository account settings and team paging are not connected for this run.

CRITICAL: 1 | Warnings: 35 | Silenced warnings: 0

Critical findings remain visible regardless of warning silences. Connect this repository to enable team incident paging.

Level Detected severity Rule Location
CRITICAL CRITICAL secret-aws-access-key prd/0003-detect-hardcoded-secrets-before-they-are-committed-or-served.md:126
WARNING MEDIUM gha-ssh-key-secret .github/workflows/deploy-dev2.yml:39
WARNING MEDIUM gha-ssh-key-secret .github/workflows/migrate-dev2.yml:63
WARNING MEDIUM sql-string-concatenation .github/workflows/migrate-dev2.yml:128
WARNING MEDIUM gha-input-in-remote-shell .github/workflows/migrate-dev2.yml:130
WARNING MEDIUM gha-input-in-remote-shell .github/workflows/migrate-dev2.yml:134
WARNING MEDIUM gha-input-in-remote-shell .github/workflows/migrate-dev2.yml:158
WARNING MEDIUM js-uninitialized-buffer apps/cli/src/core/log-tail.ts:58
WARNING MEDIUM js-open-redirect apps/web/src/app/account/coinpay-card.tsx:44
WARNING MEDIUM js-open-redirect apps/web/src/app/auth/login/page.tsx:73
WARNING MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:110
WARNING MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:114
WARNING MEDIUM js-open-redirect apps/web/src/app/invite/[token]/invite-client.tsx:55
WARNING MEDIUM js-open-redirect apps/web/src/components/CheckoutPanel.tsx:99
WARNING MEDIUM js-open-redirect apps/web/src/components/funding/FundingClient.tsx:97
WARNING MEDIUM js-unescaped-html-sink apps/web/src/components/GuideReader.tsx:265
WARNING MEDIUM js-unescaped-html-sink apps/web/src/components/PitFooter.tsx:17
WARNING MEDIUM js-unescaped-html-sink apps/web/src/components/ProductWatchBadge.tsx:8
WARNING MEDIUM js-regex-from-input apps/web/src/lib/credit-codes.ts:569
WARNING MEDIUM js-open-redirect apps/web/src/lib/navigate.ts:3
WARNING MEDIUM js-uninitialized-buffer packages/av/src/node/scan-file.ts:30
WARNING MEDIUM js-uninitialized-buffer packages/av/src/node/scan-file.ts:51
WARNING MEDIUM js-uninitialized-buffer packages/av/src/node/scan-file.ts:62
WARNING MEDIUM redos-nested-quantifier packages/av/src/rules.ts:381
WARNING MEDIUM js-uninitialized-buffer packages/scan/src/node-rules.ts:456
WARNING MEDIUM redos-nested-quantifier packages/scan/src/workflow-rules.ts:456
WARNING LOW secret-generic-credential apps/cli/src/daemon/workers/auto-update.ts:155
WARNING LOW secret-generic-credential apps/web/src/app/api/auth/refresh/route.ts:17
WARNING LOW secret-generic-credential apps/web/src/app/api/auth/reset-password/route.ts:26
WARNING LOW secret-generic-credential apps/web/src/app/api/auth/reset-password/route.ts:27
WARNING LOW secret-generic-credential PRD.md:269
WARNING LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:121
WARNING LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:122
WARNING (test/example) LOW sh-remote-script-execution scripts/smoke-test.sh:72
WARNING (test/example) LOW secret-aws-access-key scripts/smoke-test.sh:150
WARNING (test/example) LOW secret-private-key scripts/test_github_repository_report.py:65

Manage repository warnings and critical paging.

Source snippets and credential material are never sent to the account service or printed in this report.

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.

Labeler endpoint for c0mpute DIP-0036 (malware, phishing, cryptominer)

2 participants