User-controlled data in ServiceCallout

Severity
High
Applies to
Step
Links
CWE-233 CWE-20

Why This Issue Is Important

When dealing with user-controlled data in a ServiceCallout policy within an Apigee proxy, it is crucial to ensure that this data is properly validated before it is used. User-controlled data can be manipulated by an attacker to introduce harmful content or alter the behavior of the application in unexpected ways. This issue is particularly dangerous in ServiceCallout policies, where the user-controlled data is sent to an external service, as it can lead to security vulnerabilities such as injection attacks, data leaks, or denial of service.

How This Issue Is Detected

CodeSent identifies this issue by examining the flow of data within the proxy. Specifically, it looks for scenarios where user-controlled variables are used directly in the content of a ServiceCallout request without adequate validation or sanitization. The tool traces the flow of these variables to determine whether they originate from user inputs and whether they are directly used in the ServiceCallout.

How to Fix the Issue

To fix this issue, you should ensure that any user-controlled data used in a ServiceCallout request is validated or sanitized before being sent. This involves applying input validation, encoding, or filtering to remove any potentially harmful content.