-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CVE-2016-7047: API leaks any MiqReportResult #1627
Conversation
@miq-bot add_label bug, euwe/backported |
Checked commits https://github.com/isimluk/manageiq-ui-classic/compare/35b1c51fb4c6555c81fdb1e3dd9b5ad6bf680641~...461b8e3e0f51649489b4e61d5e3766888d1c8540 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/controllers/application_controller.rb
app/controllers/chargeback_controller.rb
app/controllers/dashboard_controller.rb
app/controllers/report_controller.rb
app/controllers/report_controller/reports.rb
app/controllers/report_controller/reports/editor.rb
app/controllers/report_controller/saved_reports.rb
|
@h-kataria, @himdel, @mzazrivec : the travis failures seem to be caused by the missing backend. Can you, please, make sure that once the backend is merged we merge this asap? Thx! |
Backend merged, rekicking travis. |
CVE-2016-7047: API leaks any MiqReportResult (cherry picked from commit 844398f) https://bugzilla.redhat.com/show_bug.cgi?id=1450493
Fine backport details:
|
@isimluk Turns out this is wrong :(.. Looks like But turns out some report results have (Looks like This causes errors like you can see a dashboard with a chart on the dashboard, but can't fullscreen it or download the PDF. |
I am sorry, I have missed occurrences when miq_group is null. We need to investigate which code generates content and don't assign proper ownership. (as I suggested in https://bugzilla.redhat.com/show_bug.cgi?id=1471014#c3) We cannot revert or blame security fix, we need to make sure that content is always generated with ownership. I just found there is CVE regression already in this regard in #1827 |
OK, so.. I have 120 records with In all the other cases, Can you give me some info on how Also it seems it was never used in manageiq before - that leads me to think that this is entirely the wrong security mechanism. Or rather, that you introduced a standard security mechanism... which we don't use and support :). Theoretically we could change that --- a/app/models/miq_report_result.rb
+++ b/app/models/miq_report_result.rb
@@ -32,6 +32,9 @@ class MiqReportResult < ApplicationRecord
if user_info.length == 1
user = User.find_by_userid(user_info.first)
self.miq_group_id ||= user.current_group_id unless user.nil?
+ else
+ group = MiqGroup.find(:description => user_info[1])
+ self.miq_group_id ||= group.id unless group.nil?
end
end .. but I'm still confused how |
Previously, there was not access model for MiqReports and MiqReportResults. At all, there was no designed access model. The only thing we had was a RerportsTree that used to call something on ApplicationController and create tree for given user. This mechanism used IIRC, I have found some of the reports that had miq_group_id set to null and fixed them, however there are perhaps more and I am sorry.
This statistic may not necessarily be useful, as the old code used to generate reports without miq_group_id. Some of them may get miq_group_id set if regenerated with the new code. What would be more useful is to find which exact use-cases get miq_group_id=NULL set today. |
Aah, found it, thanks :)
Ok, so.. what should be the right behaviour? When I generate a report, should it really be generated as visible to my current group? It seems to me that if we can have different users in the same group see different VMs, we probably don't want them to be able to see these reports either - so a group-based filtering may be insufficient. (Especially if the group is
Uh, I'm having trouble finding use-cases where it is set to non-NULL :). It seems like there's only 2 ways of creating a MiqReportResult with
It seems
So.. never :). EDIT: ah, but some of those provide the single-value |
(*) with |
Also a few places which create a
(=> probably OK because of that
... so, probably only |
A flaw was found in the CloudForms API. A user with permissions to use the MiqReportResults capability within the API could potentially view data from other tenants or groups to which they should not have access.
Further, the attacker was able to schedule MiqReport run, thus they are in control (to extent) of what leaks.
https://access.redhat.com/security/cve/CVE-2016-7047
Depends on ManageIQ/manageiq#15472