You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update: The below (stricken) finding was deemed to be compliant with ASVS 3.0.1, Requirement 5.10, but a true positive finding.
Related to #1724. We should consider strengthening validation of our search endpoint, by either explicitly specifying an acceptable Marshmallow schema or by constraining the accepted query to an allow-list of fields, operators, and query types.
To ensure compliance with ASVS 3.0.1 per contract requirements, we should implement the below requirement.
> Verify that all SQL queries, HQL, OSQL, NOSQL and stored procedures, calling of stored procedures are protected by the use of prepared statements or query parameterization, and thus not susceptible to SQL injection.
Note: The Finding and Proposed change sections below are mostly Claude-generated with manual human review for false positives. Ultimately, we are bound by the text of the requirement above.
Finding:
> The provider search endpoint accepts a raw, caller-supplied OpenSearch DSL query body rather than a parameterized query: SearchProvidersRequestSchema.query is a marshmallow Raw field (lambdas/python/common/cc_common/data_model/schema/provider/api.py:507) passed through to OpenSearch unchanged (lambdas/python/search/handlers/search.py:437-439). Staff control the entire query structure. This is well-mitigated — per-compact index isolation, a validate_no_cross_index_queries check, the domain setting rest.action.multi.allow_explicit_index: false, and response-sanitization schemas — but the unbounded DSL still allows expensive/abusive queries (query-cost DoS) and is a wide input surface that is not parameterized. Related: #1724 (a dateOfBirth scope-gate bypass via the same raw-DSL pattern in the social-work/cosmetology apps; that specific gate does not exist in compact-connect, but the raw-DSL passthrough does).
Proposed change:
> Constrain the accepted query to a parameterized allow-list of fields, operators, and query types rather than passing raw OpenSearch DSL, or wrap it with query-cost limits and depth/clause caps. Treat DSL fields as data, not structure.
We can add a simple allowlist of terms based on the terms we know are used by the frontend today, and reject any request that attempts to use a term not included in that list. I've added an estimate to this ticket to reflect that effort.
Activity
jlkravitz commentedon Jul 14, 2026
I am not opposed to moving away from passing raw OpenSearch DSL, but this seems like a bigger lift than is worthwhile.
[-]ASVS 3.0.1, Requirement 5.10[/-][+]Strengthen search endpoint validation[/+]landonshumway-ia commentedon Jul 23, 2026
We can add a simple allowlist of terms based on the terms we know are used by the frontend today, and reject any request that attempts to use a term not included in that list. I've added an estimate to this ticket to reflect that effort.
[Social Work] - Support public searching by CUID and license type (#1805