Bug
The sec-hardcoded-url rule flags http:// URLs even when they appear in:
- Docstrings / comments — documentation examples showing default values
- Default configuration values —
http://127.0.0.1:8767 as a localhost default
Example flagged code (false positive)
"""...
Config via uteke.json:
UTEKE_SERVER_URL — uteke-serve HTTP URL (default: http://127.0.0.1:8767)
Useful when running as a container (e.g., http://uteke:8767).
..."""
Why this is a false positive
http://127.0.0.1:8767 is a localhost default — HTTPS on loopback is unnecessary and uncommon
http://uteke:8767 is a Docker internal hostname — TLS is not needed for container-to-container communication on the same host
- These URLs are in docstrings, not in actual connection code
- The rule should distinguish between hardcoded production endpoints and localhost/internal-network defaults
Suggested fix
- Skip URLs in docstrings and comments
- Skip
http://localhost, http://127.0.0.1, http://[::1], and http://<hostname> patterns (internal network)
- Only flag
http:// URLs that point to external/public domains
Environment
Bug
The
sec-hardcoded-urlrule flagshttp://URLs even when they appear in:http://127.0.0.1:8767as a localhost defaultExample flagged code (false positive)
Why this is a false positive
http://127.0.0.1:8767is a localhost default — HTTPS on loopback is unnecessary and uncommonhttp://uteke:8767is a Docker internal hostname — TLS is not needed for container-to-container communication on the same hostSuggested fix
http://localhost,http://127.0.0.1,http://[::1], andhttp://<hostname>patterns (internal network)http://URLs that point to external/public domainsEnvironment