Back to skill

Security audit

SharePoint by altf1be

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for SharePoint automation, but it can create organization-wide edit links and process Office files with weak resource controls, so users should review it before installing.

Install only for a tightly scoped SharePoint site and a dedicated Entra app. Review whether organization-wide edit links are acceptable in your tenant; disable or modify that command if links should be user-specific or view-only. Keep document parsing isolated and update dependencies before using it on untrusted SharePoint content.

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

Warning
Location
scripts/sharepoint.mjs:159
Finding
Unbounded Office Archive Expansion Can Cause Resource Exhaustion<![CDATA[ ## Vulnerability Details **File Location**: `scripts/sharepoint.mjs:159`, `scripts/sharepoint.mjs:242-259` **Vulnerability Type**: Unbounded decompression and document parsing **Risk Level**: Medium ### Vulnerable Code ```js if (meta.size > CFG.maxFileSize) { console.error(`ERROR: File too large (${(meta.size / 1048576).toFixed(1)} MB > ${(CFG.maxFileSize / 1048576).toFixed(1)} MB limit)`); process.exit(1); } // Download content const stream = await client.api(`/drives/${driveId}/root:/${path}:/content`).getStream(); const chunks = []; for await (const chunk of stream) { chunks.push(chunk); } const buf = Buffer.concat(chunks); // Extract text const text = await extractText(buf, meta.name); process.stdout.write(text); ``` The PPTX extraction path subsequently loads and expands the archive without decompression limits: ```js const JSZip = (await import('jszip')).default; if (!JSZip) throw new Error('jszip not available'); const zip = await JSZip.loadAsync(buf); const texts = []; const slideFiles = Object.keys(zip.files) .filter(f => f.match(/^ppt\/slides\/slide\d+\.xml$/)) .sort(); for (const file of slideFiles) { const xml = await zip.files[file].async('string'); const slideText = xml.replace(/<[^>]+>/g, ' ') .replace(/\s+/g, ' ') .trim(); ``` ### Technical Analysis The application enforces `SP_MAX_FILE_SIZE` only against the compressed SharePoint object size. PPTX files are ZIP archives, and their decompressed contents can be substantially larger than the stored file. `JSZip.loadAsync(buf)` processes the archive in the main Node.js process without limits on: - Total decompressed size - Number of ZIP entries - Maximum size of an individual entry - Compression ratio - XML processing size - Parsing duration - Process memory consumption Each selected slide is then expanded completely into a JavaScript string with `async('string')`. A maliciously constructed PPTX can therefore pass the default 50 MB compressed-size chec ...[truncated 1696 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Limit decompressed content** - Reject archives whose declared or observed aggregate uncompressed size exceeds a conservative threshold. - Enforce maximum sizes for individual entries and extracted XML strings. - Reject archives with suspicious compression ratios. 2. **Limit archive structure** - Set a maximum ZIP entry count. - Process only expected PPTX paths. - Reject encrypted, malformed, nested, or otherwise unexpected archives. 3. **Avoid unrestricted string expansion** - Do not call `async('string')` on an entry until its uncompressed size has been validated. - Prefer bounded streaming extraction where supported. - Stop extraction once a maximum output-text size is reached. 4. **Isolate document parsing** - Run Office and PDF parsers in a worker thread or separate subprocess/container. - Apply operating-system or container memory and CPU limits. - Terminate parsing when a strict timeout is exceeded. 5. **Validate actual download size** - Track cumulative downloaded bytes instead of relying exclusively on SharePoint metadata. - Abort the stream immediately when the configured maximum is exceeded. 6. **Fail closed** - Treat limit violations and parser timeouts as security errors. - Return a concise error without retrying the same document automatically. - Record the file identifier and rejection reason in security telemetry without logging document contents or credentials. 7. **Add regression tests** - Test high-compression-ratio PPTX files. - Test oversized XML entries and excessive entry counts. - Confirm that malformed archives cannot exhaust process memory or block execution beyond the configured timeout. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (25)

Credential Access

High
Category
Privilege Escalation
Content
npm install

# 3. Configure
cp .env.example .env
# Edit .env with your tenant ID, app client ID, cert path, site ID

# 4. Use
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Known Vulnerable Dependency: @xmldom/xmldom==0.8.11 — 15 advisory(ies): CVE-2026-83608 (xmldom: DocType `name` Injection Bypasses requireWellFormed); CVE-2026-41673 (xmldom: Uncontrolled recursion in XML serialization leads to DoS); CVE-2026-83605 (xmldom: Attribute name injection via setAttribute() bypasses requireWellFormed) +12 more

High
Category
Supply Chain
Confidence
94% confidence
Finding
@xmldom/xmldom 0.8.11 is a known vulnerable transitive dependency pulled in by mammoth for DOCX/XML handling. In this skill’s context, it may process untrusted Office document content from SharePoint, so XML parser/serializer bugs can plausibly be triggered for denial of service or malformed document handling, though package-lock.json alone does not prove the specific vulnerable code paths are exercised.

Known Vulnerable Dependency: brace-expansion==1.1.12 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-33750 (brace-expansion: Zero-step sequence causes process hang and memory exhaustion); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
91% confidence
Finding
brace-expansion 1.1.12 has published DoS issues involving pathological expansion patterns. Here it is a transitive dependency of glob-related tooling, and package-lock.json does not show direct exposure to attacker-controlled glob expressions, so exploitability is more limited but still a supply-chain weakness.

Known Vulnerable Dependency: image-size==1.2.1 — 2 advisory(ies): CVE-2025-71329 (image-size: JXL and HEIF parsers allow denial of service through infinite loops); CVE-2025-71330 (image-size: ICNS parser allows denial of service through an infinite loop)

High
Category
Supply Chain
Confidence
93% confidence
Finding
image-size 1.2.1 has known parser infinite-loop DoS issues, and this skill includes PowerPoint/document tooling that may inspect embedded images from untrusted files. Because the skill is designed for Office document intelligence on SharePoint content, attacker-supplied documents could make this more relevant than in a purely local trusted workflow.

Known Vulnerable Dependency: minimatch==3.1.3 — 1 advisory(ies): CVE-2026-27904 (minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regu)

High
Category
Supply Chain
Confidence
89% confidence
Finding
minimatch 3.1.3 has a ReDoS issue on crafted patterns. In this lockfile it appears as a transitive dependency of glob/archive-related packages, and there is no evidence in this file alone that untrusted users can submit patterns directly, so the main risk is latent rather than clearly reachable.

Known Vulnerable Dependency: brace-expansion==2.0.2 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-33750 (brace-expansion: Zero-step sequence causes process hang and memory exhaustion); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
91% confidence
Finding
brace-expansion 2.0.2 also carries DoS risks from crafted expansion inputs. As with the 1.x instance, this is a real vulnerable package presence, but likely only exploitable if attacker-controlled pattern strings reach the affected matching logic.

Known Vulnerable Dependency: minimatch==5.1.7 — 2 advisory(ies): CVE-2026-27904 (minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regu); CVE-2026-27903 (minimatch has ReDoS: matchOne() combinatorial backtracking via multiple non-adja)

High
Category
Supply Chain
Confidence
92% confidence
Finding
minimatch 5.1.7 is flagged for ReDoS through crafted glob patterns. This is a genuine vulnerable dependency, but based on the lockfile alone it appears transitive and not obviously exposed to direct attacker-supplied pattern input, reducing likely impact.

Known Vulnerable Dependency: tmp==0.2.5 — 1 advisory(ies): CVE-2026-44705 (tmp has Path Traversal via unsanitized prefix/postfix that enables directory esc)

High
Category
Supply Chain
Confidence
90% confidence
Finding
tmp 0.2.5 has a path traversal issue via unsanitized prefix/postfix values, and exceljs depends on tmp while this skill processes Office files. If the skill passes attacker-influenced values into temp-file creation APIs, this could enable filesystem writes outside intended directories; if not, the issue remains latent but real.

Credential Access

High
Category
Privilege Escalation
Content
// ── Config ──────────────────────────────────────────────────────────────────

config(); // load .env

// Lazy config — only validated when a command actually runs
let _cfg;
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
// ── Config ──────────────────────────────────────────────────────────────────

config(); // load .env

// Lazy config — only validated when a command actually runs
let _cfg;
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The README advertises broad natural-language commands such as reading, uploading, and summarizing SharePoint content without documenting approval boundaries, path scoping, or confirmation requirements for sensitive actions. In an agent skill context, vague trigger examples can encourage overbroad invocation and unintended access to enterprise documents, especially because the skill supports both read and write operations against SharePoint.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill declares required environment variables and operational commands but does not define an explicit tool scope such as permissions or allowed-tools. That creates an authorization and review gap: an agent runtime may expose broader capabilities than intended, making sensitive SharePoint read/write/delete actions possible without clear policy boundaries.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The edit-link functionality creates an organization-scoped edit URL for a SharePoint item, which can broaden access semantics beyond direct file operations by enabling wider in-organization sharing. In a CLI advertised for secure SharePoint operations, exposing shareable edit links increases the risk of unintended document dissemination or unauthorized modification if the link is mishandled or logged.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The code explicitly requests a sharing link with type 'edit' and scope 'organization', allowing anyone in the tenant with the link to potentially edit the document. That capability is more permissive than simple file read/write operations performed by the application itself and can create lateral access paths that are harder to govern than direct Graph API access.

Known Vulnerable Dependency: uuid==8.3.2 — 1 advisory(ies): CVE-2026-41907 (uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided)

Low
Category
Supply Chain
Confidence
82% confidence
Finding
uuid 8.3.2 has a low-severity bounds-check issue in specific v3/v5/v6 buffer-accepting code paths. This is a real vulnerable dependency presence, but exploitation is unlikely unless the skill or a dependency invokes those specific APIs with attacker-controlled buffers.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"url": "https://github.com/ALT-F1-OpenClaw/openclaw-skill-sharepoint.git"
  },
  "dependencies": {
    "@azure/identity": "^4.0.0",
    "@microsoft/microsoft-graph-client": "^3.0.0",
    "commander": "^12.0.0",
    "dotenv": "^16.0.0",
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
},
  "dependencies": {
    "@azure/identity": "^4.0.0",
    "@microsoft/microsoft-graph-client": "^3.0.0",
    "commander": "^12.0.0",
    "dotenv": "^16.0.0",
    "exceljs": "^4.4.0",
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dependencies": {
    "@azure/identity": "^4.0.0",
    "@microsoft/microsoft-graph-client": "^3.0.0",
    "commander": "^12.0.0",
    "dotenv": "^16.0.0",
    "exceljs": "^4.4.0",
    "jszip": "^3.10.1",
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"@azure/identity": "^4.0.0",
    "@microsoft/microsoft-graph-client": "^3.0.0",
    "commander": "^12.0.0",
    "dotenv": "^16.0.0",
    "exceljs": "^4.4.0",
    "jszip": "^3.10.1",
    "mammoth": "^1.8.0",
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"@microsoft/microsoft-graph-client": "^3.0.0",
    "commander": "^12.0.0",
    "dotenv": "^16.0.0",
    "exceljs": "^4.4.0",
    "jszip": "^3.10.1",
    "mammoth": "^1.8.0",
    "pdf-parse": "^1.1.1",
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"commander": "^12.0.0",
    "dotenv": "^16.0.0",
    "exceljs": "^4.4.0",
    "jszip": "^3.10.1",
    "mammoth": "^1.8.0",
    "pdf-parse": "^1.1.1",
    "pptxgenjs": "^3.12.0"
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dotenv": "^16.0.0",
    "exceljs": "^4.4.0",
    "jszip": "^3.10.1",
    "mammoth": "^1.8.0",
    "pdf-parse": "^1.1.1",
    "pptxgenjs": "^3.12.0"
  },
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"exceljs": "^4.4.0",
    "jszip": "^3.10.1",
    "mammoth": "^1.8.0",
    "pdf-parse": "^1.1.1",
    "pptxgenjs": "^3.12.0"
  },
  "engines": {
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"jszip": "^3.10.1",
    "mammoth": "^1.8.0",
    "pdf-parse": "^1.1.1",
    "pptxgenjs": "^3.12.0"
  },
  "engines": {
    "node": ">=18.0.0"
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Intent-Code Divergence

Low
Confidence
76% confidence
Finding
The top-level description presents the tool as providing secure file operations via Graph API. However, the edit-link implementation creates an organization-scoped edit link, which is a sharing action that can expand how others access a document and is meaningfully different from ordinary file CRUD.

Static analysis

No suspicious patterns detected.