Skip to content

avoid marshal.loads in XML_unpickle reachable via ticket allowlist - #2654

Merged
leonelcamara merged 1 commit into
web2py:masterfrom
madib06ops:xml-unpickle-marshal
Jul 13, 2026
Merged

avoid marshal.loads in XML_unpickle reachable via ticket allowlist#2654
leonelcamara merged 1 commit into
web2py:masterfrom
madib06ops:xml-unpickle-marshal

Conversation

@madib06ops

Copy link
Copy Markdown
Contributor

gluon.restricted.TicketStorage loads error-ticket data through the SafeUnpickler allow-list, which whitelists gluon.html.XML_unpickle so pickled XML snapshots in a ticket survive the round trip. XML_unpickle runs marshal.loads on the pickled bytes, so a crafted ticket in an app errors/ folder or the web2py_ticket table is still handed to an unsafe deserializer (marshal.loads is documented as not secure against maliciously constructed data) when the admin ticket viewer opens it, which is exactly what the restricted unpickler was meant to prevent. XML only wraps text, so pickle the string directly and drop the marshal indirection; valid tickets round-trip unchanged.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.82%. Comparing base (92d22b2) to head (7dfdbfe).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2654      +/-   ##
==========================================
- Coverage   50.99%   50.82%   -0.17%     
==========================================
  Files          42       42              
  Lines       15532    15531       -1     
  Branches     3416     3416              
==========================================
- Hits         7920     7894      -26     
- Misses       6561     6580      +19     
- Partials     1051     1057       +6     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leonelcamara
leonelcamara merged commit d0de4a8 into web2py:master Jul 13, 2026
5 checks passed
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.

3 participants