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:00:53 UTC
(tooling-agents) branch main updated: ASVS audit: 1.3.6.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 622a807 ASVS audit: 1.3.6.md (redacted)
622a807 is described below
commit 622a807aea47af1d610fef633947dfbceda6a520
Author: ASF Tooling Team <ro...@apache.org>
AuthorDate: Tue May 5 14:00:40 2026 +0200
ASVS audit: 1.3.6.md (redacted)
---
ASVS/reports/steve/v3/d0aa7e9/all/1.3.6.md | 89 ++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/ASVS/reports/steve/v3/d0aa7e9/all/1.3.6.md b/ASVS/reports/steve/v3/d0aa7e9/all/1.3.6.md
new file mode 100644
index 0000000..ec930ab
--- /dev/null
+++ b/ASVS/reports/steve/v3/d0aa7e9/all/1.3.6.md
@@ -0,0 +1,89 @@
+# Security Audit Report: ASVS 1.3.6
+
+## Executive Summary
+
+| Field | Value |
+|-------|-------|
+| **Repository** | apache/steve/v3 |
+| **Audit Date** | May 05, 2026 |
+| **Auditor** | Tooling Agents (bundled-pass mode) |
+| **ASVS Requirement** | ASVS 1.3.6 |
+| **Files Analyzed** | 5 relevant / 49 total |
+| **Files Skipped** | 12 |
+
+**Requirement description:** Verify that the application protects against Server-side Request Forgery (SSRF) attacks, by validating untrusted data against an allowlist of protocols, domains, paths and ports and sanitizing potentially dangerous characters before using the data to call another service.
+
+### Findings Overview
+
+| Severity | Count |
+|----------|-------|
+| 🔴 Critical | 0 |
+| 🟠High | 0 |
+| 🟡 Medium | 0 |
+| 🟢 Low | 0 |
+
+---
+
+## ASVS-1.3.6: SSRF Protection
+
+### Findings for 1.3.6
+
+No findings detected.
+
+After thorough analysis of the codebase, no server-side request forgery vectors were identified:
+- No outbound HTTP client calls (no `requests`, `urllib`, `aiohttp`, or similar)
+- No user-controlled URLs used in server-side fetches
+- Database queries use local SQLite only
+- File operations are limited to local filesystem with `send_from_directory`
+- The `doc:filename` pattern in `rewrite_description` creates client-side `<a href>` links, not server-side requests
+
+### Security Controls Inventory for 1.3.6
+
+No applicable controls in this scope. The application does not make outbound HTTP requests based on user input.
+
+### Positive Patterns for 1.3.6
+
+- The application architecture does not include any server-side HTTP client functionality, eliminating SSRF attack surface entirely.
+- Document references (`doc:filename`) are translated to client-side hyperlinks rather than server-side file fetches.
+
+---
+
+
+
+## Cross-cutting Architecture Observations
+
+1. **Output Encoding Inconsistency (Type B Gap Pattern):** The EZT templating system provides the `[format "js,html"]` encoding directive, and developers correctly apply it in JavaScript contexts. However, the same data (issue titles, descriptions, election titles) is rendered WITHOUT encoding in HTML body contexts. This represents a systematic Type B gap where the control exists but is not consistently applied.
+
+2. **No Input Sanitization Layer:** The application has no centralized input sanitization for user-supplied content. Issue titles, descriptions, and election titles flow directly from form input to database storage to template rendering without any intermediate sanitization step.
+
+3. **Defense-in-Depth Absence:** The application relies solely on authentication (`@asfquart.auth.require`) for security. There is no:
+ - Content Security Policy (CSP) headers
+ - Input sanitization middleware
+ - Output encoding applied by default
+ - CSRF token validation (acknowledged as placeholder)
+
+4. **Privileged User Attack Surface:** While all endpoints require authentication (committer or PMC member), the stored XSS vulnerabilities mean any compromised or malicious insider can attack all other users of the system. In an election/voting context, this is particularly severe as it could undermine election integrity.
+
+5. **Template Engine Choice:** EZT does not auto-escape by default (unlike Jinja2's `autoescape=True`). This architectural choice places the burden on developers to manually encode every output point, which has demonstrably led to gaps.
+
+---
+
+## Cross-cutting Recommendations
+
+### Immediate (address before next deployment)
+1. **Apply `[format "html"]` to ALL user-derived template variables** in HTML contexts — at minimum: `[issues.title]`, `[issues.description]`, `[e_title]`, `[flashes.message]`.
+2. **HTML-escape content in `rewrite_description()`** before wrapping in `<pre>` tags and before constructing `<a>` attributes.
+3. **Sanitize flash messages** — escape `form.title` and similar user input before interpolating into flash strings.
+
+### Short-term (within next sprint)
+4. **Implement a Content Security Policy** header (`script-src 'self'`) to mitigate XSS impact even if encoding is missed.
+5. **Add `X-Content-Type-Options: nosniff`** to document responses from `serve_doc()` to prevent MIME-type sniffing of uploaded files.
+6. **Restrict served document types** in `serve_doc()` to a whitelist of safe extensions (PDF, TXT, PNG, etc.), blocking SVG and HTML.
+7. **Implement input sanitization** for issue descriptions — either use a library like `bleach` to allow safe HTML subset, or store as plain text and render encoded.
+
+### Long-term (architectural improvements)
+8. **Migrate from EZT to a template engine with auto-escaping** (e.g., Jinja2 with `autoescape=True`). This eliminates the class of bugs where developers forget to encode.
+9. **Implement a centralized input validation/sanitization layer** as middleware that processes all form submissions before they reach handlers.
+10. **Implement real CSRF protection** — the placeholder token provides zero security and creates false confidence (Type B gap at the architecture level).
+11. **Add security-focused integration tests** that attempt XSS payloads through each input field and verify they are neutralized in rendered output.
+
\ 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