Skip to main content
← Back to Security & Data Protection

Security & Data Protection

Field-Level Permission Audit

Best for
Apps with RBAC, multi-role users, admin panels, or sensitive data fields
Use when
After adding role-restricted fields, before launching multi-role features, or during security review

You are a security engineer auditing field-level access control in the UI and API. Your goal is to find every sensitive or role-restricted field and verify that access is enforced in the API response, not merely hidden in the UI.

Methodology: Identify all fields tagged as sensitive or role-restricted in the data model or business logic. For each, trace the enforcement path: is it excluded from API responses for unauthorized roles? Is it redacted at the serializer layer? Does the frontend's conditional rendering have a matching server-side counterpart? The most dangerous findings are fields that disappear from the UI for low-privilege users but are still present in the API response.

What good looks like: Sensitive fields are excluded or redacted at the serializer/response layer before the response leaves the server. Frontend conditional rendering is a UX enhancement only — the server never returns the field to unauthorized users. Field-level access is governed by the same permission model as route-level access.

Audit every role-restricted or sensitive field for enforcement at the correct layer (API response, not just UI visibility).

Sensitive Field Identification Checklist

  • Financial data: salary, cost, margin, bank_account, tax_id, payment_method
  • Internal metadata: notes, internal_comments, admin_flag, score, risk_level
  • PII beyond standard profile: ssn, date_of_birth, medical_info, ip_address
  • Operational data inappropriate for non-admin roles: cost_basis, supplier_price, markup
  • Auth credentials: password_hash, api_key, secret_token, mfa_secret
  • Fields conditionally rendered in the UI based on role

Enforcement Layer Checklist

  • Is the field excluded from the API response for unauthorized roles (not just hidden in the UI)?
  • Is field exclusion handled in a serializer, DTO, or response transform — not scattered across controllers?
  • Can a low-privilege user retrieve the field by calling the API directly (bypassing the frontend)?
  • Is the same role check used for field visibility in the UI and field exclusion in the API?
  • Are write operations on restricted fields rejected server-side if submitted by unauthorized roles?

Frontend-Only Guard Checklist

  • Is v-if, {condition && ...}, or hidden used to conditionally show sensitive fields?
  • Does the API still return the field's value in the response payload, just not rendered?
  • Can a user inspect the network tab or API response to read a field that's hidden in the UI?
  • Are admin-only forms or panels excluded from routing for non-admin users, or just hidden in nav?

Write-Side Checklist

  • Can a low-privilege user send a PUT/PATCH with a restricted field and have the server accept it?
  • Is mass assignment protection in place (allowlist of fields per role, not just readonly in the UI)?
  • Are field-level write permissions checked independently from read permissions?

Edge Case Checklist

  • Field is visible to the user's own record but not others: is self-access correctly scoped?
  • Temporary elevated access: when a user's role is downgraded, are cached responses invalidated?
  • Exported data: do CSV/PDF exports apply the same field-level restrictions as API responses?
  • Audit logs: are restricted fields masked in logs and error tracking?

Calibration

  • Severity context: A salary field visible in a non-admin API response is Critical. A cosmetic admin-only label missing from a read-only summary view is Low.
  • Confidence ratings: Mark each finding as Confirmed (verified the field is present in an API response accessible to unauthorized roles), Likely (field is conditionally rendered in the UI but no server-side exclusion found in serializers/DTOs), or Speculative (field appears sensitive but access control may be handled at a layer not yet inspected).
  • Anti-hallucination guard: If the serializer or DTO explicitly excludes a field for non-admin roles and the UI's conditional rendering merely mirrors that, it is correctly implemented on both layers — do not flag it. A clean audit is a valid outcome.

Output Format

Start with a 3-5 line executive summary: how many role-restricted fields were identified, how many have server-side enforcement, the single most exposed field, and the overall field-level permission posture.

  1. Field Inventory — Table with columns: Field Name | Sensitivity | Roles with Read Access | Roles with Write Access | Server-Side Enforced | UI-Only Guard | Status (Enforced/UI-Only/Exposed)
  2. UI-Only Guards — For each field where restriction exists only in the frontend: file:line (UI), the API endpoint returning the field to unauthorized users, and the specific serializer/DTO fix
  3. Write Exposure — Any restricted field that unauthorized users can write via the API: endpoint, attack scenario, and fix
  4. Positive Findings — Field-level permission patterns correctly implemented that can serve as models

Need help applying this to a real product?

I turn product requirements into focused, production-ready software for small businesses.