I have a form where the user inputs data.

On the back end, I'm taking some of that data and embedding it into a PDF using ActiveReports. I then display it back to the user and save a copy on our server.

I am using C# and ASP.NET

I feel like I should be scrubbing this input somehow, but I'm not sure what to look for in terms of what is malicious to a PDF file or how to effectively sanitize the data; I don't think I can encode it like I do for HTML.

How can I best sanitize this data to prepare it for the PDF file?

  • 3
    I would say it depends on how you call your PDF library: you certainly do not build actual PDF content by yourself (if so, don't) but you rather call a library for that. And it's the library's job to escape things properly. So the only flaw would be a miss calling of that library. – Xenos Jul 26 '18 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.