Skip to content

[AI] OSAC-4127: List DAO tenancy filter bypassed by top-level OR in user filter (cross-tenant resolution by name) - #368

Merged
omer-vishlitzky merged 2 commits into
osac-project:mainfrom
slintes:osac-jira-ai-issue-solver/OSAC-4127
Aug 19, 2026
Merged

[AI] OSAC-4127: List DAO tenancy filter bypassed by top-level OR in user filter (cross-tenant resolution by name)#368
omer-vishlitzky merged 2 commits into
osac-project:mainfrom
slintes:osac-jira-ai-issue-solver/OSAC-4127

Conversation

@osac-jira-ai-issue-solver

@osac-jira-ai-issue-solver osac-jira-ai-issue-solver Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Resolves OSAC-4127

Summary

  • Fix SQL operator precedence bug in the generic List DAO that allowed tenant isolation to be bypassed when a user-supplied CEL filter contained a top-level OR (e.g., this.id == k || this.metadata.name == k)
  • The user filter is now wrapped in parentheses before being appended to the tenancy clause, ensuring the tenant restriction applies to the entire filter expression
  • Add DAO-level regression test that verifies cross-tenant rows are not leaked through top-level OR filters

Test plan

  • go build ./internal/database/dao/... compiles successfully
  • go vet ./internal/database/dao/... passes
  • golangci-lint run ./internal/database/dao/... reports 0 issues
  • gofmt -s produces no changes
  • ginkgo run -r internal — requires PostgreSQL container (CI will run this)
  • Verify the new test case "Does not leak cross-tenant rows when filter has a top-level OR" passes in CI

Fixes: OSAC-4127

@osac-jira-ai-issue-solver

osac-jira-ai-issue-solver Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

AI Session Costs

Session Cost
New ticket $2.09
Feedback (1) (no changes) $0.54
Feedback (1) retry 1 (no changes) $0.46
Feedback (1) retry 2 (no changes) $0.29
Feedback (1) retry 3 $0.54
Feedback (2) (no changes) $0.31
Feedback (2) retry 1 (no changes) $0.34
Feedback (2) retry 2 (no changes) $0.41
Feedback (2) retry 3 (unable) $0.56
Feedback (3) (no changes) $0.85
Feedback (3) retry 1 (no changes) $0.64
Feedback (3) retry 2 (no changes) $0.59
Feedback (3) retry 3 (unable) $0.63
Total $8.25

@openshift-ci-robot

openshift-ci-robot commented Aug 18, 2026

Copy link
Copy Markdown

@osac-jira-ai-issue-solver[bot]: This pull request references OSAC-4127 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Resolves OSAC-4127

Summary

  • Fix SQL operator precedence bug in the generic List DAO that allowed tenant isolation to be bypassed when a user-supplied CEL filter contained a top-level OR (e.g., this.id == k || this.metadata.name == k)
  • The user filter is now wrapped in parentheses before being appended to the tenancy clause, ensuring the tenant restriction applies to the entire filter expression
  • Add DAO-level regression test that verifies cross-tenant rows are not leaked through top-level OR filters

Test plan

  • go build ./internal/database/dao/... compiles successfully
  • go vet ./internal/database/dao/... passes
  • golangci-lint run ./internal/database/dao/... reports 0 issues
  • gofmt -s produces no changes
  • ginkgo run -r internal — requires PostgreSQL container (CI will run this)
  • Verify the new test case "Does not leak cross-tenant rows when filter has a top-level OR" passes in CI

Fixes: OSAC-4127

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:42 PM UTC · Completed 4:55 PM UTC

Commit: eecbc32 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

Looks good to me

Previous run

Looks good to me

Previous run (2)

Review

Findings

Low

  • [naming-convention] fulfillment-service/internal/database/dao/generic_dao_tenant_visibility_test.go:353 — Test description "Does not leak cross-tenant rows when filter has a top-level OR" uses a negation form not seen in other test descriptions in this file. Other tests use positive third-person verb patterns: "Filters field based on...", "Shows all tenants when...", "Allows a tenant to...", "Rejects update of...". Consider rephrasing to follow the established pattern, e.g., "Isolates tenant rows when filter has a top-level OR".

Labels: PR fixes a tenant isolation bypass (security bug) in the fulfillment-service DAO layer

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge security This is a security issue bug Something isn't working labels Aug 18, 2026
@osac-jira-ai-issue-solver

Copy link
Copy Markdown
Contributor Author

In comment, @fullsend-ai-review[bot] said:

🤖 Finished Review · ✅ Success · Started 4:42 PM UTC · Completed 4:55 PM UTC

Commit: eecbc32 · View workflow run →

Automated bot status notification — no action needed.

Addressed in 63e1906.

@osac-jira-ai-issue-solver

Copy link
Copy Markdown
Contributor Author

In comment, @fullsend-ai-review[bot] said:

Review

Findings

Low

  • [naming-convention] fulfillment-service/internal/database/dao/generic_dao_tenant_visibility_test.go:353 — Test description "Does not leak cross-tenant rows when filter has a top-level OR" uses a negation form not seen in other test descriptions in this file. Other tests use positive third-person verb patterns: "Filters field based on...", "Shows all tenants when...", "Allows a tenant to...", "Rejects update of...". Consider rephrasing to follow the established pattern, e.g., "Isolates tenant rows when filter has a top-level OR".

Labels: PR fixes a tenant isolation bypass (security bug) in the fulfillment-service DAO layer

Review summary comment — findings addressed via the line-level comment above.

Addressed in 63e1906.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 5:02 PM UTC · Completed 5:15 PM UTC

Commit: 63e1906 · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

@osac-jira-ai-issue-solver

Copy link
Copy Markdown
Contributor Author

In comment, @fullsend-ai-review[bot] said:

🤖 Finished Review · ✅ Success · Started 5:02 PM UTC · Completed 5:15 PM UTC

Commit: 63e1906 · View workflow run →

I was unable to produce code changes to address this comment after multiple attempts.

@slintes

slintes commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@osac-jira-ai-issue-solver monitor this PR and rebase on main when it's merged, that will fix CI failures: #367

@osac-jira-ai-issue-solver

Copy link
Copy Markdown
Contributor Author

In comment, @slintes said:

@osac-jira-ai-issue-solver monitor this PR and rebase on main when it's merged, that will fix CI failures: #367

I was unable to produce code changes to address this comment after multiple attempts.

@slintes

slintes commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@osac-jira-ai-issue-solver rebase on main

@openshift-ci openshift-ci Bot added the lgtm label Aug 18, 2026
@slintes
slintes enabled auto-merge August 18, 2026 18:11
@slintes

slintes commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

/fs-fix rebase on main to fix unit tests

osac-jira-ai-issue-solver Bot and others added 2 commits August 18, 2026 20:39
…ilter (cross-tenant resolution by name)

Co-authored-by: Marc Sluiter <msluiter@redhat.com>
Co-authored-by: Marc Sluiter <msluiter@redhat.com>
@slintes

slintes commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

rebased myself 🤷🏼‍♂️

@openshift-ci openshift-ci Bot added the lgtm label Aug 18, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:42 PM UTC · Completed 6:56 PM UTC

Commit: baf1061 · View workflow run →

@omer-vishlitzky

Copy link
Copy Markdown
Contributor

/lgtm

@omer-vishlitzky

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omer-vishlitzky, osac-jira-ai-issue-solver[bot], slintes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@slintes
slintes added this pull request to the merge queue Aug 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 19, 2026
@omer-vishlitzky
omer-vishlitzky added this pull request to the merge queue Aug 19, 2026
Merged via the queue into osac-project:main with commit 46e8a83 Aug 19, 2026
113 of 118 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-pr approved bug Something isn't working jira/valid-reference lgtm ready-for-merge All reviewers approved — ready to merge security This is a security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants