Skip to content

hardening: prevent CSV formula injection and malformed CSV output in exports #256

Description

@somethingwithproof

Summary

CSV export writes attacker-controlled fields directly into quoted CSV without CSV-safe escaping or formula neutralization.

Evidence

functions.php export blocks around:

  • 800-807
  • 827-836

Values are concatenated directly, including host/message/log text.

Risk

  • Spreadsheet formula execution when cells begin with =, +, -, @
  • Broken CSV format for embedded quotes/newlines

Expected fix

  • Use fputcsv() (or equivalent robust escaping)
  • Prefix dangerous leading formula characters with '
  • Preserve existing export columns/format semantics

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions