Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Security issue with xls_builder retaining data even if template render fails to an exception on a computed field #13

Closed
amlisirev opened this issue Feb 28, 2019 · 1 comment
Assignees
Labels

Comments

@amlisirev
Copy link

There seems to be a possibly high impact issue with the way the xls_builder handles rendering the column contents. Steps to reproduce:

  1. Have the following xls template for an ActiveAdmin resource
  xls do
    whitelist
    column :name do |key|
      custom_helper_that_raises_exception(key)
    end
  end
  1. Have the ActiveAdmin resource filtered in to view A and view B so that
  • Items from viewA raise no exception with the custom helper
  • Some item(s) from viewB raises an exception.
  1. First export viewB as xls and have the server throw an error. Now export viewA as xls.

Observed: viewA.xls contains data from viewB
Expected: Every export should be from a clean slate, so viewA.xls should only contain data from viewA.

Haven't had the chance to see if the issue is with my versions, this gem, or the underlying spreadsheet gem. This does pose a security issue with using custom helpers that might throw an uncaught error, thus leaking data between exports.

Versions used:
Ruby 2.3.7p456, Rails 5.0.7.1, ActiveAdmin 1.2.1, ActiveAdmin-xls 2.0.0, Spreadsheet 1.1.7

@thambley thambley self-assigned this Mar 1, 2019
@thambley thambley added the bug label Mar 1, 2019
@thambley
Copy link
Owner

thambley commented Mar 1, 2019

I understand the issue. I believe the problem is in the Builder class.

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants