sfmc // CloudPagesPROJECT

Validate CloudPage Request Parameters Before Writes

Gate state-changing CloudPage logic behind explicit input and record validation.

cloudpagesrequestparametervalidationsecurity
Context Pack →Open Workspace →
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.

EvidencePROJECT
Difficultyintermediate
Verified2026-10-05
Use when

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
]%%
Why it works

RequestParameter reads the incoming value; explicit validation prevents missing/malformed context from falling directly into a write path.

Operational notes

For sensitive operations, also verify that the referenced record/workflow is valid before UpsertData/UpdateData.

Sources / verification