How does the billion laughs XML DoS attack work?

后端 未结 3 1938
忘掉有多难
忘掉有多难 2020-12-02 09:03

 
 
 

        
3条回答
  •  春和景丽
    2020-12-02 09:34

    defines an entity, &ha; that expands to "Ha !". The next line defines another entity, &ha2; that expands to "&ha; &ha;" and eventually, "Ha ! Ha !".

    &ha3; turns into Ha ! Ha ! Ha ! Ha !, and so on, doubling the number each time. If you follow the pattern, &haN; is "Ha !", 2N-1 times, so &ha128, expands to 2127 "Ha !"s, which is too big for any computer to handle.

提交回复
热议问题