Skip to content

SQL injection vulnerability #2

@aaronjoslyn

Description

@aaronjoslyn

It looks like the following is vulnerable to SQL injection. It ought to be solved by whitelisting against the model's parameters, and also escaping the inputs.

query = resource.where(permitted_params).where(fuzzy_search_field, fuzzy_search_query).order(order_params).paginate(pagination_params)

def fuzzy_search_field
"#{params["search_field"]} #{GeneralizedApi::DATABASE_LIKE} ?"
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions