News for hackers. Stuff that matters.
Re:Protecting your email address via SVG instead of JavaScript by shanehoban on Monday May 13, 2024 @04:35AM (#40341020)
Try to query it though via document.querySelectorAll('a') for example. It's a good first line of defense as a lot of scraping techniques do this approach.

However, if you have a headless browser setup for scraping, and simply fetch the current URL while on the page[0], you can get the plain text, and do a regex search for email addresses which will get you the email address - albeit this is a strange approach to take I admit.

[0]: fetch('./').then((res) => res.text()).then((text) => console.log(text))

Re:Protecting your email address via SVG instead of JavaScript by nolok on Monday May 13, 2024 @05:45AM (#40341364)
> It's a good first line of defense as a lot of scraping techniques do this approach.

Most basic scrappers, the ones that are not for your testing or devtools or automation or ... Actually use basic text, without any interpretation. They grep the source code, they don't run a dom and javascript engine, because it's a major difference in computing needs and speed.

I am not saying there is no evil scrapper doing dom evaluation, there are tons, I am reacting to your "FIRST line of defense", that one is scrambling the raw text, which is why we got there.

What parent is saying, is that this is trying to upgrade the defense that we have generated to stop the threat that evolved, but it forgot why we got there and thus makes itself vulnerable to the original threat.

Re:Protecting your email address via SVG instead of JavaScript by animuchan on Monday May 13, 2024 @06:49AM (#40341712)
Absolutely. The basic tools just fetch sites recursively and use regular expressions. The advanced tools are Chromium-based, so will render SVGs just fine (and then potentially run OCR / AI to extract text even from JPEGs).

This technique protects from a "neither here nor there" subset of programs, I wonder how large is that set in practice.

Re:Protecting your email address via SVG instead of JavaScript by cqqxo4zV46cp on Monday May 13, 2024 @06:36AM (#40341617)
If they’re saying it, I think that they’re wrong. One of those naively written scrapers won’t pick up an email address ‘protected’ in this way. It’s simply continuing the game of cat and mouse.
Re:Protecting your email address via SVG instead of JavaScript by nkozyra on Monday May 13, 2024 @07:50AM (#40342201)
You can just query for all the image elements and then read any svg using the document model.

This is trivial to overcome for most basic scrapers and not much harder even if you try to obfuscate with paths for more sophisticated ones.