scurl stores your API keys in ~/.scurl/config.toml. Here's how to keep them secure:
Files that contain secrets:
~/.scurl/config.toml- Your personal config (in home directory)config.toml- Any test configs in the project directory.envfiles - Environment variable files
These are already in .gitignore, but always double-check before committing!
# Set restrictive permissions on your config
chmod 600 ~/.scurl/config.toml
# Verify permissions
ls -la ~/.scurl/config.toml
# Should show: -rw------- (only you can read/write)- Never share your
config.toml - Don't post screenshots with API keys visible
- Don't commit config files to version control
- Rotate keys if they're exposed
When available, use API keys with minimal required permissions:
- Anthropic: Use keys with API access only
- xAI: Limit to model access
- OpenAI: Use project-scoped keys
- Ollama: No API key needed -- runs locally
# Update your API key
scurl login # Re-run to update
# Or manually edit config
nano ~/.scurl/config.toml- Use full-disk encryption
- Lock your screen when away
- Don't run scurl as root unnecessarily
- Keep your OS updated
When using scurl in CI/CD, use proper secret management:
GitHub Actions:
- name: Run scurl
env:
SCURL_API_KEY: ${{ secrets.SCURL_API_KEY }}
run: |
scurl --provider xai https://example.com/install.shGitLab CI:
script:
- SCURL_API_KEY=$SCURL_API_KEY scurl --provider anthropic https://example.com/install.shNever hardcode keys in CI config files!
If you discover a security vulnerability in scurl:
- Security bugs in scurl code
- Vulnerabilities in dependencies
- Issues with secret handling
- API key exposure risks
For sensitive issues:
- DO NOT open a public GitHub issue
- Email: [your-security-email@example.com]
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
For non-sensitive issues:
- Open a GitHub issue with
[SECURITY]prefix - Provide details without exposing actual vulnerabilities
- Acknowledgment: Within 48 hours
- Initial assessment: Within 1 week
- Fix timeline: Depends on severity
- Critical: 1-3 days
- High: 1 week
- Medium: 2 weeks
- Low: Best effort
✅ Stores keys locally - Not sent anywhere except to configured API
✅ HTTPS only - All API calls use secure connections
✅ No telemetry - We don't collect usage data
✅ Open source - Code is auditable
✅ Sandboxed execution - Scripts run in an OS-level sandbox by default
❌ No key rotation - You must manually update keys ❌ No multi-user support - One config per user account
- OS Keyring Integration - API keys can be stored in the OS keyring (macOS Keychain, Windows Credential Manager, Linux Secret Service) instead of plaintext config files. Run
scurl loginand the key will be stored in the keyring automatically when available. If a key is stored in plaintext and the keyring is available, scurl warns at startup and directs you to migrate. - Audit Logging - Every analysis is logged to
~/.scurl/audit.logwith timestamp, URL, SHA-256 hash, findings summary, risk level, raw AI response, and execution decision. The log file has0600permissions. - Script SHA-256 Hashing - SHA-256 hashes are computed and displayed for every downloaded script, enabling verification and traceability.
- Shell Validation - The
--shellflag is validated against an allowlist of known shells (bash,sh,zsh,fish,dash,ksh,csh,tcsh) and verified to exist on the system. - Null Byte Detection - Downloaded scripts are rejected if they contain null bytes, preventing binary injection.
- AI Contradiction Detection - If AI analysis rates a script as SAFE/LOW but mentions dangerous keywords (reverse shell, backdoor, etc.), the risk level is automatically escalated.
- AI Response Size Limit - Provider responses are capped at 1 MB to guard against excessively large or malicious payloads.
Script execution is sandboxed by default using OS-level isolation. Opt out with --no-sandbox.
Backends:
- Linux (preferred): bubblewrap (
bwrap) — unprivileged, namespace-based sandbox. Install:sudo apt install bubblewrap(Debian/Ubuntu) orsudo dnf install bubblewrap(Fedora). - Linux (fallback): firejail — SUID-based sandbox. Used when bwrap is not available, with a warning about its SUID model.
- macOS:
sandbox-exec— built-in macOS sandboxing via Seatbelt profiles.
What the sandbox restricts:
- Network: All network access is denied (no outbound connections, loopback only on Linux with bwrap).
- Filesystem: Root filesystem is read-only. Only
/tmpis writable. System directories (/usr,/bin,/lib,/etc) are mounted read-only. - Capabilities (bwrap): All Linux capabilities are dropped (
--cap-drop ALL), preventing escalation viaCAP_SYS_PTRACE,CAP_NET_RAW, etc. - Process isolation (bwrap): PID, IPC, UTS, and cgroup namespaces are isolated. Terminal injection is prevented via
--new-session.
If sandboxing is enabled and no backend is found, scurl will refuse to execute and print installation instructions. This is intentional — silent fallback to unsandboxed execution would defeat the purpose of a security tool.
- Keys format:
sk-ant-... - Dashboard: https://console.anthropic.com
- Can delete keys anytime
- No automatic expiration
If compromised:
- Delete key in Anthropic console
- Generate new key
- Run
scurl loginwith new key
- Keys format:
xai-... - Dashboard: https://console.x.ai
- Can revoke keys anytime
If compromised:
- Revoke key in xAI console
- Generate new key
- Run
scurl loginwith new key
- Keys format:
sk-... - Dashboard: https://platform.openai.com/api-keys
- Can set expiration dates
- Project-scoped keys available
If compromised:
- Revoke key in OpenAI dashboard
- Generate new project-scoped key
- Run
scurl loginwith new key
- No API key stored (uses placeholder)
- Runs entirely on localhost
- No credentials to compromise
- Scripts are only sent to your local machine
scurl analyzes scripts but execution is still risky:
- ✅ Review the AI analysis findings
- ✅ Check the source URL is trusted
- ✅ Verify HTTPS is used
- ✅ Read the recommendation
- ✅ Consider the risk level
# Always review first (don't auto-execute untrusted sources)
scurl https://unknown-site.com/install.sh
# Only auto-execute from trusted sources
scurl -a https://sh.rustup.rs # Rust's official installer
# Test in a container first
docker run -it ubuntu bash
# Inside container: scurl https://example.com/install.sh| Level | Meaning | Action |
|---|---|---|
| SAFE | No concerns found | Generally safe to execute |
| LOW | Minor concerns | Review findings, usually safe |
| MEDIUM | Some risks | Carefully review before executing |
| HIGH | Significant risks | Only execute if you understand the risks |
| CRITICAL | Severe threats | DO NOT EXECUTE |
- Can miss sophisticated attacks
- May have false positives
- Context-dependent (official repo vs. random site)
- No guarantee of safety
- Static analysis patterns cover known attack vectors but cannot detect novel obfuscation techniques
- Contradiction detection catches obvious misclassifications but cannot prevent all prompt injection
Always use your judgment!
If you're contributing to scurl:
- Never log API keys or secrets
- Validate all user input
- Use secure dependencies
- Follow Rust security best practices
- Run
cargo auditregularly
# Check for vulnerabilities
cargo audit
# Run security-focused lints
cargo clippy -- -D warnings
# Format code
cargo fmtSecurity questions? Open an issue with the [SECURITY] tag or contact the maintainers.
Stay secure. Review scripts. Protect your keys. 🔒