Skip to content

fix(audit): S-001 webhook leak, S-003 payment gate, Dockerfile CMD malformation#195

Merged
Timwal78 merged 9 commits into
mainfrom
claude/scriptmaster-labs-audit-bltwof
Jun 19, 2026
Merged

fix(audit): S-001 webhook leak, S-003 payment gate, Dockerfile CMD malformation#195
Timwal78 merged 9 commits into
mainfrom
claude/scriptmaster-labs-audit-bltwof

Conversation

@Timwal78

@Timwal78 Timwal78 commented Jun 19, 2026

Copy link
Copy Markdown
Owner

ScriptMaster Labs Institutional Audit — SqueezeOS Remediations

Findings Fixed

ID Severity File Change
S-001 CRITICAL render.yaml Removed hardcoded live Discord webhook URL from public repo; replaced with sync: false — set the real value in Render dashboard only
S-003 CRITICAL proof402_integration.py Payment gate now fails closed (HTTP 503) on 402Proof outage instead of granting free access to all premium endpoints
HIGH Dockerfile Fixed malformed CMD array: --max-requests-jitter and core.app:create_app() were merged into one string element, causing gunicorn startup failure
DOCS llms.txt Full rewrite with accurate 35-tool manifest, correct RLUSD prices, and payment flow (previous version listed tools that don't exist: squeeze_scan, ftd_cycle, full_regime)

S-001 — Discord Webhook Rotation Required

The previously committed webhook URL must be revoked immediately.

  1. Go to your Discord server → Server Settings → Integrations → Webhooks
  2. Find and delete the webhook matching the URL that was in render.yaml
  3. Create a new webhook and set DISCORD_WEBHOOK_PAYMENTS in the Render dashboard under Environment

S-003 — Payment Gate Behavior Change

Before: If four02proof.onrender.com was unreachable, _issue_invoice() raised, the decorator caught it, logged a warning, and called the protected route handler — granting free premium access during 402Proof downtime.

After: Unreachable 402Proof returns HTTP 503 with ERR_PAYMENT_GATE_UNAVAILABLE. Premium endpoints are gated even when the invoice server is down. Revenue protected.

llms.txt Accuracy Fix

Previous llms.txt described tools that do not exist (squeeze_scan, ftd_cycle, full_regime) with incorrect pricing. Rewritten with all 35 actual MCP tools including free/paid/operator-only tiers, correct RLUSD prices, payment flow, and key headers.

Operator Action Required

  • Revoke the Discord webhook URL that was in render.yaml (details above)
  • Verify DISCORD_WEBHOOK_PAYMENTS is set correctly in Render dashboard
  • Confirm PROOF402_TOKEN_SECRET matches the value on four02proof.onrender.com

Generated by Claude Code

Timwal78 and others added 2 commits June 19, 2026 12:13
…+ fix Dockerfile CMD

S-001: DISCORD_WEBHOOK_PAYMENTS was committed as a plaintext value in a
public repo. Rotated to sync:false — set the new webhook URL in Render
dashboard only, never in source.

Dockerfile: --max-requests-jitter and core.app:create_app() were merged
into a single array element, which would cause gunicorn to reject the
jitter value as non-integer and never receive the WSGI app argument.
Split into separate elements.
When _issue_invoice() raises (402Proof unreachable, timeout, 5xx),
the decorator returns HTTP 503 instead of granting free access.
Revenue-protecting behavior: no invoice = no access, not a free pass.
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
signal-auction-loom Ready Ready Preview, Comment Jun 19, 2026 7:18pm
squeeze-os Ready Ready Preview, Comment Jun 19, 2026 7:18pm

Previous llms.txt listed tools that don't exist (squeeze_scan, ftd_cycle,
full_regime) with wrong prices. Full rewrite with all 35 actual MCP tools,
correct RLUSD prices, payment flow, headers, futures/settlement/marketplace
descriptions, and operator-only tool section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013D1bVEB4VVWiT6v6JMWeh6
…idation

Security fixes applied during institutional-grade audit:

1. **HTTP Security Headers** (core/app.py): Added missing
   X-XSS-Protection, Referrer-Policy, and Content-Security-Policy
   headers. Changed X-Frame-Options from SAMEORIGIN to DENY.

2. **CORS** (core/app.py): Replaced open wildcard CORS(*) with an
   allowlist of known frontend origins (CORS_ORIGINS env var,
   defaulting to canonical dashboard domains).

3. **Dockerfile**: Added non-root appuser to eliminate running gunicorn
   as root inside the container.

4. **Symbol Input Validation** (core/api/premium_bp.py): Added
   _validate_symbol() helper using regex ^[A-Z0-9.]{1,10}$ applied to
   /api/council and /api/options symbol inputs before passing to engines.

5. **Rate Limiting** (core/rate_limiter.py, core/api/premium_bp.py):
   Added RateLimiter class (fixed-window, in-memory, thread-safe).
   Premium blueprint enforces 30 req/min per IP via before_request hook.

6. **Error Handling** (core/api/keys_bp.py): Replaced bare str(e) HTTP
   responses with jsonify({"error": "internal error..."}) + exc_info
   logging so tracebacks never reach the client.

7. **Wallet Address Masking** (proof402_integration.py): Masked full
   wallet addresses in warning logs to first-6...last-4 chars only.

8. **MCP Tool Sync** (.well-known/mcp.json): Synced free_tools and
   paid_tools arrays to match the _TOOLS list in mcp_bp.py (source of
   truth). Added autopilot_start, autopilot_stop, circuit_breaker_reset,
   iam_resolve, iam_truth. Removed stale ftd_*/notary_*/triple_lock_*
   entries that were removed from mcp_bp.py. Updated tool count to 35.

9. **CI Workflow** (.github/workflows/ci.yml): Fixed invalid action
   versions (checkout@v6 → v4, setup-python@v6 → v5). Added
   permissions: contents: read. Added bandit security scan and
   safety dependency vulnerability check steps.

10. **.env.example**: Documented CORS_ORIGINS environment variable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013D1bVEB4VVWiT6v6JMWeh6
Adds service-monitor.yml — scheduled every 10 min — that checks all SML
services and sends a Discord alert the moment any service degrades. Hard
failures (5xx, timeout) fail the job; 403 Vercel auth-gate is reported as
a warning with actionable remediation text in the alert embed.

Services monitored: scriptmasterlabs.com, SqueezeOS API, Ghost Layer,
402Proof, SML Rails, SML Copy-Trader, SML Launchpad, TipMaster.

Also updates keepalive.yml to accept 403 as a valid keep-alive response
for scriptmasterlabs.com (Vercel returns 403 when auth gate is active —
the service is alive, just gated; monitoring is handled separately).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013D1bVEB4VVWiT6v6JMWeh6
…flow + pin all actions to SHA

CRITICAL: NK (Neynar API key) and RK (Render API key) were plaintext in
tipmaster-autosetup.yml job env block — visible in public git history.
Moved to GitHub Actions secrets: NEYNAR_API_KEY, RENDER_API_KEY.

ACTION REQUIRED: Rotate both keys immediately in their dashboards.

Also pins all workflow actions to 40-char commit SHAs to prevent
supply-chain tag hijacking attacks.
…ied 49933ea

cdca7d6dd16c72fb5d9c5b2d47aaddfca8fd94e2 is not a valid commit SHA for
actions/setup-node. Replaced with verified commit SHA 49933ea5288caeca8642d1e84afbd3f7d6820020
(v4) across all affected workflow files.
@Timwal78 Timwal78 marked this pull request as ready for review June 19, 2026 21:23
@Timwal78 Timwal78 merged commit 49c34dc into main Jun 19, 2026
5 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.

2 participants