Skip to main content

SKY-L011 · Logic and resilience

Disabled security control

Varies

The catalog gives no severity. Turning off TLS checks, CSRF protection or login, and ALLOWED_HOSTS = ["*"], are HIGH. Insecure settings such as DEBUG = True or SESSION_COOKIE_SECURE = False are MEDIUM.

Code that switches off a protection a library gives by default. Examples are certificate checks (verify=False), CSRF protection (@csrf_exempt), login (@login_not_required), and framework settings such as DEBUG = True or cookies that may travel over plain HTTP.

Languages
Python
Quality gate
counted toward the gate limits (full and diff scans)
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

With verify=False the client accepts any certificate, so anyone on the network path (a hotel Wi-Fi, a compromised proxy) can read the traffic and change the rates the service returns. Such switches are often added to get past a local error and then shipped.

What Skylos flags

rates/client.py · PythonReported on line 13
"""Client for the internal exchange-rate service.""" import requests RATES_URL = "https://rates.internal.example.com"  def fetch_rates(currency):    response = requests.get(        f"{RATES_URL}/rates/{currency}",        timeout=10,        headers={"Accept": "application/json"},        verify=False,    )    response.raise_for_status()    return response.json()

What Skylos leaves alone

rates/client.py · Python
"""Client for the internal exchange-rate service.""" import requests RATES_URL = "https://rates.internal.example.com"CA_BUNDLE = "/etc/ssl/certs/internal-ca.pem"  def fetch_rates(currency):    response = requests.get(        f"{RATES_URL}/rates/{currency}",        timeout=10,        headers={"Accept": "application/json"},        verify=CA_BUNDLE,    )    response.raise_for_status()    return response.json()

Why Skylos leaves it alone

verify is set, but to the path of a CA bundle, so certificates are still checked against the company's own certificate authority. Skylos only reports the literal value False.

How Skylos decides

  1. Runs with --quality on Python files. Skips test files (test_*.py, *_test.py and conftest.py).
  2. Reports HIGH, on the value, for a keyword argument verify=False or check_hostname=False in any call, and for a call to _create_unverified_context().
  3. Reports HIGH for a function decorated with @csrf_exempt or @login_not_required, and for an ALLOWED_HOSTS list that contains "*".
  4. Reports MEDIUM for a plain assignment of DEBUG = True, or of False to SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE, SESSION_COOKIE_HTTPONLY, CSRF_COOKIE_HTTPONLY, WTF_CSRF_ENABLED, JWT_VERIFY or JWT_VERIFY_EXPIRATION.
  5. Only literal values count: verify=settings.VERIFY_TLS or DEBUG = os.environ.get("DEBUG") == "1" is not reported.

How to fix it

Keep certificate checks on. When a service uses a private certificate authority, pass its CA bundle to verify (or set REQUESTS_CA_BUNDLE) instead of turning verification off.

rates/client.py · Python · the fix, against the flagged file
"""Client for the internal exchange-rate service.""" import requests RATES_URL = "https://rates.internal.example.com"  def fetch_rates(currency):    response = requests.get(        f"{RATES_URL}/rates/{currency}",        timeout=10,        headers={"Accept": "application/json"},Removed:         verify=False,    )    response.raise_for_status()    return response.json()

When it can be wrong

  • Any keyword named verify set to False is reported, even when it has nothing to do with TLS, such as a verify=False flag on your own function.
  • DEBUG = True in a settings file used only for local development is reported.
  • It misses the same switches when the value comes from a variable or the environment.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Put the marker on the line that holds False (for a decorator, the decorator line).

    Python
    verify=False,  # skylos: ignore[SKY-L011] local test server only
  • [tool.skylos] ignore = ["SKY-L011"] turns the rule off for the project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.