you are viewing a single comment's thread
view the rest of the comments
[–] 6 points 11 months ago* (last edited 11 months ago) (3 children)

Spot on.

As for the sanitisation, it can take many forms. Either characters that don't usually appear in the context for that field (in terms of names, you can usually scrub most parentheses, more than one hyphen in a row etc) can be removed; copy it to a known encoded field such as unicode to get rid of characters with unusual properties; and making sure bounds are enforced to avoid overflows.

It should mean that your data is exactly that - raw data, and not commands or operands for the interpreter to act upon.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 9 points 11 months ago (2 children)

    Parameterisation entirely solves the problem without needing to sanitise the string

  • source
  • parent
  • hideshow 2 child comments