最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is HTTP Parameter Pollution attack in NodeJSExpressJs - Stack Overflow

programmeradmin3浏览0评论

I read about it here

It says : "Express populates http request parameters with same name in an array. Attacker can pollute request parameters to exploit this mechanism"

I don't understand what mechanism the Attacker can use ?

I read about it here https://www.npmjs./package/hpp

It says : "Express populates http request parameters with same name in an array. Attacker can pollute request parameters to exploit this mechanism"

I don't understand what mechanism the Attacker can use ?

Share Improve this question asked Jun 5, 2015 at 17:31 user310291user310291 38.2k86 gold badges292 silver badges518 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 18

What they say is that the mechanism of transforming a simple value parameter into an array parameter can be exploited.

If you expect name to be a string:

?name=hello

They can transform it into an array like this:

?name=hello1&name=hello2

You will not get a string but an array:

[ "hello1", "hello2" ]

This mechanism is implicit and thus can be forced by the user even when you do NOT want an array but a string.

This is all they say. From there, several consequences may ensue based on what your code actually does. To protect against it, you should probably check that strings are strings and arrays are arrays. Here es the ever-lasting adage of security:

Never trust the user, never trust input.

Repeat 10 times a day.

发布评论

评论列表(0)

  1. 暂无评论