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:08:58 UTC

(tooling-agents) branch main updated: ASVS audit: 6.3.8.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 f411e2f  ASVS audit: 6.3.8.md (redacted)
f411e2f is described below

commit f411e2f62f95230b85d378cdda7a48de9f586428
Author: ASF Tooling Team <ro...@apache.org>
AuthorDate: Tue May 5 14:08:46 2026 +0200

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

diff --git a/ASVS/reports/steve/v3/d0aa7e9/all/6.3.8.md b/ASVS/reports/steve/v3/d0aa7e9/all/6.3.8.md
new file mode 100644
index 0000000..ae26cda
--- /dev/null
+++ b/ASVS/reports/steve/v3/d0aa7e9/all/6.3.8.md
@@ -0,0 +1,122 @@
+# Security Audit Report: ASVS 6.3.8
+
+## Executive Summary
+
+| Field | Value |
+|-------|-------|
+| **Repository** | apache/steve/v3 |
+| **Audit Date** | May 05, 2026 |
+| **Auditor** | Tooling Agents (bundled-pass mode) |
+| **ASVS Requirement** | ASVS 6.3.8 |
+| **Files Analyzed** | 10 relevant / 49 total |
+| **Files Skipped** | 12 |
+
+**Requirement description:** Verify that valid users cannot be deduced from failed authentication challenges, such as by basing on error messages, HTTP response codes, or different response times. Registration and forgot password functionality must also have this protection.
+
+### Findings Overview
+
+| Severity | Count |
+|----------|-------|
+| ๐Ÿ”ด Critical | 0 |
+| ๐ŸŸ  High | 0 |
+| ๐ŸŸก Medium | 0 |
+| ๐ŸŸข Low | 1 |
+
+---
+
+## ASVS-6.3.8: User Enumeration Prevention
+
+### Findings for 6.3.8
+
+#### [LOW] ASVS-638-LOW-001
+**Finding:** Potential User Enumeration via Timing Difference in Admin Page
+
+**File:** `v3/server/pages.py`, lines 279-316
+
+**Vulnerable Code:**
+```python
+@APP.get('/admin')
+@asfquart.auth.require({R.committer})
+@APP.use_template(TEMPLATES / 'admin.ezt')
+async def admin_page():
+    result = await basic_info()
+    ...
+    pdb = steve.persondb.PersonDB.open(DB_FNAME)
+    try:
+        me = pdb.get_person(result.uid)
+    except steve.persondb.PersonNotFound:
+        ### the authn'd committer is not in "person"
+        result = await basic_info()
+        result.title = 'Unknown Person'
+        result.pid = result.uid
+        raise_404(T_BAD_PID, result)
+```
+
+**Description:** The `/admin` page returns a 404 with a specific `T_BAD_PID` template when an authenticated committer's PID is not found in the PersonDB. While this only reveals information about the currently authenticated user (not an arbitrary PID), it creates a differentiable response between users who are in the person table vs those who are not. However, since this requires prior authentication, the practical exploitability is very low.
+
+More critically, the application's authentication pathway is handled externally by `asfquart.auth`, whose source is not provided. The actual login and registration error messages cannot be assessed from this codebase alone.
+
+**Impact:** Minimal โ€” the differentiated response requires prior authentication as a committer. This does not enable pre-authentication user enumeration.
+
+**Remediation:** Since authentication is handled externally, ensure the external authentication provider (likely Apache's identity system) provides consistent error messages for both valid and invalid usernames. For the local PersonDB check, consider returning a generic error or automatically creating the person entry.
+
+---
+
+### Security Controls Inventory for 6.3.8
+
+| Control | Location | Status |
+|---------|----------|--------|
+| Login error messages | External (`asfquart.auth`) | **Cannot assess** (not in codebase) |
+| Registration endpoint | N/A | **Not present** in this application |
+| Password reset endpoint | N/A | **Not present** in this application |
+| `raise_404()` with template | pages.py line 647 | Returns HTML 404 (same HTTP code) |
+| Voter eligibility check | `vote_on_page()` line 236 | Returns 404 if ineligible (consistent with not-found) |
+
+### Positive Patterns for 6.3.8
+
+- The `load_election` decorator returns a consistent 404 for unknown election IDs, preventing election ID enumeration.
+- The `serve_doc()` endpoint returns a generic 404 whether the user is ineligible or the document doesn't exist (line 569-571), preventing information leakage about document existence.
+- The voter eligibility check in `vote_on_page()` reuses the same `T_BAD_EID` template (line 242), making ineligible voters indistinguishable from invalid election IDs.
+- Election IDs and Issue IDs use 10 hex character random identifiers (`crypto.create_id()`), making enumeration impractical.
+
+---
+
+
+
+## Cross-cutting Architecture Observations
+
+1. **Authentication is externalized:** The actual login flow, credential verification, and session establishment are handled by `asfquart.auth` (not included in this codebase). Many ASVS 6.3 requirements would need to be assessed against that external system. The audited code only handles post-authentication authorization.
+
+2. **Authorization is the critical gap:** The most severe finding is the systematic failure to implement ownership-based authorization (Type B gap โ€” control is intended but never implemented). This spans all management endpoints and creates a flat permission model where any committer can modify any election.
+
+3. **Separation of concerns:** The application cleanly separates:
+   - Authentication (external, via `asfquart.auth`)
+   - Session management (via `asfquart.session`)
+   - Business logic (via `steve.election.Election`)
+   - Cryptographic vote privacy (via `steve.crypto`)
+   
+   However, the authorization layer between authentication and business logic is entirely missing.
+
+4. **Security-conscious cryptographic design:** The election system has sophisticated anti-tamper mechanisms (`is_tampered()`), vote encryption, and privacy-preserving tallying. This contrasts sharply with the weak authentication/authorization controls.
+
+5. **TODO.md as documentation:** The application's own TODO file acknowledges CSRF and authorization gaps, confirming these are known issues awaiting resolution rather than oversights.
+
+---
+
+## Cross-cutting Recommendations
+
+### Immediate (Critical Risk)
+1. **Implement authorization checks** at all `### check authz` locations. Verify election ownership (`md.owner_pid == current_uid`) or group membership (`user in md.authz group`) before allowing management operations.
+2. **Enforce MFA** via the external authentication provider or add an application-level MFA step after initial authentication.
+
+### Short-term (High Risk)
+3. **Implement CSRF protection** โ€” replace the placeholder token with real per-session cryptographic tokens and validate on all state-changing endpoints.
+4. **Change GET to POST** for state-changing operations (`/do-open/<eid>`, `/do-close/<eid>`) to prevent CSRF via simple link injection.
+5. **Add audit logging** for person record changes and authentication events.
+
+### Long-term (Medium Risk)
+6. **Implement suspicious login detection** โ€” track login metadata (IP, user agent, timestamp) and notify users of anomalies.
+7. **Add credential change notifications** โ€” send email alerts when person records are modified.
+8. **Document all authentication pathways** formally, including the external auth provider's capabilities, MFA support, and integration points.
+9. **Implement rate limiting** on authentication-related endpoints to prevent brute-force attacks (per NIST SP 800-63B ยง 5.2.2).
+        
\ 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