other
- Location
scripts/register.js:27- Finding
Reusable Telegram Bot Credential Transmitted to a Third-Party Backend
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly matches its portfolio-alert purpose, but it asks for sensitive financial and messaging credentials, stores them plainly, and sends them to a custom backend with weak disclosure and controls.
Install only if you are comfortable sharing portfolio holdings, Telegram chat details, and a reusable Telegram bot token with the FirstKnow backend. Use a dedicated Telegram bot, rotate the bot token if you uninstall or suspect exposure, avoid reusing sensitive API keys, and verify how backend deletion and retention actually work before relying on it for private financial data.
scripts/register.js:27Reusable Telegram Bot Credential Transmitted to a Third-Party Backend
SKILL.md:122Credentials Stored in Plaintext Without Restrictive File Permissions
scripts/lib.js:52Configurable API Base Can Redirect Credential-Bearing Registration Requests
prompts/analyze-impact.md:31Untrusted News Content Is Inserted into Model Prompts Without Injection Defenses
scripts/update-portfolio.js:67Portfolio and Settings Updates Lack Client-Side Authentication Evidence
scripts/handle-deep.js:15Deep-Analysis Workflow Imports Missing and Non-Exported Modules
README.md:179Privacy Documentation Omits Credential Transfer and Advertises an Unimplemented Deletion Operation
scripts/package.json:6Dependency Installation Is Not Reproducible or Integrity-Pinned
The manifest advertises portfolio news monitoring, but the body instructs the agent to collect Telegram credentials, store API keys, persist configuration, and register data with a backend. This mismatch can mislead users into authorizing a much more invasive workflow than the description suggests, undermining informed consent and making data exfiltration risks harder to detect.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
Then get the chat ID:
curl -s "https://api.telegram.org/bot<TOKEN>/getUpdates" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['result'][0]['message']['chat']['id'])" 2>/dev/null || echo "No messages found — send a message to your bot first"
The skill directs users to provide Telegram bot credentials, chat IDs, portfolio holdings, timezone, and potentially API keys, then stores and transmits them without a clear, prominent warning or consent flow. Because these are sensitive identifiers and secrets, the absence of explicit disclosure makes unauthorized or poorly understood data handling much more dangerous in context.
The skill instructs the agent to collect the user's Anthropic API key and store it in a local .env file alongside Telegram credentials. Collecting and persisting a powerful secret unrelated to basic alert delivery creates a significant credential-compromise risk if the host, filesystem, logs, or subsequent tools are exposed.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const FIRSTKNOW_DIR = join(homedir(), '.firstknow');
const DEFAULT_API_BASE = 'https://api.firstknow.ai';
// Load .env from ~/.firstknow/.env
loadDotenv({ path: join(FIRSTKNOW_DIR, '.env') });
function log(msg) {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export const DATA_DIR = join(homedir(), '.firstknow');
export const CONFIG_PATH = join(DATA_DIR, 'config.json');
export const PORTFOLIO_PATH = join(DATA_DIR, 'portfolio.json');
export const ENV_PATH = join(DATA_DIR, '.env');
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export const DATA_DIR = join(homedir(), '.firstknow');
export const CONFIG_PATH = join(DATA_DIR, 'config.json');
export const PORTFOLIO_PATH = join(DATA_DIR, 'portfolio.json');
export const ENV_PATH = join(DATA_DIR, '.env');
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
The skill invokes shell commands, reads and writes local files, and performs network operations, yet declares no explicit tool scope or permissions boundary. This increases the chance that a host will grant broader capabilities than users expect, making sensitive actions like credential storage and external transmission less transparent and harder to audit.
The manifest description says to use the skill when the user 'wants to set up stock monitoring, check portfolio news, or invokes /firstknow.' The first two conditions are broad natural-language intents rather than narrowly scoped trigger phrases, which increases the chance of unintended invocation during ordinary financial discussion.
The skill executes a host-platform detection shell command before normal operation, even though that is not necessary to provide portfolio news in a user-facing sense. Unnecessary environment probing expands the skill's behavioral scope and can be repurposed to fingerprint the runtime, enabling tailored misuse or bypasses in different environments.
The skill instructs the agent to call the Telegram API with a bot token embedded in the URL to retrieve chat metadata. External transmission to a third-party service is expected for Telegram setup, but doing so with user-provided secrets and no constrained network policy or clear handling guarantees creates a real risk of secret leakage through logs, history, or accidental disclosure.
Then get the chat ID:
curl -s "https://api.telegram.org/bot<TOKEN>/getUpdates" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['result'][0]['message']['chat']['id'])" 2>/dev/null || echo "No messages found — send a message to your bot first"
The skill persists user configuration, portfolio data, and later secrets under ~/.firstknow, creating durable local state beyond the session. Persistent storage of financial preferences and messaging credentials increases the blast radius of any later compromise of the agent environment or shared machine.
Save config locally:
mkdir -p ~/.firstknow
Write ~/.firstknow/config.json:
The manifest focuses on monitoring breaking news, filings, price moves, analyst actions, and providing deep analysis. This section goes further by requiring specific action items such as conditional buy recommendations and probabilistic best/base/worst-case portfolio prescriptions, which materially expands the skill from monitoring/intelligence into investment-advice-style guidance.
The sample alert includes highly personalized portfolio details such as specific holdings, allocation percentages, and price guidance, but it does not warn users about the sensitivity of this financial information or advise safe handling in messaging channels. In a skill designed to push alerts to Telegram 24/7, omission of privacy and data-handling guidance increases the risk of inadvertent exposure of sensitive investment data through screenshots, shared devices, compromised chats, or misconfigured bots.
The prompt explicitly provides the user's full portfolio to the model, which is sensitive financial data and may exceed what is necessary to analyze a single news event. Even if intended for personalization, exposing complete holdings increases privacy and data-minimization risk if the model output, logs, downstream integrations, or prompt history are accessible or retained.
The prompt states that content must be translated 'between English and Chinese' and further requires 'standard Chinese financial terminology,' which hard-codes a language/locale constraint. There is no user opt-in mechanism or documented justification that this skill is intentionally limited to that locale, so it conflicts with the policy against forcing a specific language without opt-in.
The code sends portfolio-derived ticker symbols to a remote backend API when requesting the latest event. Even though ticker lists are not credentials, they are user portfolio data and can reveal investment interests or holdings patterns; this file performs that transmission without any visible consent, notice, or minimization control. In a financial-monitoring skill, that data is particularly sensitive because it can expose personal investment behavior.
The script delivers generated deep-analysis content to Telegram, a third-party messaging platform, without any user-facing warning in this file. That content is derived from the user's event context and portfolio, so sending it externally can disclose sensitive financial interests or analysis to another service, especially if chat IDs or Telegram accounts are shared or compromised.
This manifest/config file sets the language to "en" as a default with no indication of user choice, opt-in, or documented regional justification. The policy specifically calls out language or locale constraints as violations when they are imposed without user opt-in.
The saveConfig and savePortfolio functions write data to files under the user's home directory, but this file provides no confirmation prompt, user-facing log message, or explanatory comment/docstring disclosing that persistent local files are created or modified. For a shared utility module, these silent writes could affect user data without visible notice from this code.
The apiCall function sends HTTP requests to a remote backend, potentially transmitting user or system data in the request body, but the file contains no user-facing warning, confirmation, or explanatory comment describing this behavior. Because this is a generic utility function, the data transmission is not self-disclosed here.
The dependency uses a caret range instead of an exact pinned version, so installs can drift to newer releases without explicit review. In a security-sensitive skill that handles portfolio intelligence and likely external APIs, this increases supply-chain risk and makes it harder to verify whether vulnerable or breaking versions are being deployed.
"type": "module",
"description": "FirstKnow skill scripts — onboarding, deep analysis, portfolio sync",
"dependencies": {
"@anthropic-ai/sdk": "^0.39.0",
"dotenv": "^16.4.7"
}
}
The manifest references @anthropic-ai/sdk without an exact version, and advisories exist for some releases of that package. Because the installed version cannot be verified from this manifest alone, there is a real risk that deployments may resolve to an affected version, which is more concerning here because the skill appears to perform AI-driven analysis and may process files, prompts, or local data.
The dotenv package is also specified with a floating caret range, which allows unreviewed patch/minor updates at install time. Even though dotenv is common and lower risk than more privileged libraries, leaving it unpinned still weakens build reproducibility and increases exposure to supply-chain compromise.
"description": "FirstKnow skill scripts — onboarding, deep analysis, portfolio sync",
"dependencies": {
"@anthropic-ai/sdk": "^0.39.0",
"dotenv": "^16.4.7"
}
}
No suspicious patterns detected.