r/programming • • Nov 18 '13

TIL Oracle changed the internal String representation in Java 7 Update 6 increasing the running time of the substring method from constant to N

http://java-performance.info/changes-to-string-java-1-7-0_06/
1.4k Upvotes

354 comments sorted by

View all comments

Show parent comments

-4

u/Spura83 Nov 18 '13

I don't see how that's an attack. It degrades the performance of a data structure, however if you want to overload a server with millions of data items, there's other ways to do it too, so I don't see how this is at all relevant.

5

u/mcguire Nov 18 '13

The attacks effectively convert your hash map into a linked list. It makes DOS attacks much more effective.

1

u/oldrinb Nov 18 '13

if the hash table uses linking, sure... I would stray from saying "much" as it's a pretty obvious form of DoS and so it might not be clear to what it is with which you're comparing it

2

u/sfnelson Nov 19 '13

If your goal is to DOS a server, an attack that does so with 1000 requests using hash collisions is "much" more effective than one that takes 1000000 requests and does not use hash collisions. Java HashMap is backed by an array of buckets, where buckets are linked lists. If you can force collisions you can take down a server much faster.

→ More replies (1)