You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by as...@apache.org on 2026/05/05 12:15:51 UTC

(tooling-agents) branch main updated: ASVS audit: 3.6.1.md (redacted)

This is an automated email from the ASF dual-hosted git repository.

asf-tooling pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-agents.git


The following commit(s) were added to refs/heads/main by this push:
     new 3c89522  ASVS audit: 3.6.1.md (redacted)
3c89522 is described below

commit 3c895221908d685d0441c89714f3915fc8035667
Author: ASF Tooling Team <ro...@apache.org>
AuthorDate: Tue May 5 14:07:03 2026 +0200

    ASVS audit: 3.6.1.md (redacted)
---
 ASVS/reports/steve/v3/d0aa7e9/all/3.6.1.md | 140 +++++++++++++++++++++++++++++
 1 file changed, 140 insertions(+)

diff --git a/ASVS/reports/steve/v3/d0aa7e9/all/3.6.1.md b/ASVS/reports/steve/v3/d0aa7e9/all/3.6.1.md
new file mode 100644
index 0000000..3b8ebc3
--- /dev/null
+++ b/ASVS/reports/steve/v3/d0aa7e9/all/3.6.1.md
@@ -0,0 +1,140 @@
+# Security Audit Report: ASVS 3.6.1
+
+## Executive Summary
+
+| Field | Value |
+|-------|-------|
+| **Repository** | apache/steve/v3 |
+| **Audit Date** | May 05, 2026 |
+| **Auditor** | Tooling Agents (bundled-pass mode) |
+| **ASVS Requirement** | ASVS 3.6.1 |
+| **Files Analyzed** | 12 relevant / 49 total |
+| **Files Skipped** | 12 |
+
+**Requirement description:** Verify that client-side assets, such as JavaScript libraries, CSS, or web fonts, are only hosted externally (e.g., on a Content Delivery Network) if the resource is static and versioned and Subresource Integrity (SRI) is used to validate the integrity of the asset. If this is not possible, there…
+
+### Findings Overview
+
+| Severity | Count |
+|----------|-------|
+| 🔴 Critical | 0 |
+| 🟠 High | 0 |
+| 🟡 Medium | 0 |
+| 🟢 Low | 2 |
+
+---
+
+## ASVS-3.6.1: External Resource Integrity
+
+### Findings for 3.6.1
+
+#### [LOW]
+**Finding ID:** ASVS-361-LOW-001  
+**Location:** `v3/server/templates/header.ezt`, line 12  
+**Description:** An image resource is loaded from an external domain without integrity verification.
+
+```html
+<img src="https://www.apache.org/foundation/press/kit/feather.svg" alt="Logo" 
+     width="30" height="30" class="d-inline-block align-text-top">
+```
+
+**Impact:** If the external apache.org CDN/server is compromised, a malicious SVG could be served (SVGs can contain JavaScript in some contexts). However, SRI is technically not supported for `<img>` tags by browsers, making this difficult to remediate with standard mechanisms. The resource is from the same organization (ASF) which mitigates the risk.
+
+**Remediation:**
+```bash
+# Self-host the SVG (preferred approach for L3 compliance)
+curl -o v3/server/static/img/feather.svg \
+  https://www.apache.org/foundation/press/kit/feather.svg
+```
+```html
+<img src="/static/img/feather.svg" alt="Logo" width="30" height="30">
+```
+
+#### [LOW]
+**Finding ID:** ASVS-361-LOW-002  
+**Location:** `v3/server/templates/header.ezt`, line 10  
+**Description:** Third-party CSS (`bootstrap-icons.css`) is served locally but without an `integrity` attribute, despite other third-party assets having SRI.
+
+```html
+<link href="/static/css/bootstrap-icons.css" rel="stylesheet">
+<!-- Compare with bootstrap.min.css which HAS integrity: -->
+<link href="/static/css/bootstrap.min.css" rel="stylesheet"
+      integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9">
+```
+
+**Impact:** Since the resource is self-hosted, this is defense-in-depth only. If an attacker gains write access to the static directory, the `bootstrap-icons.css` could be modified without detection, while `bootstrap.min.css` would fail integrity checks.
+
+**Remediation:** Add integrity attribute for consistency and defense-in-depth:
+```bash
+# In fetch-thirdparty.sh, add:
+echo "bootstrap-icons.css:"
+echo -n "sha384-" ; openssl dgst -sha384 -binary "${STATIC_DIR}/css/bootstrap-icons.css" | openssl base64 -A ; echo ""
+```
+
+### Security Controls Inventory for 3.6.1
+
+| Resource | Source | SRI Present | Status |
+|----------|--------|-------------|--------|
+| `bootstrap.min.css` | Self-hosted (fetched v5.3.1) | ✅ Yes | Compliant |
+| `bootstrap.bundle.min.js` | Self-hosted (fetched v5.3.1) | ✅ Yes | Compliant |
+| `Sortable.min.js` | Self-hosted (fetched v1.15.7) | ✅ Yes | Compliant |
+| `bootstrap-icons.css` | Self-hosted (fetched v1.13.1) | ❌ No | Defense-in-depth gap |
+| `steve.js` | Self-hosted (first-party) | ❌ No | N/A (own code) |
+| `steve.css` | Self-hosted (first-party) | ❌ No | N/A (own code) |
+| `feather.svg` | External (apache.org) | ❌ No | Minor gap |
+
+### Positive Patterns for 3.6.1
+
+1. **Self-hosted third-party assets**: All JavaScript libraries and CSS frameworks are downloaded and served locally via `fetch-thirdparty.sh`, eliminating CDN dependency.
+2. **Versioned downloads**: The fetch script uses explicit version pinning (`VERSION="5.3.1"`, `I_VERSION="1.13.1"`, `S_VERSION="1.15.7"`).
+3. **SRI hash generation**: The `fetch-thirdparty.sh` script generates SHA-384 integrity hashes and instructs developers to update templates.
+4. **SRI applied to core assets**: `bootstrap.min.css`, `bootstrap.bundle.min.js`, and `Sortable.min.js` all have `integrity` attributes in templates.
+5. **`crossorigin="anonymous"` on SRI resources**: Present on `Sortable.min.js` (though technically unnecessary for same-origin resources).
+
+---
+
+
+
+## Cross-cutting Architecture Observations
+
+1. **Missing Security Header Middleware**: The application lacks a centralized response header middleware to set security headers (`X-Content-Type-Options`, `Cross-Origin-Resource-Policy`, `X-Frame-Options`, `Content-Security-Policy`). This creates Type B gaps—where controls should exist application-wide but don't.
+
+2. **Self-Hosting Pattern (Positive)**: The architecture decision to self-host all third-party assets via `fetch-thirdparty.sh` with version pinning eliminates CDN compromise risks and makes SRI defense-in-depth rather than critical. This is a strong architectural decision for a voting application.
+
+3. **Authentication Framework Dependency**: The application delegates authentication and redirect handling to the `asfquart` framework, creating an audit boundary. The security of redirect validation (3.7.2) depends entirely on the framework's implementation of `/auth` endpoints.
+
+4. **Inline JavaScript Pattern**: The application embeds authorized data in inline `<script>` blocks within HTML pages rather than as separate authenticated JavaScript resources. This inherently prevents XSSI attacks (3.5.7) through the Same-Origin Policy applied to HTML responses.
+
+5. **Document Serving Without Resource Policy**: The `serve_doc` endpoint correctly implements authentication and authorization but lacks modern browser-side protections (CORP, Sec-Fetch validation), creating a false sense of security—the authorization check alone doesn't prevent cross-origin resource embedding by an already-authenticated user's browser (Type B gap).
+
+6. **Template Security**: EZT templates use `[format "js,html"]` escaping for user-generated content injected into JavaScript contexts, showing awareness of XSS prevention, which indirectly supports browser origin separation requirements.
+
+## Cross-cutting Recommendations
+
+### Immediate (Critical/High Priority)
+1. **Add `Cross-Origin-Resource-Policy: same-origin` to authenticated responses**, particularly `serve_doc()`. This is a single-header addition that prevents the most impactful cross-origin resource theft scenario (ASVS-358-HIGH-001).
+
+2. **Implement Sec-Fetch validation middleware** for all authenticated endpoints:
+   ```python
+   @APP.before_request
+   async def validate_sec_fetch():
+       if quart.request.path.startswith('/docs/') or quart.request.path.startswith('/do-'):
+           sec_fetch_site = quart.request.headers.get('Sec-Fetch-Site', '')
+           if sec_fetch_site not in ('same-origin', 'none', ''):
+               quart.abort(403)
+   ```
+
+### Short-term (Medium Priority)
+3. **Add centralized security headers middleware** to set `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, and `Cross-Origin-Resource-Policy` on all responses.
+
+4. **Self-host the Apache feather SVG** to eliminate the last external resource dependency and achieve full resource isolation.
+
+5. **Verify `/auth` endpoint redirect validation** in the `asfquart` framework—confirm that `login=` and `logout=` parameters are validated against an allowlist or restricted to same-origin paths.
+
+### Long-term (Low Priority / Defense-in-Depth)
+6. **Add SRI to `bootstrap-icons.css`** for consistency with other third-party assets.
+
+7. **Implement external link interstitial** for ASVS L3 compliance—either a JavaScript confirmation dialog or a dedicated redirect page for the small number of external links.
+
+8. **Add `rel="noopener noreferrer"` to external links** to prevent reverse tabnapping via the `target` attribute on the Privacy Policy link.
+        
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org