Intent-Code Divergence
Low
- Confidence
- 93% confidence
- Finding
- The code intends to restrict browser access to localhost, but `origin.startsWith("http://localhost")` also accepts attacker-controlled origins such as `http://localhost.evil.com`. If this server is reachable by a browser and the bearer token is exposed to that origin or a local web page, the CORS check can be bypassed and sensitive home automation actions can be invoked.
