harden: found an unscoped `find( in compliance_hosts_controller.rb... - #619
Open
anupamme wants to merge 2 commits into
Open
Conversation
adamruzicka
reviewed
Aug 13, 2026
adamruzicka
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the patch.
Instead of changing what we do in show, could we instead include the FindCommon concern and delegate the lookup to a find_resource before_action?
Author
|
Review comments addressed. Pls review. |
Contributor
|
Looks reasonable, let's see what CI thinks. On a more general note, this project uses redmine (https://projects.theforeman.org/projects/foreman_openscap) for issue tracking and commit messages have to be shaped like |
anupamme
force-pushed
the
fix-repo-foreman-openscap-unscoped-find-compliance-hosts-controller
branch
from
August 17, 2026 14:30
167ed61 to
b2b8ed3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden input handling in
app/controllers/compliance_hosts_controller.rb(flagged by semgrep).Vulnerability
ruby.rails.security.brakeman.check-unscoped-find.check-unscoped-findapp/controllers/compliance_hosts_controller.rb:3Description: Found an unscoped
find(...)with user-controllable input. If the ActiveRecord model being searched against is sensitive, this may lead to Insecure Direct Object Reference (IDOR) behavior and allow users to read arbitrary records. Scope the find to the current user, e.g.current_user.accounts.find(params[:id]).Threat Model Context
This controller appears to be publicly accessible. This is a Node.js library - vulnerabilities affect downstream consumers who use this package.
Changes
app/controllers/compliance_hosts_controller.rbBehavior Preservation
The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.
This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.
Automated security fix by OrbisAI Security