How to avoid HTTP Header Injection (new lines characters)

后端 未结 1 417
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 20:53

I sometimes use user data in php function header like this :

header(\'Location : test\' . $user_data);

I used to remove

相关标签:
1条回答
  • 2021-01-20 21:11

    Quoting the doc:

    (since 4.4.2 and 5.1.2) This function now prevents more than one header to be sent at once as a protection against header injection attacks.

    So I suppose even that CRLF replacement you've already did is not necessary.

    0 讨论(0)
提交回复
热议问题