In Part 1, we learned the basic principle of stealing data with CSS and successfully stole the CSRF token as a practical example using HackMD. This article will delve into some details of CSS injection and address the following issues:
- Since HackMD can load new styles without refreshing the page, how can we steal the second character and beyond on other websites?
- If we can only steal one character at a time, will it take a long time? Is this feasible in practice?
- Is it possible to steal things other than attributes? For example, text content on a page or even JavaScript code?
- What are the defense mechanisms against this attack?