Back to skill

Security audit

公文格式转换

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this document-formatting skill suspicious because it reports automatic acceptance of tracked edits beyond formatting and a risk from opening untrusted legacy documents without disabling macros.

Treat this as a review warning and weigh the document integrity and legacy-file macro concerns before installing. The verdict is suspicious, not malicious; dependency versions and some references were not fully resolved, so the evidence is incomplete.

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
scripts/wfp_core.py
Finding

Word automation opens untrusted legacy documents without disabling macros

Content
View full analysis

Impact

A malicious document can execute commands, access files, or modify the host under the formatter user's account before conversion completes.

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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (26)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/wfp_process.py (reported line 51)May include surrounding context.

python
def external_program_environment():
    """Do not pass PyInstaller's bundled library paths to system LibreOffice."""
    environment = os.environ.copy()
    bundle = getattr(sys, '_MEIPASS', None)
    if not getattr(sys, 'frozen', False) or not bundle:
        return environment

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/wfp_safety_tests.py (reported line 163)May include surrounding context.

python
patch.object(sys, 'frozen', True, create=True), \
             patch.object(sys, '_MEIPASS', bundle, create=True):
            actual = external_program_environment()
            self.assertEqual(dict(os.environ), before)
            self.assertEqual(actual['PATH'], '/user/bin')
            self.assertEqual(actual['LD_LIBRARY_PATH'], '/user/lib')
            self.assertEqual(actual['OTHER_VALUE'], 'unchanged')

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wfp_cli.py (reported line 36)May include surrounding context.

python
brew install --cask libreoffice

Debian/Ubuntu:
  sudo apt-get update
  sudo apt-get install libreoffice

Kylin/银河麒麟(apt 系发行版):

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wfp_cli.py (reported line 37)May include surrounding context.

python
Debian/Ubuntu:
  sudo apt-get update
  sudo apt-get install libreoffice

Kylin/银河麒麟(apt 系发行版):
  sudo apt-get update

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wfp_cli.py (reported line 40)May include surrounding context.

python
sudo apt-get install libreoffice

Kylin/银河麒麟(apt 系发行版):
  sudo apt-get update
  sudo apt-get install libreoffice libreoffice-writer

Fedora:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wfp_cli.py (reported line 41)May include surrounding context.

python
Kylin/银河麒麟(apt 系发行版):
  sudo apt-get update
  sudo apt-get install libreoffice libreoffice-writer

Fedora:
  sudo dnf install libreoffice

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wfp_cli.py (reported line 44)May include surrounding context.

python
sudo apt-get install libreoffice libreoffice-writer

Fedora:
  sudo dnf install libreoffice

Arch Linux:
  sudo pacman -S libreoffice-fresh

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wfp_cli.py (reported line 47)May include surrounding context.

python
sudo dnf install libreoffice

Arch Linux:
  sudo pacman -S libreoffice-fresh

安装后请确认 soffice 可用:
  soffice --version

Formatting automatically accepts all tracked revisions and disables revision tracking, although the manifest only describes document layout and formatting.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

On Windows with COM available, formatting automatically accepts all tracked revisions and disables revision tracking without explicit user consent, potentially incorporating unapproved edits or deletions and removing their review history from the output. This exceeds a layout-formatting skill's stated purpose and could cause users to distribute substantively altered official documents as merely reformatted copies. Processing a temporary copy preserves the original and limits the damage, but does not protect the integrity of the delivered document.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wfp_process.py (reported line 173)May include surrounding context.

python
def _run_posix(command, timeout, cwd, stdin, stdout, stderr, environment, external):
    process = subprocess.Popen(command, cwd=cwd, stdin=stdin, stdout=stdout,
                               stderr=stderr, start_new_session=True, env=environment)
    deadline = time.monotonic() + timeout
    try:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wfp_safety_tests.py (reported line 39)May include surrounding context.

python
Path(marker).write_text(str(os.getpid()), encoding='ascii')
    if mode.startswith('parent'):
        child_mode = 'ignore-term' if mode == 'parent-ignore-term' else 'sleep'
        child = subprocess.Popen(worker_command(child_mode, marker + '.child', duration))
        until = time.monotonic() + 10
        while not Path(marker + '.child').exists() and time.monotonic() < until:
            time.sleep(.01)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wfp_safety_tests.py (reported line 83)May include surrounding context.

python
def test_timeout_kills_descendants_and_preserves_unrelated_process(self):
        with owned_temp_dir(prefix='wfp_process_test_') as directory:
            marker = str(Path(directory) / 'owned.pid')
            sentinel = subprocess.Popen(worker_command('sleep', str(Path(directory) / 'other.pid'), '30'))
            try:
                with self.assertRaises(subprocess.TimeoutExpired):
                    run_isolated(worker_command('parent-ignore-term', marker, '30'), timeout=8, external=False)

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/wfp_tests.py (reported line 745)May include surrounding context.

python
if argv:
        suite = unittest.defaultTestLoader.loadTestsFromNames(argv)
        return 0 if unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful() else 1
    suite = unittest.defaultTestLoader.loadTestsFromModule(__import__(__name__))
    import wfp_numbering_tests
    import wfp_numbering_integration_tests
    import wfp_attachment_tests

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The python-docx dependency has no version or integrity constraint, making installations non-reproducible and allowing unreviewed releases to enter the environment. A compromised release could execute with the formatter's access to documents, although no compromised package is demonstrated here.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
python-docx
lxml>=5.2
fonttools>=4.53,<5
tkinterdnd2

Unverifiable Dependency: python-docx has 2 known advisory(ies) (CVE-2016-5851 (Improper Restriction of XML External Entity Reference in python-docx); CVE-2016-5851 (python-docx before 0.8.6 allows context-dependent attackers to conduct XML Exter)), 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

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The lxml minimum version provides some constraint but still permits unreviewed future releases and does not verify artifact integrity. Because the formatter processes document XML, dependency integrity is relevant, though this finding does not prove an exploitable XML parser defect.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
python-docx
lxml>=5.2
fonttools>=4.53,<5
tkinterdnd2
pywin32; platform_system == "Windows"

Unverifiable Dependency: lxml has 14 known advisory(ies) (CVE-2021-43818 (lxml's HTML Cleaner allows crafted and SVG embedded scripts to pass through); CVE-2014-3146 (lxml Cross-site Scripting Via Control Characters); CVE-2021-28957 (lxml vulnerable to Cross-Site Scripting ) +11 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

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: fonttools has 4 known advisory(ies) (CVE-2023-45139 (fonttools XML External Entity Injection (XXE) Vulnerability); CVE-2025-66034 (fontTools is Vulnerable to Arbitrary File Write and XML injection in fontTools.v); CVE-2023-45139 (fonttools XML External Entity Injection (XXE) Vulnerability) +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

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The tkinterdnd2 dependency is unconstrained, so installation can retrieve a release that has not been tested or reviewed. This creates a conditional supply-chain risk at installation or import time, not evidence of malicious behavior in the skill.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
python-docx
lxml>=5.2
fonttools>=4.53,<5
tkinterdnd2
pywin32; platform_system == "Windows"

Unverifiable Dependency: pywin32 has 2 known advisory(ies) (CVE-2021-32559 (Integer overflow in pywin32); CVE-2021-32559 (An integer overflow exists in pywin32 prior to version b301 when adding an acces)), 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

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/wfp_process.py (reported line 264)May include surrounding context.

python
'CloseHandle': ([w.HANDLE], w.BOOL),
    }
    for name, (args, result) in signatures.items():
        getattr(kernel, name).argtypes = args
        getattr(kernel, name).restype = result

    def checked(value):

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/wfp_process.py (reported line 265)May include surrounding context.

python
}
    for name, (args, result) in signatures.items():
        getattr(kernel, name).argtypes = args
        getattr(kernel, name).restype = result

    def checked(value):
        if not value:

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/wfp_signature.py (reported line 357)May include surrounding context.

python
@staticmethod
    def _effective_flag(para, run, key):
        if run is not None and getattr(run.font, key) is not None:
            return getattr(run.font, key)
        for style in (run.style if run is not None else None, para.style):
            seen = set()

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/wfp_signature.py (reported line 358)May include surrounding context.

python
@staticmethod
    def _effective_flag(para, run, key):
        if run is not None and getattr(run.font, key) is not None:
            return getattr(run.font, key)
        for style in (run.style if run is not None else None, para.style):
            seen = set()
            while style is not None and style.style_id not in seen: