Back to skill

Security audit

osm-p2p-hybrid

Security checks for vulnerabilities and agentic risk

Overview

This is a real UDP/Nostr P2P messaging skill, but it handles messages, identity keys, logs, and public relay traffic in ways users should review carefully before installing.

Install only if you are comfortable with a P2P tool that joins UDP/Nostr networks by default, may publish metadata to public relays, sends message contents without clear encryption, and stores a reusable Nostr private key plus message-content audit logs on disk. Use trusted networks, avoid secrets in messages, consider disabling Nostr or audit logging where possible, and review dependency sources before running npm install.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
src/crypto/IdentityManager.ts:191
Finding

Unencrypted Nostr Private Key Stored with Unrestricted Default File Permissions

Content
View full analysis
{ if (!this.identity) return; // Convert the private key to base64 for JSON serialization const data = { ...this.identity, nostr: this.identity.nostr ? { pubkey: this.identity.nostr.pubkey, privateKey: Buffer.from(this.identity.nostr.privateKey).toString('base64'), } : undefined, }; await writeFile(this.identityPath, JSON.stringify(data, null, 2)); } ``` ### Technical Analysis The persistent identity file contains the complete Nostr private key encoded with Base64. Base64 only changes the representation of data and provides no encryption or confidentiality. The call to `writeFile` does not specify a restrictive file mode. Consequently, the resulting permissions depend on the process umask and deployment environment. On systems with permissive defaults, other local users or processes may be able to read `~/.osm-p2p/identity.json`. Possession of the Nostr private key is sufficient to create valid signatures under the victim's public key. There is no password-derived encryption, operating-system keychain integration, or hardware-backed protection. ### Attack Path 1. The victim starts the application, causing `IdentityManager.save()` to create `~/.osm-p2p/identity.json`. 2. A local attacker, compromised process, backup reader, or container co-tenant obtains read access to that file. 3. The attacker extracts the `nostr.privateKey` property. 4. The attacker Base64-decodes the value. 5. The recovered key is used to sign Nostr events as the victim and impersonate the node. ### Impact Assessment An attacker who reads the file can obtain the full signing authority of the affected Nostr identity. This permits persistent identity impersonation, forged announcements, forged messages, and abuse o ...[truncated 311 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/transport/NostrTransport.ts:139
Finding

Direct, Room, and Broadcast Messages Are Transmitted Without Encryption

Content
View full analysis
{ if (!this.pool || !this.identity) return; const event = this.createEvent( KIND_AGENT_MESSAGE, JSON.stringify(msg), [['p', targetPubkey]] ); await this.pool.publish(this.relays, event); this.stats.messagesSent++; this.stats.bytesSent += JSON.stringify(event).length; this.stats.lastActivity = Date.now(); } ``` Nostr broadcasts are also published as plaintext: ```ts async publish(msg: Envelope): Promise { if (!this.pool || !this.identity) return; const event = this.createEvent( KIND_AGENT_MESSAGE, JSON.stringify(msg) ); await this.pool.publish(this.relays, event); this.stats.messagesSent++; this.stats.bytesSent += JSON.stringify(event).length; this.stats.lastActivity = Date.now(); } ``` UDP messages are plain JSON datagrams: ```ts async send(msg: Envelope, addr: NodeAddress): Promise { if (!this.socket) return; const data = Buffer.from(JSON.stringify(msg)); return new Promise((resolve, reject) => { this.socket!.send(data, addr.port, addr.ip, (err) => { if (err) { reject(err); } else { this.stats.bytesSent += data.length; this.stats.messagesSent++; this.stats.lastActivity = Date.now(); resolve(); } }); }); } ``` ### Technical Analysis The Nostr `p` tag identifies an intended recipient, but it does not encrypt the event content. The complete envelope remains in `event.content` as readable JSON. Relay operators and parties capable of retrieving the event can i ...[truncated 1793 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/transport/NostrTransport.ts:215
Finding

Untrusted Network Envelopes Are Processed Without Sender Authentication or Identity Binding

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/core/AuditLogger.ts:40
Finding

Audit Logging Stores User Message Content in Plaintext by Default

Content
View full analysis
{ if (this.buffer.length === 0) return; const lines = this.buffer.map(entry => JSON.stringify(entry) ).join('\n') + '\n'; try { await appendFile(this.logPath, lines); this.buffer = []; } catch (e) { console.error('Audit log write failed:', e); } } ``` Logging is enabled by default: ```ts audit: { enabled: true, logPath: join(this.dataDir, 'audit.log'), ...config?.audit, }, ``` ### Technical Analysis The logger records the serialized payload of every incoming and outgoing message, truncating it only after ...[truncated 1402 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
package-lock.json:33
Finding

Dependency Lockfile Fetches Packages from a Third-Party Registry Mirror

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (51)

Known Vulnerable Dependency: vitest==2.1.9 — 2 advisory(ies): CVE-2026-47429 (When Vitest UI server is listening, arbitrary file can be read and executed); CVE-2026-84373 (Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock)

Critical
Category
Supply Chain
Confidence
90% 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.

Known Vulnerable Dependency: vitest==2.1.9 — 2 advisory(ies): CVE-2026-47429 (When Vitest UI server is listening, arbitrary file can be read and executed); CVE-2026-84373 (Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock)

Critical
Category
Supply Chain
Confidence
93% confidence
Finding

The project includes a known vulnerable Vitest version with advisories covering arbitrary file read and possible code execution in Vitest UI or mocker-related paths. Even though Vitest is a devDependency, development and CI environments often process untrusted branches, pull requests, fixtures, and test assets, so exploitation could expose secrets or execute code in high-trust environments.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as a P2P communication system using UDP and Nostr networking. However, this code chunk does not implement networking or message transport; instead, it performs audit logging. It creates directories, appends serialized log entries to a file, stores message content/metadata, and uses a timer to flush buffered logs. Filesystem-based persistent logging is a significant capability not reflected in the declared purpose or permissions, so this chunk is materially mismatched with the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The supplied code chunk is specifically a Nostr transport module, not a full hybrid UDP + Nostr P2P system. It performs Nostr relay subscription/publication, peer announcement/discovery, directed messaging via tagged events, and stats management. There is no UDP socket handling, NAT traversal, direct peer transport, or hybrid transport selection/fallback logic in this chunk. While this code is consistent with the Nostr portion of the declared description, the declared purpose overstates what this code actually does, so the description does not accurately represent this chunk on its own.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The implementation is consistent with part of the description—UDP-based P2P communication, local discovery, direct messaging, and broadcasting. However, the declared purpose specifically claims a hybrid system integrating both UDP direct connections and the Nostr network. In this code chunk, there is no evidence of any Nostr-related functionality, relay interaction, event publication/subscription, or hybrid routing/fallback behavior. The primary behavior here is a standalone UDP LAN transport layer with discovery/announce features. Therefore the description overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nanoid==3.3.11 — 3 advisory(ies): CVE-2026-67214 (nanoid: non-secure generators can loop indefinitely with negative size); CVE-2026-67213 (nanoid: custom generators can loop indefinitely when size is zero); CVE-2026-73086 (nanoid: Integer Overflow or Wraparound)

High
Category
Supply Chain
Confidence
80% 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.

Known Vulnerable Dependency: postcss==8.5.10 — 3 advisory(ies): CVE-2026-45623 (PostCSS: Arbitrary file read and information disclosure via attacker-controlled ); CVE-2026-69153 (PostCSS: incomplete fix of GHSA-6g55-p6wh-862q — attacker-controlled sourceMappi); CVE-2026-73646 (PostCSS: Path Traversal in Previous Source Map Auto-Loading (sourceMappingURL) l)

High
Category
Supply Chain
Confidence
80% 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.

Known Vulnerable Dependency: vite==5.4.21 — 3 advisory(ies): CVE-2026-39365 (Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling); CVE-2026-53571 (vite: `server.fs.deny` bypass on Windows alternate paths); CVE-2026-53632 (launch-editor: NTLMv2 hash disclosure via UNC path handling on Windows)

High
Category
Supply Chain
Confidence
80% 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.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code persists the Nostr private key to identity.json in reversible base64, which is encoding rather than protection. Any local attacker, malware, backup system, or unintended file exposure can recover the private key and fully impersonate the node on the Nostr side of the system.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly promotes broadcast and global relay messaging features, including UDP broadcast and Nostr-based wide-area communication, but does not warn users that messages may be transmitted beyond the local machine or local network. In a P2P communication skill, this omission can lead users to unintentionally disclose sensitive content, metadata, or presence information over LAN or public relays, especially because the examples make network transmission look routine and low-friction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation tells users to broadcast messages over LAN and Nostr without warning that these channels may expose message contents and metadata to other local participants, relay operators, or unintended recipients. In a messaging skill, omission of privacy and transmission-scope warnings can cause users to share sensitive information under false assumptions about confidentiality.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill promotes broadcast, relay, and hybrid LAN/Nostr messaging but does not clearly warn users that messages may be transmitted over the local network and third-party Nostr relays. Users may mistakenly assume chats are local or private, leading to unintended disclosure of message contents, metadata, and peer presence.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The CLI initializes the OSMP2P application with app.start() before most commands, which appears to trigger peer discovery and network participation automatically. Starting UDP/Nostr networking without clear user disclosure can surprise users, expose local metadata or presence on external networks, and cause unintended communication activity simply from running informational commands like status or list.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The logger persists inbound and outbound message payload data to disk, and the content field is derived directly from serialized message data with only length truncation, not redaction. In a P2P messaging system, payloads can contain sensitive user content, identifiers, or secrets, so audit logs become a secondary data store that may leak private information if read by local users, backups, support tooling, or an attacker with filesystem access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code automatically initiates network discovery follow-up behavior by attempting hole punching for newly discovered Nostr peers, and the file-level comments describe UDP broadcast, hole punching, and Nostr discovery as core behaviors. There is no user-facing prompt, log statement, or warning in this file explaining that the skill may contact discovered peers or perform network traversal activity, which can affect privacy and network integrity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This TypeScript file contains user-facing natural-language comments and docstrings exclusively in Chinese, including the class description and operational explanations. Under the language/locale policy, forcing a specific language without user opt-in or a documented regional justification is a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file contains Chinese-only natural-language comments and a user-visible system message (离开了房间) with no indication that users can choose another language or that the skill is intentionally limited to a Chinese locale. This can violate language/locale policy when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Lines L064-L071 state that the creator automatically joins the room, but addPeerToRoom checks this.rooms.get(roomId) and returns early when the room has not yet been stored. Because the room is only inserted at L074, the documented behavior directly contradicts what the code actually does.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The Nostr transport is started with identity.privateKey, which is access to sensitive credential material. Although the code does not log the key, there is no explicit comment, docstring, or user-facing disclosure explaining that this skill uses a private key for network identity/authentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code sends envelopes to peers via UDP and Nostr in send and broadcast, which transmits user or system data over the network. While startup/shutdown logs exist, there is no user-facing disclosure in these methods or surrounding comments/docstrings that message contents may be transmitted externally, including broadcast publication over Nostr.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Natural-language content in comments and console messages is written in Chinese, including operational status messages shown to users. This imposes a specific language without offering a language choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

When an existing identity is loaded, the code parses JSON and spreads the saved object directly into runtime state without converting nostr.privateKey back from its persisted base64/string form into the expected Uint8Array. This can cause authentication/signing failures or inconsistent behavior around key handling, and may lead developers to add unsafe workarounds or silently operate with malformed cryptographic state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The identity object is updated with current local network addresses and later persisted, which records potentially sensitive internal IP information without explicit notice or consent. In a P2P communication system this increases privacy and operational exposure, especially if the identity file is shared, backed up, or leaked.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This TypeScript file contains natural-language comments and console output in Chinese only, including startup, shutdown, and error/status messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation when no alternative locale selection or justification is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code broadcasts envelopes containing node identifiers, public keys, and network addresses across UDP/Nostr paths without any explicit consent, warning, or privacy gating in this entrypoint. In a P2P communication system, automatic disclosure of reachable addresses and identity metadata can enable tracking, network mapping, and targeted attacks against users, especially when discovery and broadcast are enabled by default.

Content

No source excerpt is available for this finding.