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:21:00 UTC
(tooling-agents) branch main updated: ASVS audit: 3.1.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 7551a19 ASVS audit: 3.1.1.md (redacted)
7551a19 is described below
commit 7551a19373136f069449f6b8cc7feefb859b1b9c
Author: ASF Tooling Team <ro...@apache.org>
AuthorDate: Tue May 5 14:06:20 2026 +0200
ASVS audit: 3.1.1.md (redacted)
---
ASVS/reports/steve/v3/d0aa7e9/all/3.1.1.md | 133 +++++++++++++++++++++++++++++
1 file changed, 133 insertions(+)
diff --git a/ASVS/reports/steve/v3/d0aa7e9/all/3.1.1.md b/ASVS/reports/steve/v3/d0aa7e9/all/3.1.1.md
new file mode 100644
index 0000000..5081c88
--- /dev/null
+++ b/ASVS/reports/steve/v3/d0aa7e9/all/3.1.1.md
@@ -0,0 +1,133 @@
+# Security Audit Report: ASVS 3.1.1
+
+## Executive Summary
+
+| Field | Value |
+|-------|-------|
+| **Repository** | apache/steve/v3 |
+| **Audit Date** | May 05, 2026 |
+| **Auditor** | Tooling Agents (bundled-pass mode) |
+| **ASVS Requirement** | ASVS 3.1.1 |
+| **Files Analyzed** | 10 relevant / 49 total |
+| **Files Skipped** | 12 |
+
+**Requirement description:** Verify that application documentation states the expected security features that browsers using the application must support (such as HTTPS, HTTP Strict Transport Security (HSTS), Content Security Policy (CSP), and other relevant HTTP security mechanisms). It must also define how the applicationβ¦
+
+### Findings Overview
+
+| Severity | Count |
+|----------|-------|
+| π΄ Critical | 0 |
+| π High | 0 |
+| π‘ Medium | 1 |
+| π’ Low | 0 |
+
+---
+
+## ASVS-3.1.1: Web Frontend Security Documentation
+
+### Findings for 3.1.1
+
+### [MEDIUM]
+**Finding ID:** ASVS-311-MED-001
+
+**Title:** No Documentation of Required Browser Security Features
+
+**File:** All provided files (including `v3/TODO.md`)
+
+**Evidence of absence:**
+```markdown
+# TODO: Review and Fixes for v3/server/pages.py
+# ... (no mention of browser security requirements documentation)
+```
+
+The `header.ezt` template:
+```html
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <!-- No CSP meta tag, no documentation reference -->
+```
+
+**Data flow:** N/A β documentation requirement
+
+**Impact:** Without documentation specifying required browser security features (HTTPS enforcement, HSTS, CSP policy, X-Content-Type-Options, etc.), deployers cannot configure the application correctly, and the application behavior when features are unavailable is undefined. This is a Level 3 requirement relevant to ensuring a secure deployment baseline.
+
+**Remediation:**
+Create a `SECURITY.md` or equivalent document specifying:
+```markdown
+# Browser Security Requirements
+
+## Required Features
+- **HTTPS**: All connections MUST use TLS 1.2+
+- **HSTS**: Strict-Transport-Security with min 1 year max-age
+- **CSP**: Content-Security-Policy restricting script-src, style-src
+- **X-Content-Type-Options**: nosniff
+- **X-Frame-Options**: DENY (or CSP frame-ancestors 'none')
+
+## Degraded Behavior
+- If HTTPS is unavailable: Application MUST NOT serve content over HTTP
+- If JavaScript is disabled: Voting forms will not function; users are warned
+- If CSP is not enforced: Application remains functional but with reduced XSS protection
+```
+
+### Security Controls Inventory for 3.1.1
+
+| Control | Location | Status |
+|---------|----------|--------|
+| Security features documentation | Not found | β MISSING |
+| CSP header/meta configuration | Not found | β MISSING |
+| HSTS configuration | Not found | β MISSING |
+| Degradation behavior documentation | Not found | β MISSING |
+
+### Positive Patterns for 3.1.1
+
+- The application uses Subresource Integrity (SRI) on the Bootstrap JS bundle in `footer.ezt` (`integrity="sha384-..."`) and Bootstrap CSS in `header.ezt`, indicating awareness of supply-chain security.
+- The template structure separates concerns (header/footer includes), which would make it straightforward to add security headers documentation.
+
+---
+
+
+
+## Cross-cutting Architecture Observations
+
+1. **Defense-in-Depth Gap:** The application relies heavily on authentication (`@asfquart.auth.require`) as its primary security boundary but lacks multiple defense layers. There is no CSP, no CSRF validation, no rate limiting, and incomplete authorization β if authentication is bypassed, nearly all controls fail.
+
+2. **Type B Gaps (Control Exists but Not Applied):**
+ - CSRF token is generated (`basic.csrf_token = 'placeholder'`) and sent to templates, but NEVER validated server-side on any POST endpoint.
+ - The `[format "js,html"]` EZT escaping is used in `manage.ezt` for issue titles in onclick handlers but NOT used in `vote-on.ezt` for STV_CANDIDATES data.
+ - Authorization check comments (`### check authz`) exist at 8+ locations but authorization logic is never implemented.
+
+3. **Mixed Security Maturity:** The `vote-on.ezt` template demonstrates good practices (IIFE, escapeHtml, textContent) while other templates (`manage.ezt`, `manage-stv.ezt`) use global scope and raw HTML rendering. The `election.py` module has strong cryptographic vote protection while `pages.py` has fundamental web security gaps.
+
+4. **State-Changing GET Requests:** `/do-open/<eid>` and `/do-close/<eid>` use GET methods for state-changing operations. This violates HTTP semantics and makes CSRF trivially exploitable (no CSRF token needed for GET requests). The `manage.ezt` template triggers these via `window.location.href`, confirming this is by design.
+
+5. **Document Serving as Attack Vector:** The `serve_doc()` endpoint combined with `rewrite_description()` creating links to documents creates a complete attack chain: upload malicious HTML β link is auto-generated in issue description β voters click link β XSS in application origin.
+
+## Cross-cutting Recommendations
+
+### Immediate (Critical/High β deploy blockers)
+
+1. **Fix `rewrite_description()`** to HTML-escape description content before wrapping in `<pre>` tags (ASVS-322-HIGH-001).
+2. **Add `Content-Disposition: attachment`** to `serve_doc()` responses and validate `docname` for path traversal (ASVS-321-HIGH-001).
+3. **Implement CSRF validation** β the token infrastructure exists but is never verified. Add a decorator for POST endpoints that validates the token from the form/header matches the session value.
+4. **Add `[format "js"]` escaping** to all EZT values rendered inside JavaScript string literals in `vote-on.ezt` (ASVS-322-MED-002).
+
+### Short-term (1-2 sprints)
+
+5. **Implement CSP headers** β start with `Content-Security-Policy: default-src 'self'` and nonce-based script allowance. This mitigates multiple XSS vectors.
+6. **Configure session cookies** with `Secure`, `HttpOnly`, `SameSite=Lax`, and `__Host-` prefix (ASVS-331-HIGH-001).
+7. **Add rate limiting middleware** for vote submission and election creation endpoints (ASVS-242-HIGH-001).
+8. **Convert state-changing GET endpoints** (`/do-open/`, `/do-close/`) to POST with CSRF validation.
+9. **Wrap `manage.ezt` JavaScript** in IIFE with strict mode and add type checking on `getElementById` results (ASVS-323-MED-001).
+
+### Long-term (architectural improvements)
+
+10. **Implement authorization framework** β replace all `### check authz` placeholders with ownership/permission verification.
+11. **Create security documentation** per ASVS 3.1.1, specifying browser requirements and degradation behavior.
+12. **Migrate `steve.js`** global functions to a namespaced module object to prevent DOM clobbering.
+13. **Add X-Content-Type-Options: nosniff** globally via middleware for all responses.
+14. **Implement comprehensive anti-automation** including per-endpoint rate limits, minimum timing between sensitive operations, and account-level throttling.
+
\ 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