T09 · Insecure Skill Coding Practices
Error
- Location
- references/risk-assessment.md:25
- Finding
- HIGH Risk Classification Is Mathematically Unreachable<![CDATA[ ## Vulnerability Details **File Location**: `references/risk-assessment.md`, lines 25-37 **Vulnerability Type**: Logic flaw in security risk classification **Risk Level**: High ### Vulnerable Code ```text Architecture: 40% Performance: 20% Compatibility: 30% Security: 10% Total Score = (arch * 0.4) + (perf * 0.2) + (compat * 0.3) + (sec * 0.1) ``` ```text ### Risk Thresholds - **LOW**: Total score < 2.0 - **MEDIUM**: Total score 2.0 - 3.5 - **HIGH**: Total score > 3.5 ``` ### Technical Analysis Each assessment dimension is assigned a value from 1 through 3. Because the four weights sum to 1.0, the maximum possible result is: ```text (3 × 0.4) + (3 × 0.2) + (3 × 0.3) + (3 × 0.1) = 3.0 ``` The `HIGH` classification requires a score greater than 3.5 and therefore cannot be produced. Even an update receiving the maximum score in every dimension is classified as `MEDIUM`. This contradicts the documented security model, under which dangerous updates are supposed to be skipped as `HIGH`. The problem becomes security-critical because the configuration permits automatic installation of `MEDIUM` updates. A configuration example in `references/integration.md` explicitly describes `SMART_UPDATER_AUTO_UPDATE="MEDIUM"` as allowing automatic updates for both LOW and MEDIUM risk. ### Attack Path 1. An attacker publishes or compromises an OpenClaw or Skill update. 2. The update contains breaking, security-sensitive, or malicious changes. 3. The risk assessment assigns the maximum value of 3 to every dimension. 4. The weighted result is 3.0. 5. The unreachable `HIGH > 3.5` threshold causes the update to be classified as `MEDIUM`. 6. If the user has enabled automatic MEDIUM-risk updates, the updater accepts and installs the update. 7. Code contained in the installed update may subsequently execute with the privileges available to OpenClaw or the affected Skill. ### Impact Assessment The flaw can bypass the intended mandatory-review path for the most dangerou ...[truncated 743 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the unreachable thresholds with thresholds that fit the documented 1–3 input range. For example: ```text LOW: score < 1.7 MEDIUM: score 1.7–2.4 HIGH: score > 2.4 ``` 2. Alternatively, normalize the weighted score to a larger range before applying the current thresholds. 3. Add deterministic overrides that always require manual approval when an update includes: - Executable or installation-script changes. - Authentication or authorization changes. - Dependency-source changes. - Database migrations. - Breaking API changes. - Security-sensitive configuration changes. 4. Do not permit automatic installation of security-critical updates solely because an aggregate score is below a threshold. 5. Add automated boundary tests covering: - Minimum possible score. - Every threshold boundary. - Maximum possible score. - Maximum values in all dimensions. - Security-critical updates with otherwise low scores. 6. Fail closed if scoring is incomplete, malformed, contradictory, or outside the expected range. 7. Require explicit manual approval for MEDIUM and HIGH updates in production environments. ]]>
