Skip to content

Sanitize CSV header names like ActiveAdmin does #177

Backlog

Description

@jdguzman

From the #174 review.

ActiveAdmin 3's CSVBuilder#build runs the column header names through sanitize (the CSV formula-injection guard) as well as the rows. Our build override in lib/active_admin/mongoid/csv_builder.rb still sanitizes rows (through ActiveAdmin's build_row), but writes the header line without it.

Header names are usually developer-defined, so the risk is low. Using sanitize(encode(c.name, options)) keeps the override identical to upstream. A spec should cover a column name starting with =.

Activity

  1. added this to the 3.0.1 milestone on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions