Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Template tags to weakly obfuscate an email behind JavaScript or a CAPTCHA (a reCAPTCHA)
A simple Django app providing template tags that attempt to obfuscate raw e-mail addresses to make them ever so slightly more difficult to scrape.
To be less-obtrusive, JavaScript is used to translate mangled source into a normal e-mail address. If JavaScript is not present, the reCAPTCHA mailhide service is offered to deobfuscate the addresses.
Using images, LTR-RTL hacks, or forcing reCAPTCHA access might be better at keeping your address safe from bots, but it's annoying for legitimate users. By using JavaScript, hopefully we can thwart some of the dumbest bots into farming someone else's email address without much of a usability hit.
Add 'mailmangler'
to your INSTALLED_APPS
.
Add MAILMANGLE_PUBLIC
and MAILMANGLE_SECRET
,
with keys from the reCAPTCHA Mailhide API:
http://www.google.com/recaptcha/mailhide/apikey, e.g. ::
MAILMANGLE_PUBLIC = 'your-key...==' MAILMANGLE_SECRET = '123789...abcd'
Load the tag library with {% load mailmangler %}
In the <head>
of your template, add {% mailmangle_js %}
Pipe (filter) email addresses through mailmangle
or
mailmangle_linked
, e.g. ::
{{ my_email_var|mailmangle }} {{ "alice@example.com"|mailmangle }} {{ "bob@example.net"|mailmangle_linked }}
will produce:
my_email_var
was.If JS is not present, a reCAPTCHA mailhide link is available in
<noscript>
tags.
FAQs
Template tags to weakly obfuscate an email behind JavaScript or a CAPTCHA (a reCAPTCHA)
We found that django-mailmangler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.