Exit code: 3
Output:
{"localOnly":true,"disclaimer":"Heuristic FastAPI security rules run against the host application's middleware stacks, security dependencies and source only. These checks are review prompts, not verdicts, and should be validated against the application's threat model.","filterChains":["any request","/static/**"],"filterChainsAnalyzed":2,"rulesEvaluated":22,"violationsFound":1,"severityCounts":[{"severity":"CRITICAL","count":0},{"severity":"HIGH","count":0},{"severity":"MEDIUM","count":1},{"severity":"LOW","count":0},{"severity":"INFO","count":0}],"scan":{"analyzer":"sharpit FastAPI Security Advisor","status":"PARTIAL","message":"Security Advisor completed against 2 middleware stacks. Some configuration remains unobserved: application source: no loaded module holds the application and app_package is not set. Unsupported or incomplete evidence remains unknown; skipped checks are not security passes.","scannedAt":1795083044637,"rulesEvaluated":22,"filterChainsAnalyzed":2,"violationsFound":1},"results":[{"id":"SEC-FAPI-001","name":"Host header should be restricted to known hosts","category":"Transport and headers","severity":"MEDIUM","description":"Without TrustedHostMiddleware (or with allowed_hosts=[\"*\"]) any Host header is accepted, which enables host-header injection in generated URLs and cache poisoning.","status":"VIOLATION","violationCount":1,"sampleViolations":["No TrustedHostMiddleware: any Host header is accepted."],"recommendation":"Add TrustedHostMiddleware with the exact host names the app serves.","learnMoreUrl":"https://fastapi.tiangolo.com/advanced/middleware/","dismissed":false,"sampleLocations":[]}],"evidence":{"usable":true,"coverageComplete":false,"limitations":["application source: no loaded module holds the application and app_package is not set"]},"violationDetails":{"scanId":"89b23107fc02d157","total":1,"retained":1,"retentionLimit":10000,"truncated":false,"locationNotes":[],"changes":null},"analysisErrors":[]}
