-1

I am using Acunetix to scan my PHP application for security issues. After all scans, I get a medium alert related to CRLF vulnerability. But I don't know how can I fix this issue.
I created a function to remove all possible codes for injections but it does not solve the problem.

function remove_crlf($input) {
    $output = str_replace(array('\r','\n','\r\n','\n\r','%0d','%0a'),null,$input);
    return $output;
}

Do you have any solution?

Mohammad Saberi
  • 12,864
  • 27
  • 75
  • 127

1 Answers1

0

using regex:

$output = preg_replace("/[^\\S ]/", '', $input);

readed in: https://stackoverflow.com/a/21620363/454827

Community
  • 1
  • 1
ZiTAL
  • 3,466
  • 8
  • 35
  • 50