Skip to content

fix: prevent field label leak through rule parameters in validation messages - #10579

Open
gr8man wants to merge 1 commit into
codeigniter4:developfrom
gr8man:fix/validation-param-label-leak
Open

gr8man wants to merge 1 commit into
codeigniter4:developfrom
gr8man:fix/validation-param-label-leak

Conversation

@gr8man

@gr8man gr8man commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description

Validation::getErrorMessage() used the rule parameter as a key into the
defined field rules to substitute the referenced field's label in the error
message. When a parameter that was not a field reference (e.g. a numeric
limit like min_length[secret]) coincidentally matched a defined field
name, that field's label leaked into the error message (information
disclosure of internal field labels plus a wrong message).

Label substitution now only applies to rules whose parameter is a field
reference: matches, differs, required_with, required_without. Other
rules render the parameter verbatim.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

…essages

getErrorMessage() resolved a rule parameter as a key into the field rules
to substitute the referenced field's label. A parameter that was not a
field reference (e.g. min_length[secret]) could coincidentally match a
defined field name and leak its label into the error message.

Label substitution now only applies to field-referencing rules
(matches, differs, required_with, required_without).
@carson-codeigniter4 carson-codeigniter4 Bot added the bug Verified issues on the current code behavior or pull requests that will fix them label Sep 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant