Back to skill

Security audit

PeerBerry SDK

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent for a PeerBerry SDK helper, but it steers users toward financial-account automation through an external, unreviewed Python package that can handle credentials and real-money purchases.

Install only if you are comfortable using an unofficial SDK with PeerBerry credentials and possible live investment actions. Prefer a pinned, reviewed package version in an isolated environment, keep DRY_RUN enabled until you explicitly approve purchases, never print or commit passwords, TOTP seeds, or tokens, and treat exported XLSX files as sensitive financial records.

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

Error
Location
pyproject.toml:10
Finding

Unpinned and Unverifiable SDK Dependency Handles Financial Credentials and Real-Money Operations

Content
View full analysis
=1.2" ] ``` `docs/getting-started/installation.md:12-23` directs users to install mutable packages from PyPI without an exact version or hash: ```markdown ## Standard Install (PyPI) ```bash pip install peerberry-sdk ``` Use this for normal application usage when you do not need optional two-factor helpers. ## Install With OTP Support ```bash pip install "peerberry-sdk[otp]" ``` ``` `docs/gen_client_reference.py:15-41` expects a local `src` directory but imports `peerberry_sdk` even when that source tree is unavailable: ```python PROJECT_ROOT = Path(__file__).resolve().parents[1] SOURCE_ROOT = PROJECT_ROOT / 'src' OUTPUT_PATH = 'api/client.md' if str(SOURCE_ROOT) not in sys.path: sys.path.insert(0, str(SOURCE_ROOT)) # Allow running this generator even when optional runtime deps are not installed. if 'cloudscraper' not in sys.modules: try: import cloudscraper # noqa: F401 except ModuleNotFoundError: class _NoopSession: headers = {} def request(self, *args, **kwargs): raise RuntimeError('Noop session cannot perform requests.') def get(self, *args, **kwargs): raise RuntimeError('Noop session cannot perform requests.') sys.modules['cloudscraper'] = types.SimpleNamespace( create_scraper=lambda browser: _NoopSession(), ) from peerberry_sdk.client import PeerberryClient from peerberry_sdk.config import AuthConfig, LifecycleConfi ...[truncated 3492 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (23)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 127)May include surrounding context.

Setup and run:

bash
cp tests/.env.example tests/.env
python3 tests/manual_display_actions.py

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A second, more specific description-behavior mismatch indicates the skill may primarily serve documentation generation rather than the advertised authentication, portfolio retrieval, and purchase automation use cases. Hidden or undeclared repo introspection and docs-writing capabilities create a trust boundary violation, especially in an environment where a user expects a constrained financial SDK helper rather than a build/documentation tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A second, more specific description-behavior mismatch indicates the skill may primarily serve documentation generation rather than the advertised authentication, portfolio retrieval, and purchase automation use cases. Hidden or undeclared repo introspection and docs-writing capabilities create a trust boundary violation, especially in an environment where a user expects a constrained financial SDK helper rather than a build/documentation tool.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · SKILL.md (reported line 185)May include surrounding context.

md
## Maintenance Contract

When SDK changes, update this skill in this order:

1. Verify method signatures and accepted values against:
   - `src/peerberry_sdk/client.py`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 192)May include surrounding context.

md
4. Keep this root `SKILL.md` concise and routing-focused.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/api/client.md (reported line 87)May include surrounding context.

md
| `email` | `Optional[str]` | `None` | Account's email |
| `password` | `Optional[str]` | `None` | Account's password |
| `tfa_secret` | `Optional[str]` | `None` | Base32 secret used for two-factor authentication |
| `access_token` | `Optional[str]` | `None` | Access token used to authenticate to the API (Optional; Only pass the JWT for it to work!) (Only mandatory if account has two-factor authentication enabled) |
| `refresh_token` | `Optional[str]` | `None` | Existing refresh token used for token rotation. |
| `request_opts` | `Optional[dict]` | `None` | Optional[dict] - Additional options for :any:`requests.sessions.Session.request()`. |
| `config` | `Optional[SDKConfig]` | `None` | Optional[SDKConfig] - Transport/auth behavior overrides. |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/gen_client_reference.py (reported line 209)May include surrounding context.

python
'AuthConfig': {
        'auto_refresh_on_auth_error': 'Refresh token automatically after auth failures.',
        'max_refresh_attempts': 'Refresh attempts for a failing request.',
        'proactive_refresh': 'Refresh access token before expiry when possible.',
        'proactive_refresh_skew_seconds': 'Seconds before expiry to trigger proactive refresh.',
        'token_store': 'Token store implementation used for load/save/clear.',
        'load_tokens_on_init': 'Load token pair from token store during client initialization.',

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/api/client.md (reported line 40)May include surrounding context.

md
Behavior:

- if access token is present, SDK validates it first
- if token is valid, session starts immediately
- if token is stale and credentials are available, SDK falls back to credential login

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/guides/authentication.md (reported line 25)May include surrounding context.

md
Behavior:

- if access token is present, SDK validates it first
- if token is valid, session starts immediately
- if token is stale and credentials are available, SDK falls back to credential login

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/guides/authentication.md (reported line 64)May include surrounding context.

md
Behavior:

- if access token is present, SDK validates it first
- if token is valid, session starts immediately
- if token is stale and credentials are available, SDK falls back to credential login

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation shows use of account credentials and optional TOTP secrets in examples without any explicit guidance on secure handling, storage, or redaction. Because this SDK automates access to a financial account, users may hardcode secrets, commit them to source control, or mishandle 2FA material, increasing risk of account takeover.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README includes a purchase_loan() example that can execute a real financial transaction but does not prominently warn readers that it places a live investment order. In an automation SDK for a lending platform, copy-paste use of this example could cause unintended purchases and real monetary loss, especially because it is presented alongside read-only examples with similar structure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill describes behaviors that rely on network access and file-writing semantics, but it does not declare any explicit tool scope such as allowed-tools or permissions. Undeclared capabilities make it harder to constrain execution and audit what the skill may do, increasing the risk of unintended outbound requests or filesystem changes if the hosting agent grants broad default privileges.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation describes purchase_loan(...), which triggers a real financial transaction, but it does not include an explicit warning that the call can place actual investment orders with real funds. In an automation-focused SDK, this omission increases the risk of accidental execution by developers, agents, or users who may treat the method like a read-only retrieval call.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example prints the bearer token directly, which can expose sensitive authentication material to terminals, shell history capture, CI logs, notebooks, or centralized log collectors. Anyone who obtains the bearer token may be able to authenticate as the user until expiry, making this a clear credential-handling weakness in documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The guide encourages implementing custom token persistence and discusses loading/saving access and refresh tokens, but it does not warn readers against insecure storage, accidental logging, or exposing tokens in environment variables and source control. In an authentication guide for an investment automation SDK, this omission can lead users to store long-lived credentials in unsafe locations, enabling account takeover if the storage backend is compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The quick reference documents purchase_loan(loan_id: int, amount: Decimal) as a direct investment-execution method but provides no warning that it places a real financial order, no confirmation pattern, and no guidance on safeguards such as dry-run checks, balance validation, or explicit user approval. In the context of an automation SDK for retail investing, this increases the risk that downstream agents or developers invoke a real-money action unintentionally or too eagerly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The export recipe explicitly instructs saving investments and transaction exports to local files without warning that the data may contain sensitive financial history. In an agent context, this can lead to unintended persistence of private account data on disk, increasing exposure through local compromise, backups, logs, or accidental sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The authentication diagnostic recipe encourages creating a login troubleshooting script but does not warn about safe handling of credentials, 2FA challenges, or authentication errors. In practice, such scripts often result in secrets being hardcoded, echoed, or logged during debugging, which can expose account access material.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The token refresh health-check recipe directs the user to force token refresh and validate follow-up access without warning that session tokens are sensitive bearer credentials. This creates a realistic risk that refreshed tokens will be printed, stored insecurely, or mishandled in logs, enabling account takeover if exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The quickstart repeatedly shows inline placeholders for email, password, and a 2FA secret without any accompanying warning about secure secret handling. In practice, developers often copy quickstart patterns into real code, which can lead to hardcoded credentials, accidental commits, insecure logging, or unsafe treatment of MFA secrets in an investment/financial automation context.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: setuptools has 10 known advisory(ies) (CVE-2013-1633 (Setuptools vulnerable to Man-in-the-middle attacks); CVE-2025-47273 (setuptools has a path traversal vulnerability in PackageIndex.download that lead); CVE-2024-6345 (setuptools vulnerable to Command Injection via package URL) +7 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: wheel has 4 known advisory(ies) (CVE-2026-24049 (Wheel Affected by Arbitrary File Permission Modification via Path Traversal in w); CVE-2022-40898 (pypa/wheel vulnerable to Regular Expression denial of service (ReDoS)); CVE-2022-40898 (An issue discovered in Python Packaging Authority (PyPA) Wheel 0.37.1 and earlie) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.