Always escape or sanitize user‐provided content before displaying it in HTML. Use functions like htmlspecialchars() to convert special characters into HTML entities.
security-hardeningstack-php
High
force_ssl and parameter filtering
Enable config.force_ssl = true; add filter_parameters to redact PII and secrets; use secure_same_site for cookies.
compliance-soc2-essentialssecurity-hardening+1
High
Gate CHD token access with explicit PCI roles
Any code path that reads, decrypts, or exchanges PAN tokens must require an explicit authorization policy (e.g., role "pci:read_token") and log access without PAN. Deny by default. (PCI DSS 4.0 Req. 7 & 10)
compliance-pci-dsssecurity-hardening+1
High
Harden session management with idle and absolute timeouts
Set session idle timeout ≤ 15 minutes and absolute timeout ≤ 12 hours; cookies must be Secure, HttpOnly, and SameSite=Lax or Strict; revoke sessions on password change.
compliance-soc2-essentialssecurity-hardening+1
High
Implement multi-stage builds for production
Use a builder stage for toolchains/dev deps and a minimal runtime stage that contains only runtime artifacts.
container-docker-hygienesecurity-hardening
High
Implement RBAC with least privilege and deny-by-default
Authorize every request by role and resource scope. Policies must default-deny and require explicit allow; privileged roles (admin, auditor) must be rare and reviewed quarterly.
compliance-soc2-essentialssecurity-hardening+1
High
International transfers: enforce region allow-list for PII
Before sending PII to processors, verify the destination region is approved (e.g., BR/EEA with SCC/DPA). Block requests that include personal data and target non-approved regions.
compliance-lgpdsecurity-hardening+1
High
Load PHI-related secrets from a secret manager, never from code
Access tokens, HMAC salts, and KMS keys for PHI flows must come from a secret manager or encrypted credentials store; forbid committing secrets or .env files to the repo.
compliance-hipaasecrets-credentials+2
High
Middleware only for light auth/rewrites
Keep middleware fast and side-effect free (no DB writes). Narrow the matcher and skip static assets. Use Route Handlers for heavy logic.
stack-nextjsstack-react+2
High
mTLS for internal service-to-service traffic
Configure Spring Boot to require client certificates for internal APIs (clientAuth=REQUIRE) and restrict CAs; log peer certificate subject in audit events.
compliance-soc2-essentialssecurity-hardening+1
High
Never expose secrets to the client
Read secrets (process.env.*) only in Server Components, Route Handlers, or server actions. Client Components must use ONLY NEXT_PUBLIC_* variables.
stack-nextjsstack-react+3
High
Pin container images by digest in Helm/K8s
Use immutable image digests (repo@sha256:...) instead of mutable tags for production workloads.
infra-as-codedependency-supply-chain+1
High
Portable DSAR export with signed URL and TTL
Provide an authenticated endpoint that assembles a user's data into a structured JSON export and returns a short-lived signed URL (≤24h). Include integration tests in the PR. (GDPR Art. 20)
compliance-gdprapi-conventions+2
High
Prevent Memory Allocation Vulnerabilities
Check if memory allocation sizes are derived from untrusted input. Attackers may exploit this to crash the program or consume excessive resources. Recommend validating and limiting allocation sizes.
security-hardeningstack-python
High
Prevent Reflection Injection Attacks
Reflection methods that process untrusted input can be exploited for remote code execution. Always validate and sanitize external input before using reflection.
security-hardening
High
Prevent Server-Side Request Forgery (SSRF)
Ensure that server-side requests are properly validated to prevent SSRF attacks.
security-hardening
High
Protect backups/exports of ePHI with KMS and restricted buckets
Write ePHI backups to storage with server-side encryption (SSE-KMS) and least-privilege access; disallow public ACLs and cross-account access without a BAA. Record the KMS key id in metadata.
compliance-hipaasecurity-hardening+2
High
Protect Critical Forms with CSRF Tokens
Implement anti‐CSRF tokens in forms performing sensitive actions (like state changes or deletions). Generate a unique token per session or request and validate it on the server before processing the form action.
security-hardeningstack-php
High
Read headers/cookies only on the server
Use headers() and cookies() in Server Components, Route Handlers, or server actions; never in Client Components.
stack-nextjsstack-react+2
High
Redact PII in logs and metrics by default
Logging/metrics must redact or hash personal data; attach lawful_basis and purpose to diagnostic context; forbid raw PII in logs. (GDPR Art. 5(1)(c) data minimization)
compliance-gdprobservability-logging+1
High
Require a plan artifact and policy checks in CI
CI must run fmt/validate, produce and upload a plan artifact (e.g., terraform plan -out plan.bin), run policy-as-code (e.g., tfsec/checkov/conftest), and gate apply on manual approval for prod.
infra-as-codeci-cd-build-hygiene+1
High
Require HTTPS and HSTS with Data Protection keys
Use app.UseHsts(); app.UseHttpsRedirection(); store DataProtection keys in Azure Key Vault or KMS with rotation.
compliance-soc2-essentialssecurity-hardening+1
High
Require MFA for admin actions touching ePHI
Endpoints under /admin or privileged routes that can view or export ePHI must enforce multi-factor authentication and recent re-auth (e.g., within 15 minutes).
compliance-hipaasecurity-hardening+1
High
Require step-up MFA for privileged operations
Actions like role changes, key rotations, and exports of PII require MFA re-authentication within the last 5 minutes; record mfa_verified_at in the audit log.