Skip to content

Reject button names that unlock protected fields - #50

Merged
josbeir merged 4 commits into
mainfrom
fix/reject-overlapping-button-names
Nov 20, 2026
Merged

josbeir merged 4 commits into
mainfrom
fix/reject-overlapping-button-names

Conversation

@josbeir

@josbeir josbeir commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Rendering a hidden record.id=42 with a submit button named id previously allowed record.id=999 through CakePHP's form protection because unlocked names match path segments.

Collect enabled submit-button names separately from explicit unlocks. Before generating tokens, reject names overlapping protected submissions or form infrastructure, regardless of rendering order. Reset buttons, ordinary buttons, and disabled submit buttons do not register optional names or participate in overlap validation. Normalize nested submit names for CakePHP's optional-name matching.

Stage button registrations alongside inputs and restore them when an enclosing render fails, so catching an exception and continuing the same form cannot retain discarded optional names.

Regression tests cover protected and infrastructure name overlaps, both rendering orders, non-submitting controls sharing those names, legitimate optional buttons, hidden-value tampering, unprotected forms, failed custom renderers, and nested rollback/retry behavior.

Validation: composer validate --strict, formatting, and composer check passed: 865 tests, 3,523 assertions; analysis, lint, Rector, and format check clean. Xdebug Clover coverage: 100% (2,546/2,546 lines); greater-than-90% gate passed.

@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5334ada) to head (9529d1f).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #50   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      1089      1099   +10     
===========================================
  Files            119       120    +1     
  Lines           2949      2974   +25     
===========================================
+ Hits            2949      2974   +25     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@josbeir

josbeir commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T07:37:42.925645Z d80953f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d80953fdcb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Form/FormLifecycle.php Resolved
@josbeir
josbeir merged commit c5ccdf3 into main Nov 20, 2026
4 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.

2 participants