Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Parameterized Search Query (prevent SOQL Injection) #179

@sughodke

Description

@sughodke

Salesforce has a REST API to search for a resource using parameterized variables, parameterizedSearch.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized.htm

This would really help in safeguarding against injection attacks -- as in this contrived example below. Where route.id could be written in a malicious way.

    // Perform another account query
    let accountRecordUpdated = await query(
      `SELECT Id, Name, SLA__c FROM Account WHERE Id = '${route.id}'`,
      oauth
    )

Alternatively, SOQL seems to have "bind variables" for static queries. See https://trailhead.salesforce.com/en/content/learn/modules/secdev_injection_vulnerabilities/secdev_inject_prevent_soql_injection?trail_id=security_developer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions