fix: the algolia api key is stored in encrypted form... in doc-search.js - #8
Open
anupamme wants to merge 1 commit into
Conversation
The Algolia API key is stored in encrypted form directly in source code with decryption keys also embedded, making it effectively plaintext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Address critical severity security finding in
src/commands/mcp/tools/doc-search.js.Vulnerability
V-001src/commands/mcp/tools/doc-search.js:44Description: The Algolia API key is stored in encrypted form directly in source code with decryption keys also embedded, making it effectively plaintext. An attacker with source code access can extract and decrypt the API key to gain unauthorized access to external services.
Evidence
Exploitation scenario: Attacker gains read access to source code repository, extracts encrypted API key and decryption constants, runs decryption logic locally to obtain plaintext API key, then makes unauthorized requests.
Scanner confirmation: multi_agent_ai rule
V-001flagged this pattern.Threat Model Context
This is a Node.js library - vulnerabilities affect downstream consumers who use this package.
Changes
src/commands/mcp/tools/doc-search.jsBehavior Preservation
The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.
This change addresses a pattern flagged by static analysis. The code path handles user-influenced input and the fix reduces the attack surface against both manual and automated exploitation.
Automated security fix by OrbisAI Security