T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:60
- Finding
- Unauthenticated Access to Sensitive Farm Financial and Operational Data## Vulnerability Details **File Location**: `SKILL.md`, lines 60–94 **Vulnerability Type**: Missing authentication and authorization on sensitive API endpoints **Risk Level**: High ### Vulnerable Code ```markdown ## Integration Endpoints (No Auth — for cross-module data) These provide summary data without authentication. Use for quick lookups and cron jobs. ### Dashboard Summary GET /api/integration/dashboard Returns: Contract counts, bushels sold, delivery schedule stats, recent settlements. ### Revenue Summary GET /api/integration/revenue?crop_year=2025&entity_id=1 Returns: Revenue by crop (corn/soybeans), by month, contracted vs projected. Use for cash flow analysis. ### Entities GET /api/integration/entities Returns: All farm entities with id, name, type, short_code. Use to map entity names to IDs. ### Fields with Ownership GET /api/integration/fields?entity_id=1 Returns: Fields with acres, entity ownership shares. ### Acres Summary GET /api/integration/acres-summary Returns: Total acres by entity with field counts and ownership shares. ### Settlements by Month GET /api/integration/settlements-by-month?crop_year=2025&entity_id=1 Returns: Monthly settlement amounts for cash flow timing. ### Crop Years GET /api/integration/crop-years Returns: Available crop years with current year flag. ``` ### Technical Analysis The skill explicitly identifies these integration endpoints as requiring no authentication. The exposed information includes contract counts, sold quantities, delivery schedules, recent settlements, revenue projections, entity identities, field ownership, acreage, and settlement timing. This conflicts with the skill's stated access model, under which marketing information requires a manager or administrator role. Because no caller identity or role is verified, any party with network access to the API can retrieve data that would otherwise be protected by role-b ...[truncated 1973 chars]
- Remediation
- ## Remediation Suggestions 1. Require authenticated requests for every endpoint that returns marketing, settlement, revenue, ownership, acreage, or delivery information. 2. Enforce manager-level authorization server-side rather than relying on the skill to check a local role mapping. 3. Apply object-level authorization to `entity_id` parameters so callers can access only authorized entities. 4. Replace anonymous cron access with dedicated service accounts or short-lived, narrowly scoped machine tokens. 5. If anonymous summaries are operationally required, expose only coarse, non-sensitive aggregates and suppress entity identifiers, revenue, settlements, ownership, and delivery details. 6. Add rate limiting, access logging, anomaly detection, and alerts for sequential entity or crop-year enumeration. 7. Review historical access logs to determine whether the anonymous endpoints have already been queried unexpectedly. 8. Add automated authorization tests that verify anonymous users receive `401 Unauthorized` and insufficiently privileged users receive `403 Forbidden`.
