-
Notifications
You must be signed in to change notification settings - Fork 55
VEN-99 Add brakeman #59
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,6 @@ def validate_promotion_rule_type | |
| end | ||
|
|
||
| def promotion_rule_params | ||
| params[:promotion_rule].permit! | ||
| params[:promotion_rule].permit(:type) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aleksandarpetrushev what about
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @damianlegawiec we have a similar situation such as in payment_methods_controller. promotion_rules_controller is used only for #create and #destroy. When creating a promotion rule, we know the type only. The additional attributes are sent in PromotionsController#update as nested "promotion_rules_attributes", after the promotion rules have been created. Tested for all promotion rules, only the type is sent. |
||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| { | ||
| "ignored_warnings": [ | ||
| { | ||
| "warning_type": "Mass Assignment", | ||
| "warning_code": 70, | ||
| "fingerprint": "2096b83195b858fd16fa7b7139bc84400d108b5f85a8c64ae91da708b5fe21f9", | ||
| "check_name": "MassAssignment", | ||
| "message": "Specify exact keys allowed for mass assignment instead of using `permit!` which allows any keys", | ||
| "file": "app/controllers/spree/admin/resource_controller.rb", | ||
| "line": 268, | ||
| "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/", | ||
| "code": "params.require(resource.object_name).permit!", | ||
| "render_path": null, | ||
| "location": { | ||
| "type": "method", | ||
| "class": "Spree::Admin::ResourceController", | ||
| "method": "permitted_resource_params" | ||
| }, | ||
| "user_input": null, | ||
| "confidence": "Medium", | ||
| "note": "" | ||
| }, | ||
| { | ||
| "warning_type": "Mass Assignment", | ||
| "warning_code": 70, | ||
| "fingerprint": "934f23be465f0d2c5f7278aac4f085771ba22d5e8b56645813a2364313df9561", | ||
| "check_name": "MassAssignment", | ||
| "message": "Specify exact keys allowed for mass assignment instead of using `permit!` which allows any keys", | ||
| "file": "app/helpers/spree/admin/navigation_helper.rb", | ||
| "line": 116, | ||
| "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/", | ||
| "code": "params.permit!", | ||
| "render_path": null, | ||
| "location": { | ||
| "type": "method", | ||
| "class": "Spree::Admin::NavigationHelper", | ||
| "method": "per_page_dropdown_params" | ||
| }, | ||
| "user_input": null, | ||
| "confidence": "Medium", | ||
| "note": "" | ||
| }, | ||
| { | ||
| "warning_type": "Mass Assignment", | ||
| "warning_code": 70, | ||
| "fingerprint": "d45f35a46d0896dcd87099cbae9ce1c77b79ac3c935c0a6317e1a2462186e486", | ||
| "check_name": "MassAssignment", | ||
| "message": "Specify exact keys allowed for mass assignment instead of using `permit!` which allows any keys", | ||
| "file": "app/controllers/spree/admin/prices_controller.rb", | ||
| "line": 7, | ||
| "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/", | ||
| "code": "params.require(:vp).permit!", | ||
| "render_path": null, | ||
| "location": { | ||
| "type": "method", | ||
| "class": "Spree::Admin::PricesController", | ||
| "method": "create" | ||
| }, | ||
| "user_input": null, | ||
| "confidence": "Medium", | ||
| "note": "" | ||
| }, | ||
| { | ||
| "warning_type": "Remote Code Execution", | ||
| "warning_code": 24, | ||
| "fingerprint": "f46c38504b6d7300a6152298cbcd4f65afde1f0b5fd1c642d79908d56ff1aa8c", | ||
| "check_name": "UnsafeReflection", | ||
| "message": "Unsafe reflection method `constantize` called with parameter value", | ||
| "file": "app/controllers/spree/admin/promotion_actions_controller.rb", | ||
| "line": 7, | ||
| "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/", | ||
| "code": "params[:action_type].constantize", | ||
| "render_path": null, | ||
| "location": { | ||
| "type": "method", | ||
| "class": "Spree::Admin::PromotionActionsController", | ||
| "method": "create" | ||
| }, | ||
| "user_input": "params[:action_type]", | ||
| "confidence": "High", | ||
| "note": "" | ||
| }, | ||
| { | ||
| "warning_type": "Mass Assignment", | ||
| "warning_code": 70, | ||
| "fingerprint": "f5df7c2ded2d794ea955c7ac98e0b5868e4787e56bec481b5e794742f7800308", | ||
| "check_name": "MassAssignment", | ||
| "message": "Specify exact keys allowed for mass assignment instead of using `permit!` which allows any keys", | ||
| "file": "app/controllers/spree/admin/payment_methods_controller.rb", | ||
| "line": 91, | ||
| "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/", | ||
| "code": "params.require(ActiveModel::Naming.param_key(@payment_method)).permit!", | ||
| "render_path": null, | ||
| "location": { | ||
| "type": "method", | ||
| "class": "Spree::Admin::PaymentMethodsController", | ||
| "method": "preferences_params" | ||
| }, | ||
| "user_input": null, | ||
| "confidence": "Medium", | ||
| "note": "" | ||
| } | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.