BETA Shoulder is in beta — Findings may sometimes be wrong. Your feedback shapes what we fix next. Share feedback
🔒

Incorrect Permission Assignment for Critical Resource

🛡️ 2 rules detect this

Incorrect Permission Assignment for Critical Resource

The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.

When a resource is given permissions that are more open than necessary, unintended actors can access or modify that resource. This is especially critical for configuration files, executables, and data files.

Prevalence
High
Frequently exploited
Impact
Medium
Review recommended
Prevention
Documented
2 fix examples
2 Prevention
2 Prevention

How to fix this vulnerability

Service Account Token Auto-Mounted LOW

Disable automatic service account token mounting when API access is not needed

+1 -0 yaml
  apiVersion: v1
  kind: Pod
  spec:
+   automountServiceAccountToken: false
    containers:
    - name: app
      image: nginx:1.25
  
Writable Root Filesystem MEDIUM

Enable read-only root filesystem and use emptyDir volumes for writable paths

+8 -2 yaml
  apiVersion: v1
  kind: Pod
  spec:
    containers:
    - name: app
      image: nginx:1.25
-     ports:
-       - containerPort: 80
+     securityContext:
+       readOnlyRootFilesystem: true
+     volumeMounts:
+     - name: tmp
+       mountPath: /tmp
+   volumes:
+   - name: tmp
+     emptyDir: {}
  
3 Detection
3 Detection

Find vulnerabilities in your code

Use Shoulder to scan your codebase for Incorrect Permission Assignment for Critical Resource patterns. 2 rules.

terminal
# Scan with Shoulder CLI
npx @shoulderdev/cli trust --cwe=732

# Or scan entire project
npx @shoulderdev/cli trust .
4 Warning Signs
4 Warning Signs

What to watch for in code reviews

These patterns indicate potential Incorrect Permission Assignment for Critical Resource vulnerabilities. Look for these during code reviews and security audits.

🟡
Container allows writes to the root filesystem. kubernetes-writable-root-filesystem
🟡
containers that allow writes to the root filesystem kubernetes-writable-root-filesystem
🔵
Service account token is automatically mounted into the pod. kubernetes-automount-service-account
🔵
pods with service account token auto-mounting enabled kubernetes-automount-service-account
🔍

Scan your codebase for Incorrect Permission Assignment for Critical Resource

Shoulder CLI finds vulnerable patterns across your entire codebase.