Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #355 +/- ##
===========================================
Coverage 100.00% 100.00%
+ Complexity 434 433 -1
===========================================
Files 51 51
Lines 1131 1126 -5
===========================================
- Hits 1131 1126 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Instance::__toString() rendered a bound scalar's literal value. Every binding-diagnostics surface that stringifies a dependency -- ModuleString (the Bindings section, and AbstractModule::__toString()) and the Provenance log recorded at Container::add()/Container::merge() -- writes that plaintext value out wherever those diagnostics land, including the composition-time bindings.md. The same string was also one of the inputs hashed into BindingsMarkdown's cache signature; only the digest is persisted there, not the value itself, but the rendered surfaces above do persist it in plaintext. Changes: - Instance::__toString(): collapse the scalar branch into the existing type-only branch already used for array/NULL. Every non-object value now renders as a bare type tag; the object branch (class name only) is unchanged. - BindingsMarkdown::SIGNATURE_VERSION: 2 -> 3 -- the rendered format changed, so this invalidates previously cached bindings.md files (which may themselves contain the plaintext leak) on next boot. One behavioral note: a same-type scalar value change no longer invalidates the cache on its own, since the rendered output is now identical either way; a type change still does. Tests: tests/di/BindingsMarkdownTest.php and tests/di/ModuleTest.php -- new tests cover redaction in the Bindings section and its provenance "bind" event, the "replace" event, and the merge() kept/discarded collision path, each asserting the exact rendered Provenance line rather than a substring that the summary header would also satisfy; the existing cache-invalidation test is reworked around a type change. composer tests passes (cs, psalm, phpstan, phpunit -- 304/304, 0 failures).
c4ceb42 to
501f9e5
Compare
|
@coderabbitai review |
|
|
toInstance($val) で束縛した$valをセキュリティのために残さない、というPRです。 |
|
@coderabbitai full review Generated by Claude Code |
Action not completed
|
|
Closing in favour of #362. Redacting every scalar also hides non-secret values that the diagnostics exist to show, and the library cannot tell which scalar is a secret. A value bound through a provider never reaches |
Problem
Instance::__toString()renders a bound scalar's literal value. Every surface that stringifies a dependency inherits this: the Bindings section (ModuleString), the Provenance log (Container::add()/merge()), andbindings.md. AtoInstance()binding of sensitive data (e.g. an app binding its env config as named scalars) is written to disk in plaintext. CWE-532 (insertion of sensitive information into a diagnostics artifact).Fix
Instance::__toString(): scalar values render as a bare type tag ((string)), same as the existingarray/NULLbranches. No value is interpolated.BindingsMarkdown::SIGNATURE_VERSION: 2 → 3, to invalidate previously cached (unredacted)bindings.mdfiles.Note: a same-type value change alone no longer invalidates the cache, since the rendered output is unchanged; a type change still does.
Tests
New coverage in
tests/di/BindingsMarkdownTest.phpfor redaction in the Bindings section and its provenancebindevent, thereplaceevent, and themerge()kept/discarded path — each asserting the exact rendered Provenance line rather than a substring the summary header would also satisfy.tests/di/ModuleTest.phpgolden updated.composer testspasses (304/304).Summary by CodeRabbit