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

algorithm - Possible collisions in the standard JavaScript Object hash table implementation? - Stack Overflow

programmeradmin2浏览0评论

I recently happened to think about object property access times in JavaScript and came across this question which seemed to reasonably suggest that it should be constant time. This also made me wonder if there is a limit on object property key lengths. Apparently modern browsers support key lengths of upto 2^30, which seem to be quite good for a hash function. That said,

  • Is anyone aware of the kind of hash functions that is used by JS engines?

  • Is it possible to experimentally create collisions of JavaScript's property accessors?

I recently happened to think about object property access times in JavaScript and came across this question which seemed to reasonably suggest that it should be constant time. This also made me wonder if there is a limit on object property key lengths. Apparently modern browsers support key lengths of upto 2^30, which seem to be quite good for a hash function. That said,

  • Is anyone aware of the kind of hash functions that is used by JS engines?

  • Is it possible to experimentally create collisions of JavaScript's property accessors?

Share Improve this question edited May 26, 2018 at 13:32 Dave 9,0853 gold badges29 silver badges43 bronze badges asked May 26, 2018 at 9:19 ErricErric 7971 gold badge9 silver badges32 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

Is anyone aware of the kind of hash functions that is used by JS engines?

Yes, their developers are certainly aware of the hash functions and the problems they have. In fact, attacks based on hash collisions were demonstrated in 2011 against a variety of languages, among others as a DOS attack againt node.js servers.

The v8 team solved the issue, you can read about the details at https://v8project.blogspot.de/2017/08/about-that-hash-flooding-vulnerability.html.

Is it possible to experimentally create collisions of JavaScript's property accessors?

It appears so: https://github./hastebrot/V8-Hash-Collision-Generator

发布评论

评论列表(0)

  1. 暂无评论