Back to skill

Security audit

FreshBooks CLI

Security checks for vulnerabilities and agentic risk

Overview

This FreshBooks skill is purpose-aligned, but it needs review because it globally installs an unpinned third-party CLI that handles FreshBooks credentials and billing data.

Install only if you trust the @haseebuchiha/freshbooks-cli publisher and are comfortable giving that CLI access to FreshBooks credentials, tokens, clients, and invoices. Prefer a pinned, reviewed version or an isolated environment, and confirm every create, update, archive, or share-link action before it runs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:5
Finding
Unverified Third-Party CLI Installed Globally from a Custom Registry<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 5-17 **Vulnerability Type**: Supply-chain exposure through an unverified third-party dependency **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: {"openclaw":{"emoji":"💰","requires":{"bins":["freshbooks"]},"install":[{"id":"npm","kind":"node","package":"@haseebuchiha/freshbooks-cli","bins":["freshbooks"],"label":"Install freshbooks-cli (npm)"}]}} ``` ```markdown ## Install ```bash npm install -g @haseebuchiha/freshbooks-cli ``` Requires `.npmrc` with `@haseebuchiha:registry=https://npm.pkg.github.com` for GitHub Package Registry. ``` ### Technical Analysis The Skill directs users to globally install `@haseebuchiha/freshbooks-cli`, a personally scoped third-party package retrieved from a custom GitHub Packages registry. The package's implementation and a lockfile, exact version constraint, or integrity hash are not included in the audited project. Consequently, the executable code and npm lifecycle scripts installed by this instruction cannot be verified from the reviewed artifact. An unpinned package reference allows the registry-resolved implementation to change after this Skill has been reviewed. If the package publisher account, registry, release process, or package itself is compromised, a malicious release could execute code during npm installation or whenever the `freshbooks` command is invoked. The risk is particularly relevant because the documented CLI receives FreshBooks OAuth client credentials and obtains tokens that are stored under `~/.config/freshbooks-cli/config.json`. It also processes client and invoice information. The audit found no direct evidence that the referenced package is malicious; the vulnerability is the unauditable and mutable supply-chain trust boundary. ### Attack Path 1. An attacker compromises the package publisher, package registry, publishing credentials, or release pipeline, or otherwise causes a malicious package version to be s ...[truncated 1408 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Include the CLI source code in an auditable repository or provide a verifiable link to the exact reviewed source revision. 2. Pin the dependency to a specific immutable version rather than allowing the registry to resolve a mutable latest release. 3. Record and verify the package archive's cryptographic integrity hash before installation. 4. Use a lockfile or equivalent signed dependency manifest where the installation system supports it. 5. Publish packages through a protected release pipeline with multifactor authentication, provenance attestations, signed releases, and restricted publisher permissions. 6. Review the package's npm lifecycle scripts and disable lifecycle scripts with `--ignore-scripts` when they are not required. 7. Avoid global installation where practical. Install the CLI in an isolated, least-privileged environment with restricted filesystem and network access. 8. Ensure OAuth scopes are limited to the minimum operations required by the Skill. 9. Keep FreshBooks secrets out of shell history and process arguments where possible; prefer protected environment injection or secure interactive input. 10. Add dependency monitoring and require security review before updating the pinned package version. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Credential Access

High
Category
Privilege Escalation
Content
npm install -g @haseebuchiha/freshbooks-cli
```

Requires `.npmrc` with `@haseebuchiha:registry=https://npm.pkg.github.com` for GitHub Package Registry.

## Setup (once)
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- `freshbooks auth login --client-id <id> --client-secret <secret> --manual` -- authenticate via OAuth2 OOB flow
- `freshbooks auth logout` -- clear stored tokens and credentials
- `freshbooks auth status` -- show account ID, token expiry, and auth state
- `freshbooks auth refresh` -- manually refresh the access token

## Clients commands
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The description says to use the skill when the user mentions "freshbooks, invoicing, billing, clients, or accounting." While "freshbooks" is specific, terms like "billing," "clients," and especially "accounting" are broad and common across many contexts, which can cause the skill to activate outside the intended FreshBooks-specific workflow. The file does not provide narrowing constraints or negative examples to limit invocation scope.

Static analysis

No suspicious patterns detected.