Skip to content

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

Draft
shaneahmed wants to merge 9 commits into
developfrom
alert-autofix-6
Draft

shaneahmed wants to merge 9 commits into
developfrom
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 shaneahmed added this to the Release 2.1.1 milestone May 20, 2026
@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c0bbb14) to head (e86610e).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #1054      +/-   ##
============================================
+ Coverage    99.91%   100.00%   +0.08%     
============================================
  Files          112        15      -97     
  Lines        13454      1243   -12211     
  Branches      1610         0    -1610     
============================================
- Hits         13443      1243   -12200     
+ Misses           5         0       -5     
+ Partials         6         0       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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