TruffleHog – Now a Browser Extension That Detects Secret Keys In JavaScript

Researchers have presented a dedicated browser extension, “TruffleHog,” that can facilitate bug bounty hunters. The tool helps find secret API keys in JavaScript code.

About TruffleHog Browser Extension

Researchers from Truffle Security have developed the TruffleHog tool as a handy browser extension for security researchers.

Sharing the details via a blog post, Dylan Ayrey, cofounder of the firm, explained that the tool can help organizations prevent security risks due to exposed secret keys.

TruffleHog itself isn’t a new tool and has been around for many years with developers making constant improvements.

TruffleHog is available as an open-source Chrome browser extension.

The tool finds API keys embedded within JavaScript code. Such keys often appear in an apps’ frontend when APIs allow CORS (Cross-Origin Resource Sharing). As stated in the post,

By default websites can’t just make request and read the response to other API’s without the foreign API inviting them to do so with a permissive CORS header.
Amazon AWS API’s as well as many other SaaS and Cloud provider API’s have extremely permissive CORS settings.
This… not only encourages websites to make requests to AWS, but because AWS’s APIs are credentialed, this encourages Javascript to contain AWS credentials.

Despite its usefulness, this feature also threatens internal apps’ security, which may be a threat for businesses.

Because multiple frontend applications often consume the same backend API, many internal apps unfortunately get scopes with permissive CORS settings… a foreign origin from the open internet with the ability to make requests to internal apps and API’s, view the responses, and steal API keys hardcoded client-side in the internal applications.

Real-World Application

Bounty hunters and researchers can use this tool to find such keys and report them to the firms and vendors. This tool may also help security teams within businesses for internal assessments.

Alongside JavaScript, the TruffleHog tool extension can also scan detect .git directories and .env files that can contain credentials.

Researchers have submitted the tool for review on the Chrome Store. Meanwhile, interested users can sideload the tool from GitHub.

Let us know your thoughts in the comments.

Related posts

NachoVPN Attack Risks Corporate VPN Clients

Sweet Security Introduces Evolutionary Leap in Cloud Detection and Response, Releasing First Unified Detection & Response Platform

Anti-Spam WordPress Plugin Vulnerabilities Risked 200K+ Websites

1 comment

Dylan Ayrey September 29, 2021 - 4:32 pm
Thanks for the story Abeerah! -Dylan

Comments are closed.

Add Comment