sfmc // CloudPagesPROJECT
Validate CloudPage Request Parameters Before Writes
Gate state-changing CloudPage logic behind explicit input and record validation.
cloudpagesrequestparametervalidationsecurity
Trust & provenancePROJECT
Evidence tierPROJECTOfficial sources1Other sources0Last verified2026-10-05
Evidence tier describes my hands-on relationship with the content. Official sources describe platform contracts/documentation. Production observations should not automatically be treated as official limits.
A CloudPage updates preferences, profile data or workflow state.
%%[
VAR @subscriberKey, @action
SET @subscriberKey = RequestParameter("subscriberKey")
SET @action = RequestParameter("action")
IF Empty(@subscriberKey) OR Empty(@action) THEN
RaiseError("Missing required context", false)
ENDIF
IF NOT (@action == "optin" OR @action == "optout") THEN
RaiseError("Invalid action", false)
ENDIF
]%%RequestParameter reads the incoming value; explicit validation prevents missing/malformed context from falling directly into a write path.
For sensitive operations, also verify that the referenced record/workflow is valid before UpsertData/UpdateData.