Skip to content

restrict SQLFORM.grid view/edit/delete to its own tables - #2647

Merged
leonelcamara merged 1 commit into
web2py:masterfrom
madib06ops:grid-view-table-allowlist
Jul 8, 2026
Merged

leonelcamara merged 1 commit into
web2py:masterfrom
madib06ops:grid-view-table-allowlist

Conversation

@madib06ops

Copy link
Copy Markdown
Contributor

The grid's new/view/edit/delete branches take the target table name from request.args and load db[request.args[-2]] without checking it against the tables the grid was built on. The view action is reachable without a signature for anonymous visitors, so a grid over a public table lets anyone request /f/view/auth_user/1 and read rows of unrelated tables (auth_user email/username and any other readable field, ignoring the grid's own query). This rejects any action whose URL table name is not one of the grid's tablenames, at all four sites.

@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

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.63%. Comparing base (022fcf7) to head (b45ac47).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2647      +/-   ##
==========================================
+ Coverage   50.56%   50.63%   +0.07%     
==========================================
  Files          42       42              
  Lines       15492    15500       +8     
  Branches     3405     3409       +4     
==========================================
+ Hits         7833     7849      +16     
+ Misses       6622     6610      -12     
- Partials     1037     1041       +4     
🚀 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 a7a09a8 into web2py:master Jul 8, 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