Security hardening - prevent command injection, limit SSE connections, harden container#39
Open
keithdealwis-ui wants to merge 1 commit intocalesthio:masterfrom
Open
Conversation
- Validate PORT env var to prevent command injection via exec() - Add 100 connection limit to SSE endpoint to prevent DoS - Install wget in Dockerfile for health checks - Add non-root user (crucix:1001) to container Co-Authored-By: Claude Code <[email protected]>
Owner
|
I haven't been able to get to this yet because work has been busy, but I definitely plan to review it over the weekend. |
schergr
pushed a commit
to schergr/Crucix
that referenced
this pull request
Mar 23, 2026
- Replace single &calesthio#39; handler with generic numeric/hex entity decoder so &calesthio#39; and other unpadded entities are properly converted - Dedup urgent OSINT posts against all hot memory runs (last 3 sweeps) instead of only the previous sweep, preventing posts that drop out of one sweep from reappearing as "new" in the next Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three security improvements to harden Crucix against common attack vectors:
PORTenvironment variableAll changes are non-breaking and backward compatible.
1. Command Injection Prevention (crucix.config.mjs)
Issue:
PORTenv var is passed unsanitized tochild_process.exec()when auto-opening browser:Attack vector: Malicious
.envfile could inject shell commands:Fix: Validate
PORTis numeric and within safe range (1024-65535) before use.CWE: CWE-78: OS Command Injection
2. Denial of Service Mitigation (server.mjs)
Issue:
/eventsSSE endpoint has no connection limit:Attack vector: Attacker opens 10,000+ connections → memory exhaustion → process crash.
Fix: Return HTTP 503 when
sseClients.size >= 100.CWE: CWE-400: Uncontrolled Resource Consumption
3. Container Security (Dockerfile)
Issues:
wgetbutnode:22-alpinedoesn't include it → silent failureFixes:
wgetviaapk add --no-cache wgetcrucix:1001and run as that userCWE: CWE-250: Execution with Unnecessary Privileges
Testing
All changes tested on production deployment:
docker compose up)docker exec ... whoami)Impact
.envfiles or public internetHappy to address any feedback or concerns.