T09 · Insecure Skill Coding Practices
- Location
scripts/searxng.py:59- Finding
TLS Certificate Verification Disabled for All SearXNG Connections
- Content
View full analysis
Vulnerability Details
File Location:
scripts/searxng.py:59-66
Additional Location:scripts/searxng.py:20
Vulnerability Type: Improper certificate validation
Risk Level: HighVulnerable Code
python # Suppress SSL warnings for local self-signed certificates warnings.filterwarnings('ignore', message='Unverified HTTPS request')python try: # Disable SSL verification for local self-signed certs response = httpx.get( f"{SEARXNG_URL}/search", params=params, timeout=30, verify=False # For local self-signed certs )Technical Analysis
The HTTP client unconditionally uses
verify=False, disabling TLS certificate-chain and hostname validation for every configured SearXNG endpoint. The implementation does not limit this behavior to loopback endpoints or explicitly trusted self-signed certificates.Consequently, an HTTPS connection can be established through a forged, expired, self-signed, or otherwise invalid certificate. Suppressing unverified-request warnings at line 20 further obscures the insecure connection state. The documentation reinforces this configuration in
README.md:128-139by recommendingverify=Falseandcurl -k.Attack Path
- A user configures
SEARXNG_URLwith an HTTPS endpoint, including a public or remotely hosted instance. - An attacker gains a network interception position, such as through a malicious access point, compromised router, DNS manipulation, or hostile proxy.
- The attacker presents an invalid or attacker-controlled TLS certificate.
- Because
verify=Falseis set, the client accepts the certificate without authenticating the server. - The attacker reads search queries and returns modified SearXNG JSON responses.
- Manipulated titles, snippets, and URLs are displayed to the user or consumed by downstream automation.
Impact Assessment
This flaw compromises the c ...[truncated 433 chars]
- A user configures
- Remediation
View remediation
Remediation Suggestions
-
Remove
verify=Falseand use certificate verification by default:python response = httpx.get( f"{SEARXNG_URL}/search", params=params, timeout=30, verify=True, ) -
If self-signed certificates must be supported, accept a configurable CA certificate bundle rather than disabling verification:
python ca_bundle = os.getenv("SEARXNG_CA_BUNDLE", True) response = httpx.get( f"{SEARXNG_URL}/search", params=params, timeout=30, verify=ca_bundle, ) -
If an insecure mode remains necessary, require an explicit opt-in setting, clearly warn the user, and restrict it to loopback or otherwise validated local addresses.
-
Remove global warning suppression so insecure TLS states remain visible.
-
Update
README.mdto recommend installing or configuring the correct CA certificate instead of usingverify=Falseorcurl -k. -
Add tests confirming that invalid certificates are rejected by default.
-
