Back to skill

Security audit

Rcm Pulse

Security checks for vulnerabilities and agentic risk

Overview

The skill's news-and-learning purpose is mostly coherent, but it includes an exposed Moltbook API token and automatic external posting behavior that should be reviewed before installation.

Review before installing. Remove the hardcoded Moltbook token and rotate it, require explicit confirmation or a dry run before any external post or Discord/Telegram message, guard helper scripts with a main entry point, and avoid putting real PHI/PII or client data into the learning log, case studies, or archives.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
test_api.py:4
Finding

Hardcoded Moltbook API Bearer Token

Content
View full analysis

Vulnerability Details

File Location: test_api.py, lines 4–12
Vulnerability Type: Hardcoded API credential
Risk Level: High

Vulnerable Code

python
API = "https://www.moltbook.com/api/v1"
TOKEN = "moltbook_sk_h_WdHz8lcsCi_-tUAgZtMZEAVcg22chm"

def auth():
    return {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}

def get(path):
    req = urllib.request.Request(f"{API}{path}", headers=auth())
    with urllib.request.urlopen(req, timeout=15) as r:
        return json.loads(r.read().decode())

Technical Analysis

A Moltbook bearer token is embedded directly in source code and transmitted in the Authorization header. Anyone who can read the project package, repository history, build artifact, backup, or log containing this file can recover the credential without needing system-level access.

Bearer tokens generally confer access based solely on possession. Although the exact server-side permissions were not established during this static audit, the token is demonstrably intended to authenticate requests to the Moltbook API. Storing it in a test script violates secret-management and least-privilege principles.

The credential should be considered compromised even if the file is subsequently deleted, because it may remain in previously distributed artifacts or version-control history.

Attack Path

  1. An attacker obtains a copy of the project or reads test_api.py.
  2. The attacker extracts the token from line 5.
  3. The attacker sends requests to https://www.moltbook.com/api/v1 with:
    http
    Authorization: Bearer [extracted token]
    
  4. Moltbook processes requests under the identity and permissions associated with the token.
  5. The attacker reads or modifies any resources permitted by that token until it is revoked.

Impact Assessment

Successful exploitation permits impersonation of the token owner within the token’s server-side scope. Confirmed code usage includes authenticated access t ...[truncated 334 chars]

Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the exposed token immediately.
  2. Review Moltbook account activity for unauthorized API calls made with the compromised credential.
  3. Remove the token from the current source and all version-control history, releases, archives, and build artifacts.
  4. Load the replacement credential from a secret manager or protected environment variable:
    python
    import os
    
    TOKEN = os.environ.get("MOLTBOOK_API_KEY")
    if not TOKEN:
        raise RuntimeError("MOLTBOOK_API_KEY is not configured")
    
  5. Use a separate, minimally scoped, read-only credential for API tests.
  6. Prevent secrets from entering source by enabling secret scanning in pre-commit and CI workflows.
  7. Avoid printing authorization headers or complete API responses if they may contain sensitive account information.
  8. Where supported, configure short token lifetimes, IP restrictions, operation-level scopes, and regular automated rotation.

T09 · Insecure Skill Coding Practices

Warning
Location
post_moltbook.py:10
Finding

Unconditional External Publication During Module Import

Content
View full analysis

Vulnerability Details

File Location: post_moltbook.py, lines 10–13 and 25–30
Vulnerability Type: Unsafe import-time network side effect
Risk Level: Medium

Vulnerable Code

python
def post_content(path, data):
    req = urllib.request.Request(f"{API}{path}", data=json.dumps(data).encode(), headers=auth(), method="POST")
    with urllib.request.urlopen(req, timeout=15) as r:
        return json.loads(r.read().decode())

result = post_content("/posts", {
    "title": "The RCM Chain",
    "content": content,
    "submolt_name": "healthcare"
})
print(json.dumps(result, indent=2))

Technical Analysis

The external publication operation is executed at module scope. Consequently, both direct execution and ordinary Python import trigger an authenticated POST to Moltbook whenever a usable MOLTBOOK_API_KEY is present.

External posting is part of the Skill’s declared functionality, so the network operation itself is not unauthorized. The vulnerability is the lack of an explicit execution boundary: importing the module for testing, inspection, reuse, documentation generation, or automated module discovery can publish content unexpectedly.

The script also does not require confirmation, support a dry-run mode, or implement an idempotency mechanism. Repeated imports in separate processes or repeated executions can therefore create duplicate posts.

Attack Path

  1. A runtime environment is configured with a valid MOLTBOOK_API_KEY.
  2. A test runner, plugin loader, developer utility, or another Python module imports post_moltbook.
  3. Python evaluates the module-level statements.
  4. post_content("/posts", ...) sends an authenticated POST automatically.
  5. The predefined content is published without an explicit publication call by the importing component.
  6. Repeated executions or imports in separate processes can produce repeated unintended posts.

Impact Assessment

Exploitation or accidental triggering can publish content under ...[truncated 349 chars]

Remediation
View remediation

Remediation Suggestions

  1. Place publication logic in a main() function protected by an execution guard:
    python
    def main():
        if not TOKEN:
            raise RuntimeError("MOLTBOOK_API_KEY is not configured")
    
        result = post_content("/posts", {
            "title": "The RCM Chain",
            "content": content,
            "submolt_name": "healthcare",
        })
        print(json.dumps(result, indent=2))
    
    if __name__ == "__main__":
        main()
    
  2. Keep module imports free of external side effects.
  3. Add a --dry-run option that displays the proposed payload without sending it.
  4. Require an explicit command or workflow stage for external publication.
  5. Add idempotency protection, such as a stable request key or a check for an existing post.
  6. Separate payload generation from network transport so tests can validate content without contacting Moltbook.
  7. Use mocked HTTP clients in tests and restrict the production token to approved execution environments.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `SKILL.md` — this file

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `SKILL.md` — this file

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document includes realistic healthcare case studies with patient initials, ages, account numbers, service dates, diagnoses, and billing details, but provides no warning or handling guidance for sensitive health and financial data. Even if intended as training material and likely anonymized, this normalizes inclusion of PHI-like data in a broadly reusable skill artifact and increases the risk of accidental disclosure, misuse, or replication with real identifiers.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
89% confidence
Finding

The document discloses an internal absolute workspace path to another installed skill, which leaks environment structure and confirms the presence of a specific capability. Even without direct execution, this kind of enumeration can help an attacker map the agent environment, target follow-on prompt injection, or infer available sensitive functionality such as HIPAA-related processing.

Content

Scanner excerpt · CRCR_STUDY_RESOURCES.md (reported line 61)May include surrounding context.

md
**1.5 HIPAA Compliance**
- HHS.gov: HIPAA Privacy and Security rules — official, free ✅
- `/workspace/skills/afrexai-hipaa-compliance/SKILL.md` — installed ✅
- HFMA Key Concepts Guide Unit 1.5 ✅

**1.6 Medicare Compliance**

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
89% confidence
Finding

This line similarly reveals a concrete internal path to another installed skill, allowing capability enumeration and disclosure of the agent's directory structure. In context, it identifies a medical billing skill with denial templates, which could aid an attacker in crafting more effective probing or targeted instructions against adjacent components.

Content

Scanner excerpt · CRCR_STUDY_RESOURCES.md (reported line 226)May include surrounding context.

md
- HFMA Key Concepts Guide Unit 4.3 ✅ — CRITICAL
- AAPC.com: Denial management codes (CARCs, RARCs) — free reference ✅
- HFMA.org: Denial management articles (free) ✅
- `/workspace/skills/afrexai-medical-billing/SKILL.md` — denial templates ✅
- RAC audit process: CMS.gov RAC pages ✅

**4.4 Non-Paid / AR Follow-Up**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document states that JB's answers will be logged to a persistent file on an ongoing basis, but it does not clearly warn the user that their responses will be stored or explain retention and review implications. In a learning workflow, this can capture personal reflections, work details, or regulated operational information without meaningful notice or consent, creating privacy and integrity risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The weekly review section says the system will update KNOWLEDGE_BASE and LEARNING_LOG with user-generated content, but it does not describe the effect on existing files, possible overwrites, or the persistence of those updates. Because this skill is intended to continuously modify files over time, undisclosed writes can silently alter records and accumulate sensitive business or personal information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs the agent to post to external channels (Telegram, Discord, Moltbook) and write files to the workspace, but it provides no user-facing consent, approval gate, or clear warning about these side effects. In an automated cron-triggered skill, that creates a real risk of unintended data disclosure, spam, or unauthorized persistent changes because the agent may act without a human confirming the content or destination.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code sends data to an external service using an authenticated POST request, but there is no confirmation prompt, warning comment, or user-facing notice that content will be transmitted off-system. For code files, outbound network transmission is safety-relevant when it lacks any disclosure unless the warning is provided elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code makes an authenticated outbound API request using a hardcoded bearer token, but provides no disclosure, consent, or guardrails around that network action. More importantly, the embedded secret can be abused by anyone with access to the file to query the external service as the token owner, turning this from a mere transparency issue into credential exposure and unauthorized third-party API access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file includes a Chinese phrase embedded in an otherwise English study guide: "HFMA membership本身就是 career credibility." That introduces a language/locale inconsistency without explaining that multilingual content is intentional or offering a language preference, which can violate the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The heading "Denial Categories (by原因)" includes a forced switch to Chinese characters in an otherwise English document. This can violate language/locale consistency expectations because the file does not offer a language choice or explain the locale-specific usage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script reads a sensitive credential from the MOLTBOOK_API_KEY environment variable, but there is no comment, docstring, or user-facing notice explaining that the skill depends on and accesses this secret. The rule calls for flagging sensitive environment variable access when no disclosure is present.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.