Back to skill

Security audit

Logseq

Security checks for vulnerabilities and agentic risk

Overview

This documentation-only skill is purpose-aligned for Logseq automation, but it recommends an overbroad local API bridge that could expose a user's notes to unintended reading or modification.

Review carefully before installing. Use this only with a trusted local Logseq graph, avoid exposing a generic HTTP or IPC bridge, prefer explicit allowlisted actions, and require confirmation or backups before any delete, bulk move, auto-tagging, graph config, or Git operation.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
references/examples.md:39
Finding

Unauthenticated Unrestricted Logseq API Bridge

Content
View full analysis

Vulnerability Details

File Location: references/examples.md:39-56
Vulnerability Type: Unauthenticated dynamic API dispatch
Risk Level: High

Vulnerable Code

javascript
### HTTP Bridge (for external scripts)

If you need to call Logseq API from external Node.js scripts, create a bridge plugin:

```javascript
// bridge-plugin/index.js
import '@logseq/libs';

logseq.ready({
  async call({ method, namespace, args }) {
    const proxy = logseq[namespace];
    if (!proxy || !proxy[method]) {
      throw new Error(`Unknown method: ${namespace}.${method}`);
    }
    return await proxy[method](...args);
  }
}).then(() => {
  // Listen on HTTP or expose IPC
  console.log('Bridge ready');
});

Technical Analysis

The recommended bridge dynamically resolves both namespace and method from caller-controlled input and invokes the resulting Logseq API with caller-supplied arguments. It does not implement:

  • Authentication or session-token verification
  • Authorization by operation or resource
  • An explicit namespace and method allowlist
  • Argument schema validation
  • Origin or host validation
  • Restrictions against destructive operations
  • User confirmation for sensitive actions

Checking whether a namespace and method exist is not an authorization control. Consequently, an HTTP or IPC implementation based directly on this example could expose all APIs available to the plugin rather than only the minimal operations required by an automation task.

The documented API surface includes graph-wide content queries, page and block modification, page deletion, graph configuration changes, file enumeration, and Git commands. The relevant destructive and privileged capabilities are documented at references/api-reference.md:323-327 and references/api-reference.md:567-578.

Attack Path

  1. A user follows the example and exposes the call callback through an HTTP or IPC endpoint.
  2. The endpoint is reachable by an untrusted local process, a r ...[truncated 1454 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace dynamic namespace and method dispatch with a small, explicit allowlist of required operations.
  2. Bind any HTTP listener exclusively to a loopback interface unless remote access is an intentional and secured requirement.
  3. Require a cryptographically strong, per-installation or per-session authentication token and compare it using a constant-time mechanism.
  4. Enforce authorization separately from authentication. Deny page deletion, unrestricted database queries, configuration changes, file enumeration, and Git operations by default.
  5. Validate every request against strict schemas, including method names, identifier formats, argument types, lengths, and nesting depth.
  6. Apply browser-origin protections where relevant, including a restrictive CORS policy and validation of Origin and Host headers. Do not treat CORS alone as authentication.
  7. Require explicit user confirmation for destructive or high-impact write operations.
  8. Add request-size limits, timeouts, rate limits, and audit logging that excludes sensitive graph content and credentials.
  9. Return generic errors to remote callers rather than internal object details.
  10. Document the bridge's trust boundary and provide a secure, complete server implementation instead of leaving transport and access controls unspecified.

A safer design should expose named handlers such as getBlock or insertBlock and map each handler to one fixed API call after authorization and schema validation, rather than evaluating logseq[namespace][method] from request data.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes examples for creating, updating, and deleting Logseq content but does not warn that these operations can irreversibly alter or remove user notes. In an agent skill context, omission of modification/deletion warnings increases the chance of unsafe automation or accidental destructive actions against a user's knowledge base.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documented bridge plugin exposes a generic method dispatcher that forwards externally supplied method names and arguments into the Logseq API without any authentication, allowlisting, or scope restriction. That creates a local HTTP control surface through which any process or webpage able to reach the endpoint could read, modify, or delete graph content, making the skill materially more dangerous than a purely local/manual integration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

These examples demonstrate creating pages and inserting or updating blocks without an explicit warning that running them will modify the user’s local knowledge base. In this skill context, Logseq automation directly affects user notes, so copy-pasted example code can cause unintended writes, clutter, or data overwrites if users run it without understanding the side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The automation workflows include bulk move and bulk update behaviors such as archiving completed tasks and auto-tagging pages, which can reorganize large portions of a user’s notes. Because this skill operates on a local Logseq instance with broad graph access, users may inadvertently trigger destructive or hard-to-reverse changes across many pages if they treat the examples as safe defaults.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The documentation highlights access to user configuration and current graph information, including path-related metadata, without noting that these may reveal sensitive local environment details. While this is expected capability for the API, lack of a privacy disclosure can lead users or downstream agents to expose filesystem paths, graph names, or personal settings unnecessarily.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file documents destructive operations such as removeBlock(uuid) and later deletePage(pageName) using direct examples, but it does not include any warning that these actions delete user data. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The execCommand(args) section shows git command execution including commit, which can change repository state, but the markdown provides no warning about modifying the current graph's version-controlled data. Under SQP-2 for markdown, descriptions should disclose behaviors that may affect user data or system integrity.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.