Back to skill

Security audit

CivilLabClaw AI

Security checks for vulnerabilities and agentic risk

Overview

This appears to be an incomplete civil-engineering AI prototype that can return convincing but fabricated safety-related results as if analysis succeeded.

Install only as a design-stage or demo prototype. Do not rely on its outputs for inspection, maintenance, operations, research conclusions, or structural-safety decisions until the placeholder algorithms are replaced, inputs are validated, data handling is documented, and dependencies are locked.

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

other

Error
Location
src/smart_monitor/analyzer.py:37
Finding

Analysis Modules Return Fabricated Safety-Critical Results Without Processing Inputs

Content
View full analysis

Vulnerability Details

File Locations:

  • src/ml_struct/predictor.py:49-89
  • src/dl_damage/detector.py:49-89
  • src/digital_twin/twinner.py:48-121
  • src/smart_monitor/analyzer.py:37-55, 93-190

Vulnerability Type: Fabricated safety-critical analysis results
Risk Level: High

Vulnerable Code

src/smart_monitor/analyzer.py:37-55:

python
def load_data(self, data_path: Path) -> Dict[str, np.ndarray]:
    """
    Load monitoring data.
    """
    return {
        "status": "success",
        "data": np.random.randn(1000, 8),
        "timestamps": np.arange(1000),
        "channels": ["ACC_1", "ACC_2", "ACC_3", "ACC_4",
                     "ACC_5", "ACC_6", "ACC_7", "ACC_8"]
    }

src/ml_struct/predictor.py:49-89:

python
def predict(self, features: Dict[str, Any]) -> Dict[str, Any]:
    return {
        "status": "success",
        "predictions": {
            "max_idr": {
                "mean": 0.0125,
                "std": 0.0023,
                "ci_95": [0.0080, 0.0170]
            },
            "max_accel": {
                "mean": 0.35,
                "std": 0.08,
                "ci_95": [0.19, 0.51]
            }
        },
        "feature_importance": {
            "pga": 0.45,
            "num_stories": 0.25,
            "concrete_strength": 0.15
        },
        "model_info": {
            "type": self.model_type,
            "r2": 0.92,
            "mape": 0.08
        }
    }

src/digital_twin/twinner.py:48-69:

python
def build_model(self, geometry: Dict[str, Any],
                materials: Dict[str, Any],
                boundary_conditions: Dict[str, Any]) -> Dict[str, Any]:
    return {
        "status": "success",
        "model_id": "twin_001",
        "model_type": self.model_type,
        "nodes": 1250,
        "elements": 3500,
        "dof": 7500
    }

T ...[truncated 2822 chars]

Remediation
View remediation

Remediation Suggestions

  1. Until the algorithms are implemented, replace successful mock responses with an explicit failure such as status: not_implemented.
  2. Require input validation before analysis:
    • Confirm that paths exist and resolve to permitted locations.
    • Validate file extensions, MIME signatures, dimensions, schemas, and size limits.
    • Reject malformed, empty, unsupported, and nonexistent inputs.
  3. Remove hard-coded detections, predictions, modal parameters, health indices, and model-performance metrics from production paths.
  4. Keep mock behavior only in dedicated test fixtures that must be enabled explicitly.
  5. Implement the documented model inference and data-processing pipelines before exposing successful results.
  6. Attach input hashes, model versions, configuration versions, timestamps, and processing logs to generated reports.
  7. Add tests proving that:
    • Different inputs produce appropriately different outputs.
    • Invalid inputs fail safely.
    • Missing models cannot produce successful inference.
    • Monitoring analysis uses the contents of the supplied file.
  8. Clearly state model limitations, validation datasets, uncertainty assumptions, and calibration requirements.
  9. Require qualified human review before these outputs are used for civil-engineering safety decisions.

T08 · Insecure Dependencies

Warning
Location
requirements.txt:8
Finding

Unpinned and Insufficiently Verified Third-Party Dependencies

Content
View full analysis

Vulnerability Details

File Locations:

  • requirements.txt:8-74
  • SKILL.md:382-390
  • README.md:138-141

Vulnerability Type: Insecure software supply-chain configuration
Risk Level: Medium

Vulnerable Code

requirements.txt:8-74 contains open-ended lower-bound constraints across the dependency set, including:

text
numpy>=1.21.0
pandas>=1.3.0
scipy>=1.7.0
scikit-learn>=1.0.0
xgboost>=1.5.0
lightgbm>=3.3.0
gpytorch>=1.8.0
optuna>=3.0.0
torch>=1.10.0
torchvision>=0.11.0
opencv-python>=4.5.0
opencv-contrib-python>=4.5.0
pillow>=9.0.0
albumentations>=1.0.0
pywt>=1.3.0
matplotlib>=3.5.0
plotly>=5.5.0
seaborn>=0.11.0
h5py>=3.6.0
hdf5storage>=0.1.18
openpyxl>=3.0.0
jinja2>=3.0.0
tqdm>=4.62.0
pyyaml>=6.0
loguru>=0.6.0
pytest>=7.0.0
pytest-cov>=3.0.0

SKILL.md:382-390 additionally recommends unpinned direct installation:

bash
pip install numpy pandas scipy matplotlib
pip install scikit-learn xgboost lightgbm
pip install torch torchvision torchaudio
pip install opencv-python pillow
pip install h5py hdf5storage
pip install openseespy
pip install modalpy

Technical Analysis

The use of >= constraints allows package installation to resolve to any current or future version satisfying the lower bound. No lock file, artifact hashes, trusted index configuration, or reviewed source URLs are supplied.

Consequently, installation behavior can change after the project has been audited. Python distributions may execute build-backend or installation logic, so a compromised, malicious, replaced, or dependency-confused package can obtain code execution with the privileges of the user running pip.

The specialized pywt dependency also lacks provenance documentation connecting the distribution name to an explicitly reviewed upstream project. This should be verified before installation rather than assumed from an import name.

This finding ...[truncated 1639 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin every production dependency to an exact, reviewed version.
  2. Generate a lock file using a reproducible dependency-management tool.
  3. Record cryptographic hashes for all distributions and install with hash verification, such as pip --require-hashes.
  4. Document and enforce the trusted package index rather than inheriting arbitrary user index configuration.
  5. Verify every specialized distribution name and link it to its reviewed upstream repository.
  6. Replace ad hoc installation commands in SKILL.md and README.md with the locked installation procedure.
  7. Separate core, optional, development, and platform-specific dependencies so users do not install unnecessary packages.
  8. Run dependency vulnerability and provenance scanning in continuous integration.
  9. Produce and retain a software bill of materials for each release.
  10. Perform installations in an isolated, non-privileged virtual environment and avoid running package installation as an administrator.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (69)

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · DELIVERY.md (reported line 1)May include surrounding context.

md
# CivilLabClaw-AI 技能包

🤖🏗️ **AI+ 土木交叉方向技能包** - 机器学习、深度学习损伤识别、数字孪生、智能监测数据分析

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · DESIGN.md (reported line 1)May include surrounding context.

md
# CivilLabClaw-AI 技能包

🤖🏗️ **AI+ 土木交叉方向技能包** - 机器学习、深度学习损伤识别、数字孪生、智能监测数据分析

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 1)May include surrounding context.

md
# CivilLabClaw-AI 技能包

🤖🏗️ **AI+ 土木交叉方向技能包** - 机器学习、深度学习损伤识别、数字孪生、智能监测数据分析

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The design explicitly supports user-uploaded images, sensor/monitoring data, Excel, MAT, and HDF5 inputs, but provides no privacy, retention, consent, or sensitive-data handling guidance. Because structural images and monitoring streams may contain proprietary infrastructure information, location metadata, or operational details, omission of data-handling safeguards can lead to inadvertent exposure or unsafe downstream sharing.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The invocation example includes a broad natural-language trigger like '帮我分析这张裂缝图片', which is generic enough to cause accidental routing or unintended activation in a larger agent ecosystem. In a multimodal assistant handling files and model execution, ambiguous triggers increase the risk of processing sensitive uploads or invoking the wrong skill without clear user intent confirmation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill describes writing outputs to local directories and generating files, but it does not declare any explicit tool scope or permissions boundaries. In an agent system, this can lead to implicit file-write capability being exercised without user visibility or policy enforcement, increasing the risk of unintended overwrites, data leakage into local files, or unsafe path handling if future implementations accept user-controlled paths.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger phrases include broad natural-language requests like analyzing data or building a digital twin, which can match ordinary conversation rather than an intentional skill invocation. This raises the chance of the skill being activated unexpectedly, causing unplanned processing of files, model actions, or output generation in contexts where the user did not mean to invoke this capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code presents the tool description, usage guidance, and runtime messages exclusively in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This file presents its primary documentation and user-facing behavior in a single language only, starting with the module description in Chinese. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The router returns end-user error text and suggestions only in Chinese, with no evidence that the user selected that locale or that the skill is intentionally restricted to a Chinese-speaking context. This creates a language policy issue because the skill behavior forces a single language in user-visible responses.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language documentation throughout the file is entirely in Chinese, including the module docstring and class/method descriptions, with no indication that language selection is optional or region-specific. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language docstrings and user-facing text entirely in Chinese, including the module description and argument documentation. Under the policy, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code uses Chinese-only natural-language strings in the module/class documentation and user-facing outputs such as anomaly severity and descriptions. Under the language/locale policy, forcing a single language without user opt-in or a documented region-specific justification is a policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function claims to load monitoring data from the supplied path but ignores the path entirely and returns synthetic random data. In a structural monitoring skill, this can cause downstream analysis, anomaly detection, and reporting to operate on fabricated inputs, creating unsafe false assurances or missed incidents.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The preprocessing routine advertises denoising, normalization, and outlier handling but returns the raw input unchanged along with fabricated quality metrics. This misrepresents signal quality and can invalidate all later analytics, potentially leading operators to trust corrupted or low-quality monitoring data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The anomaly detection method returns a fixed anomaly report regardless of the supplied data or extracted features. In an intelligent monitoring context, this is dangerous because it can suppress real anomalies or generate false incident narratives, undermining safety decisions for civil infrastructure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code’s natural-language interface text is entirely in Chinese, including the module description and function docstrings, with no indication that language selection is optional or constrained by a documented regional requirement. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill delivery document forces a single language/locale presentation throughout the file, with no indication that users may choose another language or that the restriction is required for a region-specific purpose. SQP-3 applies to natural-language policy violations across all file types, including locale constraints imposed without opt-in.

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 describes workflows where users upload images and data, and the skill performs processing that results in annotated visualizations and generated reports. Under the markdown variant of SQP-2, the description should warn about behaviors affecting user data or system integrity, but no disclosure is provided here about handling uploaded data or creating output artifacts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The integration section presents only Chinese activation and usage phrases, implying a fixed interaction language. Because the document does not state that the skill is region-specific or offer user language/locale choice, this can be read as a language policy constraint without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language instructions and examples consistently assume Chinese as the interaction language, but the file does not state that this is a China-specific or Chinese-only skill, nor does it offer user opt-in for language preference. This can violate language or locale policy where skills should not force a specific language without user choice or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This YAML file uses Chinese-only natural-language comments throughout the configuration, such as the title and section headers, with no indication that the skill supports other languages or that Chinese is a required locale. Under the policy rule for language or locale constraints, this can constitute a natural-language policy violation because it effectively forces 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
90% confidence
Finding

The description is written only in Chinese ("土木工程 AI 助手"), which indicates a language-specific presentation without any stated user choice or opt-in. Under the policy rule, forcing a specific language or locale without offering alternatives can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language comments and usage text are written only in Chinese, which can function as a language constraint for users reading or maintaining the skill. The file does not indicate that other languages are supported or that Chinese is an intentional, documented locale choice.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

Using a lower-bound version specifier for numpy allows installation of any newer release, including versions with regressions or known vulnerabilities, and prevents reproducible builds. In a scientific/ML skill that may process untrusted data files, uncertainty around the exact installed version increases supply-chain and patch-management risk.

Content

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

text
# ============================================
# 核心科学计算
# ============================================
numpy>=1.21.0
pandas>=1.3.0
scipy>=1.7.0