Skip to content

Release 2.4.0: SensitiveParameter on all input, EncryptionKeyProvider, storage context for Eloquent casts - #11

Merged
yuriizee merged 1 commit into
mainfrom
release-2.4.0
Oct 16, 2026
Merged

yuriizee merged 1 commit into
mainfrom
release-2.4.0

Conversation

@yuriizee

Copy link
Copy Markdown
Contributor

Security

  • Input is marked #[\SensitiveParameter] in every entry point, compiled hydrator, pipe, cast and Eloquent cast, so stack traces no longer carry card numbers when zend.exception_ignore_args is off (S1-06).
  • The EncryptedCast derived key is held in a SensitiveParameterValue and no longer shows up in var_export(), (array) casts or json_encode() (S1-12).
  • DateTimeCast / DateTimeImmutableCast without inputFormat mask card numbers in PHP's DateMalformedStringException; the exception type is unchanged.

Added

  • EncryptedCast(provider: ...) with the EncryptionKeyProvider contract (S1-13).
  • IsEloquentCastable accepts an output context (AccountData::class.':storage') so #[Hidden(except: ['storage'])] fields are stored (S1-10). Without a context nothing changes.

Verification

  • Docker: 785 tests, 100% line coverage (2005/2005).
  • StackTraceRedactionTest runs 18 failure scenarios with zend.exception_ignore_args=0 and asserts no frame argument contains the PAN.
  • Benchmarks before/after: −0.3% … +4.7% (noise).

…, storage context for Eloquent casts

- Mark input #[\SensitiveParameter] in entry points, compiled hydrators,
  pipes, casts and Eloquent casts so stack traces carry no card numbers
- Hold the EncryptedCast derived key in a SensitiveParameterValue
- Add EncryptedCast(provider:) with the EncryptionKeyProvider contract
- Accept an output context in IsEloquentCastable so #[Hidden(except:)]
  fields can be stored
- Mask card numbers in native DateMalformedStringException messages
@yuriizee
yuriizee merged commit 0993f81 into main Oct 16, 2026
4 checks passed
@yuriizee
yuriizee deleted the release-2.4.0 branch October 16, 2026 12:51
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