Skip to content

The tls verify false security pattern fires on any verify=False keyword argument #3375

Open

Description

@RaghavChamadiya

Summary

The tls_verify_false security pattern fires on any verify=False keyword argument, not only on an HTTP or TLS call. Code that passes verify=False to its own function gets a medium-severity "TLS certificate verification turned off" finding.

packages/core/src/repowise/core/analysis/security_scan.py:270

(re.compile(r"verify\s*=\s*False"), "tls_verify_false", "med"),

Mechanism

  • The pattern is a bare regex over the masked line. verify is a common keyword for "check the result" in code that has nothing to do with TLS.
  • This repo trips it: packages/server/src/repowise/server/services/refactoring_health.py:338, await load_fix_first(self._session, self._repository_id, limit=None, verify=False), where verify means "skip the live re-check of stored items".
  • Other rules in the file already ask what is being called. exec_call comes from the AST for Python and from child_process bindings for JS (_call_findings, :755; _child_process_exec_calls, :154), and subprocess_shell_true is matched as a multi-line call because subprocess.<call>( and shell=True can land on different lines. tls_verify_false is the call-shaped rule still matching on the keyword alone.

Repro

from repowise.core.analysis.security_scan import scan_source
for src in ["queue = await load_fix_first(self._session, self._repository_id, limit=None, verify=False)\n",
            "x = session.get(url, verify=False)\n",
            "def f(sort=False, verify=False): pass\n"]:
    print([f["kind"] for f in scan_source("m.py", src)])

On main (1eb62ca):

['tls_verify_false']
['tls_verify_false']
['tls_verify_false']

The first and third are false positives. The second must stay a finding.

Impact

Findings feed the security view, the overview attention list and the commit gate (security_gate.py:106 prints "TLS certificate verification turned off" with the snippet). A medium finding on an ordinary function argument costs trust in the rule, and the user cannot tell why it fired.

Done looks like

  • The finding requires an HTTP or TLS call context: verify=False is an argument of a call whose callee is a client entry point (requests / httpx / aiohttp / urllib3 verbs, request, Session, Client, AsyncClient, ClientSession, TCPConnector), or an ssl context built unverified. Decide whether an unresolved receiver (session.get(url, verify=False)) counts. Matching on the callee name instead of the receiver's type is the cheap rule, and the PR should say what it measured on a few real repos.
  • A def f(verify=False) parameter default is never a finding.
  • Python goes through the AST, as _call_findings does; other languages keep today's masked-line behaviour unless the PR measures otherwise.
  • A change to what this rule reports is a scanner change, so it bumps SECURITY_SCANNER_VERSION (security_scan.py:44, currently 2) so update rescans existing indexes. One bump per release: check main's value first and do not bump twice if another scanner PR already did.
  • Not a first issue: it needs a call-context rule that works across keyword and multi-line calls, plus a precision check on real code.

Tests

tests/unit/analysis/test_security_scan.py (the parametrised test_tls_verify_false_ignores_prose near :526): keep requests.get(url, verify=False) and add httpx.Client(verify=False) and a multi-line requests.post(\n url,\n verify=False,\n) as findings; add load_fix_first(..., verify=False) and a verify=False parameter default as non-findings.

Activity

  1. daniyar-taibekk commented on Oct 10, 2026

    @daniyar-taibekk

    Hi! I'd like to work on this issue as part of my university Software Engineering course. Could you please explicitly assign this issue to me, either through GitHub's assignee field or by confirming in a comment that I can take ownership? My course requires maintainer confirmation, thank you)

  2. swati510 commented on Oct 11, 2026

    @swati510
    Collaborator

    @daniyar-taibekk assigned to you

  3. daniyar-taibekk commented on Oct 14, 2026

    @daniyar-taibekk

    Hi! Thanks for assigning this issue to me. While investigating the current main branch, I noticed that PR #3534 (commit f81791a) has already introduced AST-based handling for tls_verify_false, including HTTP client context checks and regression tests. Could you please clarify whether there are any remaining cases you'd like me to address under #3375, particularly unresolved receivers such as session.get(url, verify=False)? I'd be happy to work on the remaining scope and contribute additional tests or improvements)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions