You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SEC: Server-Side Request Forgery leads to Denial of Service #179
An admin user can set the skills library URL to an internal address, forcing the backend to connect to internal services. This exhausts backend resources (connection pools, worker threads), causing DoS and making the application unresponsive.
Steps to Reproduce
# Set URL to internal address
PUT /api/settings/skills_library_url
{"value":"https://127.0.0.1:8000"}
# Trigger sync — backend connects to itself, exhausting threads
POST /api/skills/library/sync
{}
# Observe significantly increased response times across all endpoints
Remediation
Implement strict input validation: hostname must explicitly match github.com
Root cause: PUT /api/settings/skills_library_url accepted arbitrary URLs without validation. An admin could set the skills library URL to an internal address, and POST /api/skills/library/sync would connect to it, exhausting backend resources.
Fix: Strict URL validation at two layers:
Write-time validation (routers/settings.py): Rejects invalid URLs when skills_library_url is being saved
Sync-time validation (services/skill_service.py): Defense-in-depth check before git operations
Validation rules (utils/url_validation.py):
HTTPS scheme required
Hostname must be exactly github.com or www.github.com
Non-http schemes (ftp://, file://) rejected
DNS resolution checked against private/loopback/reserved IP ranges
Various bypass attempts blocked (@-sign, subdomain, lookalike)
Tests: 28 unit tests in tests/unit/test_ssrf_skills_library.py
Files changed:
src/backend/utils/url_validation.py — New validation module
src/backend/services/skill_service.py — Added validation before git sync
src/backend/routers/settings.py — Added validation on settings write
Activity
vybe commentedon Mar 27, 2026
Fix Implemented
Root cause:
PUT /api/settings/skills_library_urlaccepted arbitrary URLs without validation. An admin could set the skills library URL to an internal address, andPOST /api/skills/library/syncwould connect to it, exhausting backend resources.Fix: Strict URL validation at two layers:
routers/settings.py): Rejects invalid URLs whenskills_library_urlis being savedservices/skill_service.py): Defense-in-depth check before git operationsValidation rules (
utils/url_validation.py):github.comorwww.github.comTests: 28 unit tests in
tests/unit/test_ssrf_skills_library.pyFiles changed:
src/backend/utils/url_validation.py— New validation modulesrc/backend/services/skill_service.py— Added validation before git syncsrc/backend/routers/settings.py— Added validation on settings writetests/unit/test_ssrf_skills_library.py— 28 testsfix(security): SSRF prevention — validate skills library URL against …
sec(mcp): structure-validate .mcp.json content (AISEC-C2 Layer 2, #598)
sec(mcp): structure-validate .mcp.json content (AISEC-C2 Layer 2, #598)
fix(security): override git User-Agent on skills library sync (#184) (#…
Release: v0.6.0 (#998)
docs(releases): v0.6.0 release notes archive (#1016)
feat(skills): source-management endpoints, human-only on every mutati…
feat(skills): multi-source skills library — bundled community repo + …