Skip to content

Commit 997093a

Browse files
github-actions[bot]claude
authored andcommitted
(fix): address review findings — 1 HIGH, 0 MEDIUM
TenantFilter matched metadataCollection with str_contains, so any user collection whose name contains "_metadata" (e.g. audit_metadata) would have its tenant scope relaxed to also return NULL-tenant rows. Restored strict equality to match the pre-refactor SQL.php behavior and close the cross-tenant read leak in shared-table mode. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b6198a6 commit 997093a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Database/Hook/TenantFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function filter(string $table): Condition
3535
// Check the actual collection name against the metadata collection, not the alias
3636
$name = $this->collection !== '' ? $this->collection : $table;
3737

38-
if (! empty($this->metadataCollection) && \str_contains($name, $this->metadataCollection)) {
38+
if (! empty($this->metadataCollection) && $name === $this->metadataCollection) {
3939
return new Condition("({$prefix}_tenant IN (?) OR {$prefix}_tenant IS NULL)", [$this->tenant]);
4040
}
4141

0 commit comments

Comments
 (0)