Skip to content

feat: rebrand to @mightyai + SHA256 binary verification + CI fixes - #1

Merged
masterfung merged 9 commits into
mainfrom
feat/security-audit-fixes
Feb 10, 2026
Merged

masterfung merged 9 commits into
mainfrom
feat/security-audit-fixes

Conversation

@masterfung

@masterfung masterfung commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • npm rebrand: Package renamed from @trymightyai/citadel-guard-openclaw to @mightyai/citadel-guard-openclaw (GitHub org stays TryMightyAI)
  • SHA256 checksum verification for Go binary postinstall downloads (graceful degradation if checksums.txt not yet published)
  • CVE-2026-25253 defense-in-depth: Local gatewayUrl pattern detection in plugin, catches vague natural-language variants the Go scanner misses
  • CI fixes: Lint errors (import sorting, optional chaining, template literals) and typecheck errors resolved
  • Binary upgrade support: CITADEL_FORCE_DOWNLOAD=1 to re-download, CITADEL_REQUIRE_CHECKSUM=1 for strict mode
  • BERT model docs: Added CITADEL_AUTO_DOWNLOAD_MODEL and CITADEL_ENABLE_HUGOT env vars to README and postinstall output

Test plan

  • bun run typecheck passes
  • bun run lint passes (0 errors)
  • bun test passes (356 pass, 0 fail)
  • npm pack --dry-run shows @mightyai/citadel-guard-openclaw@0.1.1
  • CITADEL_SKIP_BINARY=1 node scripts/install-citadel-binary.mjs exits cleanly
  • Postinstall graceful failure (no Go release yet) exits 0
  • CI passes on GitHub Actions

🤖 Generated with Claude Code

masterfung and others added 9 commits February 1, 2026 12:17
Tests all 4 HTTP hooks that will be enabled when OpenClaw PR #6405 merges:
- http_request_received: Prompt injection detection
- http_response_sending: Credential leak detection
- http_tool_invoke: Dangerous command detection
- http_tool_result: Indirect injection detection

Coverage report validates 8 test cases across all hook types.
Requires Citadel scanner running for live tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restore the 4 HTTP API security hooks that were removed from main:
- http_request_received: Scans inbound HTTP API requests
- http_response_sending: Scans outbound API responses
- http_tool_invoke: Scans tool arguments before execution
- http_tool_result: Scans tool results for indirect injection

These hooks will be enabled when OpenClaw PR #6405 merges.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Security Fixes:
- Add configurable fail-open/fail-closed behavior per scan type
- Add binary path validation for sidecar execution
- Add streaming response handling with configurable blocking
- Fix health endpoint to not expose internal URLs
- Fix logging to not leak content (logs length only)

New Files:
- plugin/security-fixes.ts: Security fix implementations
- tests/security-fixes.test.ts: Unit tests for fixes
- tests/security-audit-validation.test.ts: Vulnerability validation
- tests/security-audit-live.test.ts: Live tests against plugin
- tests/integration-security.test.ts: Integration tests
- tests/e2e-messaging-platforms.test.ts: E2E Slack/Discord/Telegram/WhatsApp
- tests/mock-citadel-server.ts: Mock server for testing

Modified:
- plugin/index.ts: Applied all security fixes to hooks
- citadel-openai-proxy.ts: Fixed health endpoint and logging
- tests/http-hooks.test.ts: Fixed output scan assertions

Test Results: 345 pass, 0 fail against real Citadel BERT ML

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove local shouldFailOpen() from index.ts, import from security-fixes.ts
- Remove local handleScanError(), use handleScanFailure() from security-fixes.ts
- Export ScanType from security-fixes.ts for consistent usage
- Update handleScanFailure signature to match handleScanError (error, context, scanType)
- Fix tests to use new parameter order
- Replace sk_test patterns with RSA private key patterns for reliable credential detection
- Net reduction: 26 lines removed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 4 test cases for MolBot/OpenClaw 1-click RCE vulnerability
- Tests verify Citadel blocks malicious gatewayUrl parameter patterns
- Tests verify social engineering and token theft attempts are blocked
- All tests pass against real Citadel with BERT ML model

Reference: https://github.com/ethiack/moltbot-1click-rce

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename npm package from @TryMightyAI to @mightyai/citadel-guard-openclaw
- Add SHA256 checksum verification for Go binary postinstall download
- Add CITADEL_FORCE_DOWNLOAD env var for binary upgrades
- Add CITADEL_REQUIRE_CHECKSUM env var for strict verification mode
- Add local CVE-2026-25253 pattern detection (defense-in-depth)
- Document CITADEL_AUTO_DOWNLOAD_MODEL and CITADEL_ENABLE_HUGOT env vars
- Fix lint errors (import sorting, optional chaining, template literals)
- Fix typecheck errors in local pattern detection integration
- Bump version to 0.1.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e names

- Postinstall now runs `citadel scan "test"` after binary download to
  trigger automatic BERT model download (~685MB, first time only)
- Fails gracefully if model download doesn't work (prints manual steps)
- CITADEL_SKIP_BINARY=1 skips everything for CI environments
- Update LAUNCH-POST.md: @tryMighty@MightyAI package references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ll model download

- Plugin auto-detects BERT model in models/ dir and passes HUGOT_MODEL_PATH
  to Citadel sidecar, enabling ML detection when model is available
- Fix pro-api normalization to derive BLOCK/ALLOW from output scan fields
  (is_safe, risk_score) when no explicit decision field present
- Expand install script with BERT model download logic
- Add models/ to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Format pro-api.ts multi-line conditional
- Replace Math.pow with ** operator in install script
- Use Number.parseInt instead of global parseInt
- Sort imports in install script
- Format long lines in install script
- Exclude models/ dir from biome checks (large tokenizer.json)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@masterfung
masterfung merged commit 253d48a into main Feb 10, 2026
2 checks passed
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