Detect CSP misconfiguration before merge.

See how CSP misconfiguration fits local review, which evidence Code Radar produces, where coverage ends, and how trusted findings move into CI.

radar scan . --quick

What CSP misconfiguration means here.

The CSP misconfiguration rule identifies review patterns that can create exploitable behavior or hide material maintenance risk, then returns the affected location, severity, confidence, and remediation context.

Evidence to inspect

Use “Detect CSP misconfiguration before merge.” as the scope for this decision: verify the input, finding detail, workflow handoff, and product boundary before you install or buy.

CriterionEvidence to inspectBoundary
Input scopeSelected files, configuration, scan mode, and enabled rules.Only included paths and configured checks are evaluated.
Finding detailFile, line, rule ID, severity, explanation, and repair direction.Illustrative output is not a result from your repository.
Workflow handoffLocal result, report format, agent context, and optional CI signal.Enable exports or CI only when the workflow needs them.
Decision fitUse the same criteria on a real repository before choosing a plan or tool.No universal winner or guaranteed outcome is claimed.

Check this risk locally

Coverage and concrete signals

Detect permissive script policies that weaken browser-side containment.

  • Audience: Developers and reviewers deciding how to handle CSP misconfiguration findings before merge.
  • Evidence to inspect before you trust the result.: Record each directive and script source, then verify that the safer policy preserves required application behavior without broad script execution.
  • Boundary: Legacy inline scripts or third-party assets may explain a permissive policy, but document the nonce or hash plan and test violations before suppressing.
  • Rule ID: RADAR-SEC-CSP

Risky pattern / Safer pattern

CSP misconfiguration: A useful result must be explainable to a developer and portable to the next review surface. Inspect the concrete evidence below before changing team policy.

Risky patternSafer pattern
default-src * 'unsafe-inline'default-src 'self'; script-src 'self'

From local signal to shared gate.

CSP misconfiguration: Use the smallest workflow that proves value. Each later step should reuse evidence the team already understands. Record each directive and script source, then verify that the safer policy preserves required application behavior without broad script execution.

StepCommand or actionDecision
1Run a quick local scanIs the signal useful?
2Inspect and repair findingsIs the fix specific and reproducible?
3Export portable evidenceDoes the reviewer need SARIF, JSON, or HTML?
4Promote the trusted threshold to CIWhich severity should block a pull request?
radar scan . --quick
radar scan . --format sarif --fail-on high

Validate the workflow on your own code.

Apply this page’s evidence to one real repository. For “Detect CSP misconfiguration before merge.”, confirm which finding is produced, whether the proposed next step is reproducible, and where local scanning, reports, agents, or CI should stop or expand.