Skip to content

Potential fix for code scanning alert no. 6: Failure to use secure cookies#1054

Draft
shaneahmed wants to merge 2 commits intodevelopfrom
alert-autofix-6
Draft

Potential fix for code scanning alert no. 6: Failure to use secure cookies#1054
shaneahmed wants to merge 2 commits intodevelopfrom
alert-autofix-6

Conversation

@shaneahmed
Copy link
Copy Markdown
Member

Potential fix for https://github.com/TissueImageAnalytics/tiatoolbox/security/code-scanning/6

Set the session_id cookie with secure=True so browsers only send it over HTTPS. Keep existing behavior intact by preserving the same cookie name/value and httponly=True, and only adding the missing security attribute.

Best single change:

  • File: tiatoolbox/visualization/tileserver.py
  • Region: session_id method, line with resp.set_cookie(...) (around line 393)
  • Update:
    • from: resp.set_cookie("session_id", session_id, httponly=True)
    • to: resp.set_cookie("session_id", session_id, httponly=True, secure=True)

No new imports, methods, or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

shaneahmed and others added 2 commits April 10, 2026 14:19
…okies

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant