Skip to content

fix: catch disabled TLS checks in session calls #783

Closed
4 of 4 issues completed
Closed

Description

@uniqueg

Problem

The semgrep rule tls-verification-disabled adds requests.$METHOD(..., verify=0) and $SESSION.verify = False/0 to ruff's S501, which flags verify=False only in calls of the requests module. Calls on a requests.Session (e.g., session.get(url, verify=False)) pass both ruff and semgrep, and the gateways (proTES, proWES) talk to their backends through sessions.

Two gaps in the JWT rules came up in the same review (Sourcery on elixir-cloud-aai/prowes#147):

  • jwt-decode-without-verification: verify_signature set to None (falsy, disables verification in PyJWT), inline and in assigned options.
  • jwt-decode-unsafe-algorithms: the header's alg extracted into a variable first (alg = header["alg"], then algorithms=[alg]); consider taint mode from jwt.get_unverified_header(...) to algorithms=.

What to do

  • Add $X.$METHOD(..., verify=False, ...) and verify=0, with $METHOD restricted to ^(get|post|put|patch|delete|head|options|request|send)$, with test cases (ruleid/ok) in .semgrep/foca.py.
  • Close the two JWT gaps above, with test cases.
  • Mirror the rules and their tests in proTES, trs-filer, cloud-registry and proWES (the rule files stay identical apart from paths).
  • In the same pass, port the two ast-grep rules that prowes#147 widened (string-status-code: returned tuples in parentheses; root-logger-call: logging.root, getLogger(name=None), with the keyword pattern ordered first) to trs-filer, proTES and cloud-registry, which have the same gaps.

Done when

  • session.get(url, verify=False) and the two JWT cases are flagged in all five repos, with identical rule files apart from paths.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    priority: medium
    status: triage
    type: security
    workload: hours
    on Nov 17, 2026
  2. added
    status: in progress
    and removed
    status: triage
    on Nov 17, 2026
  3. self-assigned this
    on Nov 17, 2026
  4. moved this from Backlog to In progress in ELIXIR On-Cloud: Low Priorityon Nov 17, 2026
  5. moved this from In progress to In review in ELIXIR On-Cloud: Low Priorityon Nov 17, 2026
  6. removed
    status: in progress
    on Nov 18, 2026
  7. added this to the v0.23.0 milestone on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: mediumtype: securityworkload: hours

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions