75 KiB
Configuration and trust boundaries: find, fix and verify
English | Русский
Catalog · Scanner · Patch verification
64 sections. Each follows Search → Vulnerable example → Fix → Verification.
Run rg from a local service checkout; searches only read files. Derive the actor/owner from a verified session, not request data. Adapt examples to the actual API and contract.
Contents
- CFG-SECRET — Literal secret or default key
- CFG-DEBUG — Debug enabled in configuration
- CFG-CORS — Broad CORS policy
- CFG-DOCKER-PRIV — Privileged container
- CFG-DOCKER-SOCKET — Docker socket exposed to a service
- CFG-DOCKER-ROOT — Explicit Docker USER root
- CFG-WORLD-WRITE — Broad write permissions
- CFG-NGINX-LIST — nginx directory listing
- CFG-NGINX-ALIAS — Review nginx alias boundaries
- CFG-POSTGRES-TRUST — PostgreSQL trust
- CFG-REDIS-PROTECTION — Redis protected-mode disabled
- TPL-RAW — Unescaped template output
- SRC-MIXED-IDENTIFIER — Mixed Latin/Cyrillic/Greek identifier
- SRC-BIDI-CONTROL — Bidirectional text control in source
- CFG-REDIS-ACL — Redis ACL user without a password
- CFG-MONGO-NOAUTH — MongoDB authorization disabled
- CFG-CAPABILITIES — Broad container capabilities
- CFG-BUILD-SECRET — Secret in Dockerfile ARG/ENV
- CFG-NGINX-AUTH-OFF — Nested nginx location disables auth_request
- CFG-FILE-MODE — Configuration, data-directory and ACL permissions
- CFG-BIND-MOUNT — Writable mounts expose hosts or neighboring data
- CFG-K8S-RBAC — Workload bound to cluster-admin
- CFG-NGINX-LOCATION — URI normalization and location selection
- CFG-STATIC-SECRETS — Static roots expose .git, backups, databases and logs
- CFG-COOKIE-FLAGS — Explicitly weakened session cookie flags
- CFG-TRUSTED-HEADERS — Backends trust client-supplied user, role or IP
- CFG-CACHE-AUTH — Shared HTTP caches retain personalized responses
- CFG-DEBUG-ENDPOINT — Diagnostics become public APIs
- CFG-ERROR-SECRET — Logs expose credentials or private request bodies
- CFG-RESOURCE-LIMITS — Body, decompression and multipart limits
- CFG-UPLOAD-EXEC — Uploads become executable or active content
- CFG-HTTP-PARSER — Proxy and backend disagree on framing
- CFG-CORS-CREDENTIALS — CORS reflects Origin with credentials
- CFG-RESET-TOKEN — Recovery or share tokens lack purpose or one-time use
- CFG-OBJECT-POLICY — Alternative endpoints expose an object directly
- CFG-DEPLOYED-CONFIG — Reviewing an example instead of effective configuration
- CFG-MEDIA-CONVERTER — Media documents load additional resources
- CFG-FORMAT-TRANSITION — Injection through intermediate YAML
- CFG-PRINCIPAL-CONTEXT — Clients modify authorization context
- CFG-AUTH-TOCTOU — Authorization races and identifier reuse
- CFG-CUSTOM-CRYPTO — Algebraic leakage in custom cryptography
- CFG-SHARED-BACKEND-KEY — One credential spans all child environments
- CFG-WINDOWS-NAMES — Filenames have different Windows meanings
- CFG-PROXY-REDIRECT — Reverse proxies follow redirects into trusted services
- CFG-PROTOCOL-KEY — Degenerate values in cryptographic protocols
- CFG-AGGREGATE-KEY — Incorrect public-key aggregation
- CFG-K8S-HOST — Container shares host namespaces
- CFG-UNCONFINED — seccomp/AppArmor profile disabled
- CFG-PRIV-ESCALATION — Process privilege escalation allowed
- CFG-ACTUATOR — Spring Actuator exposes every endpoint
- CFG-H2-CONSOLE — H2 web console enabled
- CFG-TLS-UPSTREAM — Proxy does not verify upstream TLS
- CFG-SSH-EMPTY-PASSWORD — SSHD permits empty passwords
- CFG-SUDO-ALL — Unrestricted passwordless sudo
- CFG-JWT-KEY-SELECTION — Untrusted kid/jku selects verification keys
- CFG-SIGNED-REQUEST — Signatures are not bound to operations or preventable replays
- CFG-RATE-LIMIT-IDENTITY — Senders choose their rate-limit identity
- CFG-TOKEN-REVOCATION — Password or role changes fail to revoke access
- CFG-FAIL-OPEN — Verification errors become permission
- CFG-LDAP-FILTER — LDAP filters or DNs built as strings
- CFG-CI-TRUST — Untrusted data and code cross CI trust boundaries
- CFG-DOCKER-TCP — Docker daemon listens on every TCP interface
- CFG-FLOATING-IMAGE — Explicit latest image tag
- TPL-AUTOESCAPE-OFF — Template block disables autoescaping
CFG-SECRET. Literal secret or default key
Search: scanner rule CFG-SECRET. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-SECRET for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
JWT_SECRET = "development"
Fix: Check active fallbacks; read secrets from private configuration. Rotate with migration/rollback for sessions and data.
JWT_SECRET = load_existing_secret()
Verification: No shared fallback remains; legitimate sessions/data stay recoverable.
A/D variant: Shared signing secret. Reference: lost_museum, RuCTF author write-up: a fixed shared JWT key. Search: Key literals, defaults and identical keys across roles/teams. Scanner: CFG-SECRET, with partial name coverage.
Patch: An independently configured secret and explicit rotation policy. Do not simply change keys and invalidate every legitimate session. Temporarily accepting an old compromised key leaves its compromise active: use safe server-side migration/reverification, not indefinite fallback. Test: Old/new sessions according to migration policy, wrong signatures, expiry and purpose; never log keys.
A/D variant: Default keys and mixed token purposes. Reference: explorers, CTF Cup config/auth/API review. Configuration contained a default jwt_key literal that environment could override. One JWT helper served different claim schemas. This calls for boundary review; it is not a reproduced authorization bypass.
Patch: Require key configuration; validate typ/purpose/audience and required fields at every receiver. A missing user_id is not a valid principal. Test: Share tokens cannot become authentication tokens or vice versa; invalid/empty subjects fail and legitimate sharing works. Scanner: CFG-SECRET for literals; purpose requires manual analysis.
source/write-up 1; source/write-up 2.
CFG-DEBUG. Debug enabled in configuration
Search: scanner rule CFG-DEBUG. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-DEBUG for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
DEBUG=true
Fix: Disable runtime debug and keep private diagnostics without secrets.
DEBUG=false
Verification: Errors expose neither console nor stack trace.
CFG-CORS. Broad CORS policy
Search: scanner rule CFG-CORS. Use --explain CFG-CORS for the exact detector contract. Legacy wildcard header/config heuristic (untyped). JS bounded tokens also detect default imported/required cors with inline origin:true and credentials:true, literal quoted keys and last-write-wins fields. Observed shadows/reassignments suppress the new hint. Computed keys, variables, wrappers, actual response policy and other languages remain manual.
Vulnerable example:
Access-Control-Allow-Origin: *
Fix: Allowlist actual origins and use Vary: Origin where needed; authentication and CSRF remain separate. A wildcard alone is not an auth bypass.
Access-Control-Allow-Origin: https://ui.example.invalid
Verification: Authorized browsers work; unrelated origins cannot read private responses.
CFG-DOCKER-PRIV. Privileged container
Search: scanner rule CFG-DOCKER-PRIV. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-DOCKER-PRIV for details. Regex: privileged:true and cap_add with SYS_ADMIN/ALL, including quoted JSON keys. CFG-CAPABILITIES covers block capabilities; inspect effective Docker/Kubernetes config.
Vulnerable example:
privileged: true
Fix: Identify minimum capabilities and change only authorized owned services, not organizer infrastructure.
privileged: false
Verification: Service/checker works without unnecessary privileges.
CFG-DOCKER-SOCKET. Docker socket exposed to a service
Search: scanner rule CFG-DOCKER-SOCKET. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-DOCKER-SOCKET for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
- /var/run/docker.sock:/var/run/docker.sock
Fix: Remove unnecessary mounts after checking dependencies/rules; never alter unrelated containers automatically.
- app-data:/srv/data
Verification: Required service and approved management operations work.
CFG-DOCKER-ROOT. Explicit Docker USER root
Search: scanner rule CFG-DOCKER-ROOT. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-DOCKER-ROOT for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
USER root
Fix: Prepare an unprivileged user and directory permissions; missing USER is not detected by this rule.
USER app
Verification: Volumes, ports, writes and restart work.
CFG-WORLD-WRITE. Broad write permissions
Search: scanner rule CFG-WORLD-WRITE. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-WORLD-WRITE for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
chmod -R 777 /srv/app
Fix: Set intended owner/group and minimum modes; do not recursively replace permissions blindly.
chmod 750 /srv/app
Verification: Service can write data; others cannot change code.
CFG-NGINX-LIST. nginx directory listing
Search: scanner rule CFG-NGINX-LIST. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-NGINX-LIST for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
autoindex on;
Fix: Disable listing unless it is required functionality.
autoindex off;
Verification: Downloads work; private directory contents are not enumerated.
CFG-NGINX-ALIAS. Review nginx alias boundaries
Search: scanner rule CFG-NGINX-ALIAS. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-NGINX-ALIAS for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
location /files { alias /srv/files/; }
Fix: Align location /files/ with alias /srv/files/; review normalization/auth. Correct aliases also trigger review.
location /files/ { root /srv; } # verify mapping and auth
Verification: Boundary URLs stay inside the root; old public URLs work.
CFG-POSTGRES-TRUST. PostgreSQL trust
Search: scanner rule CFG-POSTGRES-TRUST. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-POSTGRES-TRUST for details. Regex: POSTGRES_HOST_AUTH_METHOD=trust including JSON; pg_hba local/host/hostssl/hostnossl/hostgssenc/hostnogssenc with trust and CIDR or separate IPv4 netmask. Inspect HBA order and actual matching entries.
Vulnerable example:
POSTGRES_HOST_AUTH_METHOD: trust
Fix: Use supported auth and coordinated application credentials; do not change organizer accounts/network.
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
Verification: Application connects; unknown credentials fail.
CFG-REDIS-PROTECTION. Redis protected-mode disabled
Search: scanner rule CFG-REDIS-PROTECTION. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-REDIS-PROTECTION for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
protected-mode no
Fix: Review ACL, credentials, bind and clients against game rules without blocking required traffic.
protected-mode yes
Verification: Application connects with minimum required permissions.
TPL-RAW. Unescaped template output
Search: scanner rule TPL-RAW. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain TPL-RAW for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
{{ message | safe }}
Fix: Use normal escaped text output or a context-tested sanitizer for permitted HTML.
{{ message }}
Verification: User markup stays text and layout remains intact.
SRC-MIXED-IDENTIFIER. Mixed Latin/Cyrillic/Greek identifier
Search: scanner rule SRC-MIXED-IDENTIFIER. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain SRC-MIXED-IDENTIFIER for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
uuіd = input_value
Fix: Inspect code points/references and use distinguishable names and the validated value; never blindly rename text.
validated_uuid = parse_uuid(input_value)
Verification: Validation and consumption use the same value; invalid input fails. Strings/comments may be harmless.
A/D variant: Unicode lookalikes and unchecked identifiers. ENOWARS / replme, author and patch. A similar-looking variable letter left the original UUID unchecked; a filesystem operation used it rather than the middleware-authorized object.
Patch: Use the authorized object's ID, unambiguous variable names and filename/root checks. Test: Another query ID cannot change the authorized object; malformed UUIDs fail. Search: SRC-MIXED-IDENTIFIER; SRC-BIDI-CONTROL is an additional general check, not a claim about this service.
source/write-up 1; source/write-up 2; source/write-up 3; source/write-up 4; source/write-up 5; source/write-up 6.
SRC-BIDI-CONTROL. Bidirectional text control in source
Search: scanner rule SRC-BIDI-CONTROL. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain SRC-BIDI-CONTROL for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
# direction marker
Fix: Inspect actual Unicode/token order and remove unnecessary controls; review legitimate localization separately.
# explicit plain-text comment
Verification: Rendered and actual flow agree; copying does not restore controls.
CFG-REDIS-ACL. Redis ACL user without a password
Search: scanner rule CFG-REDIS-ACL. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-REDIS-ACL for details. Regex selects user lines, then a bounded parser reads the physical line up to 8192 characters: lowercase user, one ASCII space before a nonempty username and ordinary modifier spaces. on/off/reset and nopass/resetpass/>password/#64lowerhex are processed in order; both final flags must be explicitly true. Names, passwords and key/channel patterns are not flags. Quotes, escapes, internal tabs, selectors and unknown operations need review; long lines are partial. This is not effective ACL analysis: inspect includes/runtime, grant validity, password strength and existing connections.
Vulnerable example:
user default on nopass ~* &* +@all
Fix: First provision credentials and minimum commands/keys/channels for an app user; migrate clients and test AUTH/reconnect. Only then remove nopass or disable default. An empty > value is not a secure password.
user default off
off prevents new authentication but does not terminate already authenticated connections. Plan their treatment while preserving administration and rollback. default on nopass makes new connections already authenticated; a named user's nopass accepts any AUTH password. Redis ACL on/off behavior.
Verification: New app-user connections work before disabling default; new anonymous connections then fail. Check existing connections, namespaces, Pub/Sub and transactions.
ACL directives apply in order. off after on, resetpass after nopass, or reset changes the result; nopass after adding a password re-enables unchecked authentication. >password and a valid # followed by 64 lowercase hex characters clear nopass. Even > with an empty password clears it: disappearance of the signal does not fix authentication. ~nopass is a key pattern, not a password directive. Redis 7.2.7 ACL implementation.
The scanner parses a bounded common subset of redis.conf/aclfile lines. It tracks complete tokens/order within one line, not cross-line state or successful loading. Quotes, escaping, internal tabs and selectors need review because main-config/aclfile tokenization differs. Do not append inline comments to ACL lines: # may begin a password-hash token. Also review includes, requirepass, repeated definitions and runtime ACL SETUSER/ACL LOAD. Redis 7.2.7 config parser.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -o -e '(^[[:blank:]]*(user|aclfile|include|requirepass)[[:blank:]])|ACL[[:blank:]]+(SETUSER|LOAD|SAVE|GETUSER|LIST)' .
The command prints directive names/locations only, not credential arguments. Privately trace loaded files and every update to the selected user. An authorized administrator should inspect effective flags/commands/keys/channels with ACL GETUSER app and test a new connection with correct/incorrect credentials. GETUSER also returns hashes: never copy them/password fields into reports, logs or shell history. requirepass in one file does not prove it applies to the running process. Redis ACL GETUSER.
CFG-MONGO-NOAUTH. MongoDB authorization disabled
Search: scanner rule CFG-MONGO-NOAUTH. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-MONGO-NOAUTH for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
security:
authorization: disabled
Fix: Prepare application credentials and least-privilege roles before enabling auth on an owned service.
security:
authorization: enabled
Verification: Restart/reconnect and CRUD work; anonymous access fails. Do not alter organizer accounts.
Reference: primary source.
CFG-CAPABILITIES. Broad container capabilities
Search: scanner rule CFG-CAPABILITIES. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-CAPABILITIES for details. Regex: cap_add or capabilities.add with SYS_ADMIN/ALL in flow/block lists. capabilities.drop:[ALL] alone is not a grant. Bounded text windows are not YAML parsing; review nesting, merges/anchors and actual securityContext.
Vulnerable example:
cap_add: [SYS_ADMIN]
Fix: Remove unnecessary capabilities only on owned services; retain proven requirements and verify user/port/volume permissions.
cap_drop: [ALL]
Verification: Startup/checker and required syscalls work; do not apply this to organizer launchers.
Reference: primary source.
CFG-BUILD-SECRET. Secret in Dockerfile ARG/ENV
Search: scanner rule CFG-BUILD-SECRET. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-BUILD-SECRET for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
ARG API_TOKEN=example
Fix: Use build secret mounts instead of ARG/ENV/layers. Rotate published secrets deliberately; later deletion does not erase an earlier layer.
RUN --mount=type=secret,id=api_token build-with-secret
Verification: Build history/logs disclose no secret; runtime secrets are separate. The sample build command is a placeholder.
Reference: primary source.
CFG-NGINX-AUTH-OFF. Nested nginx location disables auth_request
Search: scanner rule CFG-NGINX-AUTH-OFF. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-NGINX-AUTH-OFF for details. Bounded textual heuristic, not a language parser or taint analysis. Comments, strings and same-named APIs can match; inspect actual execution and trust boundaries.
Vulnerable example:
location /export/ { auth_request off; }
Fix: Review location selection/inheritance and remove unintended auth bypass while preserving intended public endpoints.
location /export/ { auth_request /verify; }
Verification: Protected resources require authentication through every matching location; health/login works.
Reference: primary source.
CFG-FILE-MODE. Configuration, data-directory and ACL permissions
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'chmod|chown|umask|setfacl|mode:|permissions' .
In an authorized environment inspect ls -ld for the file and every parent; on Linux also inspect getfacl. Compare process uid/gid.
Vulnerable example:
Another local user can read secrets, or a writable parent permits replacing a protected file.
Fix: Minimal file/parent permissions, separate writable data and private temporary storage; never chmod -R 777 or break volume ownership.
Verification: The app reads required config and writes data after restart; unrelated local users gain no access.
CFG-BIND-MOUNT. Writable mounts expose hosts or neighboring data
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'volumes:|bind|source:|target:|read_only|hostPath' .
Match Compose/Kubernetes mounts to the authorized runtime inventory: host source, container destination, read/write mode and propagation.
Vulnerable example:
An unnecessary writable mount lets the application modify host code, configuration or directories.
Fix: Only necessary paths, read-only where possible and separate data volumes; preserve required runtime permissions.
Verification: Startup, writes, checker and restart work without changing code or unrelated directories.
Reference: primary source.
CFG-K8S-RBAC. Workload bound to cluster-admin
Search: scanner rule CFG-K8S-RBAC. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-K8S-RBAC for details. Regex: name:cluster-admin. Does not connect roleRef to subjects or find equivalent wildcard roles; inspect remaining RBAC manually.
Additional manual search for forms outside automatic coverage:
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'automountServiceAccountToken|serviceAccountName|ClusterRole|verbs:|resources:' .
Trace pod → serviceAccount → RoleBinding/ClusterRoleBinding; review secrets, exec and bind/escalate permissions.
Vulnerable example:
A business pod receives an administrative token despite not needing Kubernetes API access.
Fix: Use a least-privilege Role and namespaced RoleBinding; review subjects, verbs, resources, names and impersonate/bind/escalate.
Verification: Runtime identity can perform only required operations, not read foreign Secrets or grant rights.
Reference: primary source.
Scanner example before:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
Fix template:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: notes-read-config
Primary documentation: reference 1.
CFG-NGINX-LOCATION. URI normalization and location selection
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'location|alias|root|try_files|rewrite|proxy_pass' .
For the authorized configuration trace exact/prefix/regex locations and internal redirects; compare the URI the backend receives.
Vulnerable example:
Authorization checks one path while proxy/filesystem normalization or fallback selects another.
Fix: Unambiguous routes/root boundaries and authorization on the actual resource; consistent decoding policies across layers.
Verification: Slash/encoding variants, normal paths, regex locations and fallbacks never change permissions.
Reference: primary source.
CFG-STATIC-SECRETS. Static roots expose .git, backups, databases and logs
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'static|document_root|root |alias |send_from_directory|FileServer' .
Inspect the actual public root, symlinks and fallback routes; locate files with rg --files --hidden -g !.git.
Vulnerable example:
The project root serves config, backup.sql, SQLite/WAL, archives or credentials.
Fix: A separate public build directory, private storage outside it and authenticated downloads; blocking one extension is insufficient.
Verification: Assets work; hidden files, backups and outward links are never served.
Reference: primary source.
CFG-COOKIE-FLAGS. Explicitly weakened session cookie flags
Search: scanner rule CFG-COOKIE-FLAGS. Use --explain CFG-COOKIE-FLAGS for the exact detector contract. Regex with lexical exclusions: bare Django SESSION_COOKIE_HTTPONLY/SESSION_COOKIE_SECURE/CSRF_COOKIE_SECURE=false/0. Python AST: known Flask config subscript/update/from_mapping with disabled session HttpOnly/Secure. JS bounded tokens: default imported express-session with inline cookie.httpOnly:false. Dynamic configs/defaults remain manual. JS secure:false alone is not a new signal; HTTPS/checker compatibility must be reviewed.
Additional manual search for forms outside automatic coverage:
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'Set-Cookie|HttpOnly|SameSite|Secure|cookie.domain|cookie.path' .
Compare effective Set-Cookie with actual HTTP/TLS/proxy topology; Domain/Path are not authorization.
Vulnerable example:
Private cookies reach unnecessary hosts/paths, are unnecessarily accessible to JavaScript or disappear because Secure is misconfigured.
Fix: Keep session cookies HttpOnly and use Secure where the approved service transport supports HTTPS; changing Secure on an HTTP-only checker requires a coordinated transport decision.
Verification: Scripts cannot read session cookies; sessions work over the intended transport and secure cookies are not sent over plaintext.
Scanner example before:
SESSION_COOKIE_HTTPONLY = False
Fix template:
SESSION_COOKIE_HTTPONLY = True
CFG-TRUSTED-HEADERS. Backends trust client-supplied user, role or IP
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'X-User|X-Role|X-Forwarded|Forwarded|Remote-User|X-Original' .
Trace which component sets/clears headers and whether the backend is reachable around the trusted proxy.
Vulnerable example:
The application accepts client X-User as verified identity.
Fix: Application credentials or authenticated trusted peers, with forwarded identity sanitized according to topology; one secret header is not universal authentication.
Verification: Direct requests and forged headers confer no rights; legitimate proxy traffic works.
CFG-CACHE-AUTH. Shared HTTP caches retain personalized responses
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'proxy_cache|Cache-Control|Vary|Authorization|Set-Cookie|cache_key' .
Review cache keys, bypass conditions and cookie/authenticated responses; compare two users at the same URL.
Vulnerable example:
A private response cached solely by URI is returned to another session.
Fix: Never share personalized responses under a common key; contractual private/no-store or full context isolation with correct invalidation.
Verification: User A then B at the same URL, logout/role changes and normal public caching.
CFG-DEBUG-ENDPOINT. Diagnostics become public APIs
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'actuator|swagger|debug|pprof|metrics|heapdump|console|env' .
List actually registered endpoints and access policy for each; /health alone is not suspicious.
Vulnerable example:
Environment, heap dumps or configuration consoles expose secrets or application control.
Fix: Disable unnecessary diagnostics in the owned service or enforce application authorization; preserve required health/organizer monitoring.
Verification: Health/checker work; anonymous environment/dump/control access fails.
CFG-ERROR-SECRET. Logs expose credentials or private request bodies
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'logger|logging|console.log|print|Authorization|password|token' .
Find whole-request/config/exception logging, debug traces and every log destination.
Vulnerable example:
Passwords, signatures or private bodies are unnecessarily logged and exposed through endpoints/volumes.
Fix: Secret-free structured fields, redaction before serialization and minimal access/retention; preserve useful error codes.
Verification: Failed requests remain diagnosable without secret values or API stack traces.
CFG-RESOURCE-LIMITS. Body, decompression and multipart limits
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'bodyLimit|maxRequest|client_max_body_size|multipart|decompress|timeout' .
Check limits before reads, after decompression, per part and per complete message; proxy and app limits may differ.
Vulnerable example:
Small compressed input expands into a huge body, or parts/headers are unbounded.
Fix: Contractual budgets for actual bytes, parts, time and output; cleanup on failure.
Verification: Limit±1, missing Content-Length, compressed bodies, many parts and the legitimate maximum.
CFG-UPLOAD-EXEC. Uploads become executable or active content
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'upload|media|public|cgi|fastcgi|Content-Type|Content-Disposition' .
Compare storage paths, server handlers and browser MIME behavior; client filename/Content-Type does not prove type.
Vulnerable example:
An uploaded document executes server-side or opens as active HTML within the app origin.
Fix: Private nonexecutable storage, server-generated filenames, type validation and serving policy; safe download headers.
Verification: Upload/download/previews work without turning files into server code or cross-user origin scripts.
Reference: primary source.
CFG-HTTP-PARSER. Proxy and backend disagree on framing
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'Content-Length|Transfer-Encoding|http_parser|proxy_http_version|keepalive' .
Check HTTP parser versions and contradictory length/encoding handling; test only an isolated environment.
Vulnerable example:
Layers disagree about request boundaries and a following request enters another context.
Fix: Compatible patched parsers, one strict framing policy and rejection of ambiguity; do not attempt payload-regex repairs.
Verification: Normal keepalive/chunked behavior, conflicting framing and safe connection closure without mixed responses.
CFG-CORS-CREDENTIALS. CORS reflects Origin with credentials
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'Access-Control-Allow-Origin|allow_credentials|origin:|credentials:|CORS' .
Compare allowed and foreign Origin responses; browsers normally block wildcard+credentials, while arbitrary reflection is more dangerous.
Vulnerable example:
Every origin receives its own name reflected and permission to read private authenticated APIs.
Fix: Exact server-side origin allowlist, correct Vary and credential policy; CORS does not authorize nonbrowser requests.
Verification: The normal frontend works; foreign/null origins cannot read credentialed responses.
CFG-RESET-TOKEN. Recovery or share tokens lack purpose or one-time use
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'reset|recover|invite|share|token|expires|used_at' .
Trace issuance/verification and atomic consumption; compare login/share/reset audiences.
Vulnerable example:
A token for another operation or an already consumed token changes access again.
Fix: CSPRNG/signatures bound to purpose/resource/subject/expiry, with transactional one-time consumption where required; preserve legitimate sharing.
Verification: Replays/concurrent use, foreign objects/purposes, expiry and normal operation.
CFG-OBJECT-POLICY. Alternative endpoints expose an object directly
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'owner|tenant|download|export|delete|share|attachment|job' .
Trace every operation and nested path for one entity, including background jobs; unpredictable IDs are not permission.
Vulnerable example:
UI/read paths are protected, but export/download/delete look up IDs without owner checks.
Fix: One resource policy enforced for every operation, actor from verified session and explicit intended sharing.
Verification: Two users/tenants can access their own resources and never each other's through any endpoint.
Reference: primary source.
CFG-DEPLOYED-CONFIG. Reviewing an example instead of effective configuration
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'env_file|environment:|include|args:|command:|config|settings' .
Compare entrypoint, includes, overrides and effective configuration. Expanded output may contain secrets; inspect it only privately.
Vulnerable example:
A sample is fixed while runtime environment/volumes supply an unsafe override.
Fix: Change the actual source of configuration, verify precedence and restart; keep secrets out of Git.
Verification: Correct effective values survive restart; the old copy never silently returns.
CFG-MEDIA-CONVERTER. Media documents load additional resources
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'ffmpeg|magick|convert|thumbnail' .
Determine which additional files/URLs the decoder reads after receiving a document.
Vulnerable example:
Reference: bookster, RuCTF author write-up. An older FFmpeg could follow resources embedded in uploaded media while producing previews.
Search: FFmpeg, ImageMagick, PDF/SVG/XML conversion, thumbnails/previews and embedded playlists/URLs. Separate the input file from additional resources the parser fetches; HTTP-handler URL checks alone are insufficient.
Fix: Compatible patched builds, explicit allowed protocols/decoders, constrained input/output and process resources. Preserve promised formats/previews. Network firewall policy does not replace the fix.
Verification: Every allowed format, malformed files, embedded local-resource links and time/memory budgets.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-FORMAT-TRANSITION. Injection through intermediate YAML
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'yaml|unmarshal|safe_load|template' .
Trace text → template → YAML → update object; type data at each boundary.
Vulnerable example:
Reference: lost_museum, RuCTF author write-up. A template generated YAML subsequently parsed into a MongoDB mutation map.
Search: String-formatted structured documents followed by unmarshal/parse and wholesale database updates. safe_load does not prevent unwanted fields; this differs from unsafe YAML constructors.
Fix: Typed structure → serializer, then explicit update-field projection; server-derived owner/role. Clients must not control MongoDB operation structure.
Verification: Newlines, colons, nested fields and normal text change only the intended field.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-PRINCIPAL-CONTEXT. Clients modify authorization context
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'userspace|principal|currentUser|tenant' .
Trace every principal write; DSLs and request parameters must not mutate server authorization context.
Vulnerable example:
Reference: scp, RuCTF author write-up: a DSL modified userspace used for visibility control. Search: currentUser/userspace/principal/tenant assignments from expressions, parameters or intermediate state, and authorization-mode switches.
Fix: Derive the actor from a verified session and store it apart from mutable DSL state. Sensitive operations check the server-owned context.
Verification: Expressions cannot change principal; owned objects remain accessible and foreign objects hidden regardless of expression order.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-AUTH-TOCTOU. Authorization races and identifier reuse
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'owner|tenant|middleware|await|UPDATE|DELETE' .
Find waits/state changes between checking and writing; require owner/version conditions in atomic mutations.
Vulnerable example:
Reference: stalker, RuCTF author write-up. ORM authorization snapshots were taken before waiting for the request body; deletion/recreation changed identifier meaning.
Search: Middleware objects/ID lists → await/I/O → unchecked mutation, cached ORM relationships and IDs unique only within part of a composite key.
Fix: Check ownership atomically in UPDATE/DELETE/SHARE itself, using transactions/row versions as needed and stable ID uniqueness. Preserve data during schema migration.
Verification: Deterministic check → delete/recreate → mutate interleaving never changes foreign records. Also test rollback and normal concurrency.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-CUSTOM-CRYPTO. Algebraic leakage in custom cryptography
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'encrypt|decrypt|matrix|modulus|nonce' .
Write down input/output relationships and where secrets enter; review preserved algebraic relations with the protocol owner.
Vulnerable example:
Reference: solaris, RuCTF author write-up: a matrix construction preserved mathematical relations tied to a secret. Search: Custom RSA/matrix/arithmetic combinations, invariant input/output relations and insufficient randomness.
Fix: First identify the functional contract and mathematical leak. For ordinary encryption/authentication use standard library constructions with proper nonces and versioned formats. A cryptographic challenge may need an algorithm-specific repair. Never generalize challenge-specific key-size reductions into security hardening.
Verification: Normal client behavior and old data remain intact while the identified invariant disappears.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-SHARED-BACKEND-KEY. One credential spans all child environments
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'API_KEY|apikey|credential|environment|token' .
Trace shared-key distribution and backend resource/audience validation.
Vulnerable example:
ENOWARS / replme, author write-up. Compromising one child backend exposed a key trusted by the others.
Fix: Least privilege and credentials scoped to individual resources; do not rely solely on internal addresses.
Verification: Environment A's credential never authorizes actions in B.
A/D variant: Source and version: source/write-up 1; source/write-up 2; source/write-up 3; source/write-up 4; source/write-up 5; source/write-up 6.
Reference: primary source.
CFG-WINDOWS-NAMES. Filenames have different Windows meanings
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'filename|basename|glob|FindFirstFile|ToLower' .
Compare validated/database names with actual Windows lookup: case, wildcard, trailing dots/spaces and alternate streams.
Vulnerable example:
ICC / MaScroll, author write-up. Database/filesystem names disagreed on case and allowed characters.
Fix: Server-generated storage IDs, one policy for the actual operating system and separate ownership checks.
Verification: Case, wildcards/special characters and separators; old files stay accessible.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-PROXY-REDIRECT. Reverse proxies follow redirects into trusted services
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'proxy_pass|redirect|Location|logout|internal' .
Trace redirects in internal HTTP clients and repeated destination checks; internal locations alone do not authenticate backend access.
Vulnerable example:
ICC / NorthernFiles, author write-up. An open redirect combined with proxy configuration exposed an internal endpoint through a chain.
Fix: Safe redirects and an explicit proxy contract; internal token issuers must independently authorize requests.
Verification: Internal/external redirects and normal logout.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-PROTOCOL-KEY. Degenerate values in cryptographic protocols
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'public_key|pubkey|group|identity|point' .
Validate decoding, group membership and rejection of degenerate elements according to the actual protocol.
Vulnerable example:
ICC / NorthernFiles, author write-up. Type-valid input reduced key agreement to a trivial value.
Fix: Protocol-specific group-element/degenerate-state validation; use a reviewed implementation where compatible.
Verification: Neutral/invalid elements, negative cases and client interoperability.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-AGGREGATE-KEY. Incorrect public-key aggregation
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'aggregate|coefficient|pubkey|subset' .
Compare coefficients and proof-of-possession with the chosen scheme; bound set-validation cost.
Vulnerable example:
ICC / UberPendragon, author write-up. Linear coefficients failed to provide expected rogue-key protection.
Fix: A reviewed aggregation scheme; where clients cannot change, justified protocol-specific rejection of degenerate sets with bounded cost.
Verification: Ordinary groups, duplicate keys, degenerate aggregates and load.
A/D variant: Source and version: source/write-up 1.
Reference: primary source.
CFG-K8S-HOST. Container shares host namespaces
Search: scanner rule CFG-K8S-HOST. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-K8S-HOST for details. Regex: hostPID/hostIPC/hostNetwork:true and Compose pid/ipc/network_mode:host. No admission-policy or running-pod analysis.
Vulnerable example: Host-namespace access broadens the impact of workload compromise.
hostPID: true
hostIPC: true
hostNetwork: true
Fix: Disable unnecessary host namespaces; implement required connectivity within approved competition topology and verify probes/ports.
hostPID: false
hostIPC: false
hostNetwork: false
Verification: Service/checker works without host process/IPC visibility or unintended sockets.
Primary documentation: reference 1.
CFG-UNCONFINED. seccomp/AppArmor profile disabled
Search: scanner rule CFG-UNCONFINED. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-UNCONFINED for details. Regex: seccomp/apparmor=unconfined or :unconfined and Kubernetes type:Unconfined. Unrelated YAML type keys may match.
Vulnerable example: Unconfined removes a layer of syscall/access restrictions.
security_opt:
- seccomp:unconfined
- apparmor:unconfined
Fix: Restore the default or minimum compatible profile with narrow exceptions.
security_opt:
- no-new-privileges:true
# Keep the runtime default seccomp/AppArmor profiles.
Verification: Normal operations/checker work and the effective container applies the profile.
Primary documentation: reference 1.
CFG-PRIV-ESCALATION. Process privilege escalation allowed
Search: scanner rule CFG-PRIV-ESCALATION. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-PRIV-ESCALATION for details. Regex: explicit allowPrivilegeEscalation:true. Review missing fields, defaults and interactions with privileged/CAP_SYS_ADMIN.
Vulnerable example: Permitted privilege escalation preserves setuid/file-capability paths.
allowPrivilegeEscalation: true
Fix: Disable allowPrivilegeEscalation and remove privileged/CAP_SYS_ADMIN and unnecessary capabilities.
allowPrivilegeEscalation: false
Verification: Required operations work and effective securityContext matches the manifest.
Primary documentation: reference 1.
CFG-ACTUATOR. Spring Actuator exposes every endpoint
Search: scanner rule CFG-ACTUATOR. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-ACTUATOR for details. Regex: flat property or MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE with *. Inspect nested YAML and active profiles using endpoints/exposure/include.
Vulnerable example: Broad management-endpoint exposure can disclose runtime/configuration or grant control.
management.endpoints.web.exposure.include=*
Fix: Expose only necessary endpoints and restrict management access; inspect health details/custom SecurityFilterChain separately.
management.endpoints.web.exposure.include=health
Verification: Health/checker works; env, heapdump, loggers, shutdown and unnecessary endpoints require approved admin access.
Primary documentation: reference 1.
CFG-H2-CONSOLE. H2 web console enabled
Search: scanner rule CFG-H2-CONSOLE. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-H2-CONSOLE for details. Regex: spring.h2.console.enabled/SPRING_H2_CONSOLE_ENABLED=true. Inspect nested YAML, aliases and active profiles.
Vulnerable example: A database console is a separate administrative surface with its own authentication and JDBC input.
spring.h2.console.enabled=true
Fix: Disable in the runtime profile or provide protected local admin access; never remove application-wide auth/CSRF for it.
spring.h2.console.enabled=false
Verification: Database operations work; console is not exposed to the game network.
Primary documentation: reference 1.
CFG-TLS-UPSTREAM. Proxy does not verify upstream TLS
Search: scanner rule CFG-TLS-UPSTREAM. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-TLS-UPSTREAM for details. Regex: proxy_ssl_verify/grpc_ssl_verify off. Missing directives, inheritance and effective values require complete nginx config review.
Vulnerable example: Upstream HTTPS without certificate verification does not identify the intended backend.
proxy_ssl_verify off;
Fix: Enable verification, trusted CA and correct name/SNI; validate chain/intermediate depth for the actual upstream.
proxy_ssl_verify on;
proxy_ssl_trusted_certificate /etc/nginx/trusted-ca.pem;
proxy_ssl_server_name on;
proxy_ssl_name notes.internal;
Verification: Correct backend works; wrong certificate/host fails without HTTP fallback.
Primary documentation: reference 1.
CFG-SSH-EMPTY-PASSWORD. SSHD permits empty passwords
Search: scanner rule CFG-SSH-EMPTY-PASSWORD. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-SSH-EMPTY-PASSWORD for details. Regex: PermitEmptyPasswords yes. Recognizes sshd_config; include files with arbitrary names require explicit review.
Vulnerable example: When password authentication is available, an empty-password account can permit host access.
PermitEmptyPasswords yes
Fix: Disallow empty passwords; review Match/PAM/accounts while retaining a working administration channel before applying changes.
PermitEmptyPasswords no
Verification: Approved login works; empty passwords fail in every applicable Match context.
Primary documentation: reference 1.
CFG-SUDO-ALL. Unrestricted passwordless sudo
Search: scanner rule CFG-SUDO-ALL. Run from DurkaHelper: python3 -I -S scripts/defense_scan.py /path/to/service --patches; use --explain CFG-SUDO-ALL for details. Regex: NOPASSWD:ALL. Review aliases, includes, wildcard argv and dangerous allowed binaries; recognizes sudoers.
Vulnerable example: NOPASSWD:ALL turns runtime-user code execution into access to every permitted Runas target.
app ALL=(ALL:ALL) NOPASSWD: ALL
Fix: Remove runtime sudo; move rare privileged operations into a minimal helper without arbitrary argv, shell or writable dependencies.
# Runtime user has no sudo grant.
# Provision required resources before service startup.
Verification: Service works without sudo; effective rights contain neither ALL nor shell-escaping commands.
Primary documentation: reference 1.
CFG-JWT-KEY-SELECTION. Untrusted kid/jku selects verification keys
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'kid|jku|x5u|jwks|JWK|keyfunc|getKey|IssuerSigningKeyResolver' .
Trace issuer, key-set URLs, local paths and kid lookup. Compare trusted registries against unverified token fields; scope cache keys by issuer and kid.
Vulnerable example: A token supplies a JWKS URL/key file or another issuer's kid, and the validator trusts the result.
Fix: Pin allowed issuers and their JWKS/keys server-side; kid is only an exact index within that issuer. Restrict algorithms/key types, caching and rotation; do not trust token-supplied jku/x5u.
Verification: Legitimate rotation works; unknown/cross-issuer kid and client URLs cannot change the trust domain. Key-fetch failure never authorizes.
Reference: primary documentation. The explanation and adaptation recipe were written for this catalog.
CFG-SIGNED-REQUEST. Signatures are not bound to operations or preventable replays
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'signature|signed_url|signedUrl|nonce|expires|timestamp|hmac|Content-Digest' .
List exact signed bytes: method, path, query, body, recipient, purpose and lifetime. Compare signer/verifier normalization and atomic one-use nonce handling.
Vulnerable example: A read signature authorizes mutation, bodies can be replaced, or a one-use webhook/payment is replayed.
Fix: Sign a canonical contract binding action/purpose, recipient and required request components; bound expiry/clock skew. Atomically record one-use nonces/idempotency keys with the mutation.
Verification: Method/path/body/recipient changes invalidate signatures. Concurrent replays produce one effect; permitted retries return the agreed result.
Reference: primary documentation. The explanation and adaptation recipe were written for this catalog.
CFG-RATE-LIMIT-IDENTITY. Senders choose their rate-limit identity
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'rate.?limit|throttle|X-Forwarded-For|X-Real-IP|req\.ip|remote_addr|client_ip' .
Compare limit keys with the actual trusted-proxy boundary. Test case/Unicode names, route aliases, multiple workers, expiry and backend failure.
Vulnerable example: Limits use arbitrary headers, one account spelling or worker-local memory; changing representation resets the budget.
Fix: Normalize identity consistently with authentication; trust proxy headers only from approved hops. Use atomic shared budgets for intended actors/operations while preserving legitimate shared-IP access.
Verification: Header/identity-form changes do not create a fresh budget; parallel workers honor limits and permitted checker traffic works.
Reference: primary documentation. The explanation and adaptation recipe were written for this catalog.
CFG-TOKEN-REVOCATION. Password or role changes fail to revoke access
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'logout|revoke|revocation|token_version|session_version|password_changed|security_stamp|refresh_token' .
Trace login, refresh, logout, password changes, account deletion and role updates. Determine when APIs reload privileges, validate session/token versions and invalidate caches.
Vulnerable example: A deleted administrator retains an old JWT/session, or a revoked refresh token restores access.
Fix: Contractual expiry/revocation via session versions, denylists or short-lived access tokens with verified refresh. Rotate refresh tokens atomically and invalidate related caches.
Verification: After the chosen revocation event, old access/refresh tokens fail within the promised interval on every worker; legitimate re-login works.
Reference: primary documentation. The explanation and adaptation recipe were written for this catalog.
CFG-FAIL-OPEN. Verification errors become permission
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'catch|except|finally|recover|fallback|default.*allow|on_error|unwrap_or|Result' .
Trace every auth/signature/ACL exception, timeout, nil/None/null and cleanup branch. Inspect catch/finally, next middleware and defaults.
Vulnerable example: Database/validator failure returns allow/default principal, a handler continues after 401, or finally overrides denial.
Fix: Deny by default before side effects. Distinguish authorization denial from temporary unavailability and terminate the processing chain; log errors without secrets.
Verification: Synthetic backend errors/timeouts, wrong types and nil results neither expose data nor mutate state; normal checks pass.
Reference: primary documentation. The explanation and adaptation recipe were written for this catalog.
CFG-LDAP-FILTER. LDAP filters or DNs built as strings
Search: manual review; no separate scanner rule.
rg -n --hidden -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'ldap_search|ldap\.search|search_s|SearchFilter|DirContext|LdapName|Filter\.create|escape_filter' .
Trace search filters separately from DNs: their grammars differ. Check bind/search, wildcard handling, empty passwords and multiple-match selection.
Vulnerable example: Usernames become LDAP syntax; broadened filters select another record or several records with the first treated as the user.
Fix: Builders/parameter APIs or escaping specifically for filter values; construct DNs with a DN builder. Require exactly the intended match and a valid bind; search is not authentication.
Verification: Special characters remain values; zero/multiple matches and empty credentials cannot authenticate; normal users work.
Reference: primary documentation. The explanation and adaptation recipe were written for this catalog.
CFG-CI-TRUST. Untrusted data and code cross CI trust boundaries
Search: manual review; no separate scanner rule. CFG-CI-TRUST is a catalog ID, not an automatic signal. Locate workflows and composite actions:
rg -n --hidden -g '*.yml' -g '*.yaml' -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e 'pull_request_target|workflow_run|permissions:|secrets\.|allow-unsafe-pr-checkout|checkout@|download-artifact@|head\.sha|git fetch|gh pr checkout|run:|script:|uses: \./' .
rg -n --hidden -g '*.yml' -g '*.yaml' -g '!vendor/**' -g '!node_modules/**' -g '!.git/**' -e '\$\{\{[^}]*github\.(event|head_ref)' .
Read complete jobs and called actions/reusable workflows. Trace event/ref/artifact control → conversion into shell/JavaScript, dependencies or executables → effective permissions, secrets, environment and runner. An event name alone proves no flaw. Multiline expressions, indirect outputs and composite-action inputs need review even without search matches.
Vulnerable example: The first boundary is interpolating event data directly into run/script source. Quoting an expression does not protect it: interpolation occurs before shell parsing.
- name: Show title
shell: bash
run: printf '%s\n' "${{ github.event.pull_request.title }}"
A real workflow_run.head_branch case is documented in GHSL-2025-099. It affected a workflow in the action repository, not necessarily every project using the action.
The second boundary is executing PR code in a privileged job:
on: pull_request_target
permissions:
contents: write
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true
- run: make test
env:
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}
PRs can change tests, Makefiles, install hooks and local actions. An analogous workflow_run error downloads a prior PR artifact and executes its script. Correct run IDs and successful status establish provenance, not content trust. GitHub pull_request_target/workflow_run trust. A real PR → privileged workflow → PR-code execution chain appears in Gradio GHSL-2024-150 through GHSL-2024-157.
checkout v7 blocks unsafe fork-PR checkout by default for pull_request_target and workflow_run whose workflow_run.event matches pull_request*; the example explicitly disables protection. It does not protect every workflow_run. Protection was backported to supported major versions, but pinned old SHAs do not update themselves. Check the exact commit/backport; git fetch, third-party actions and artifacts bypass this checkout-specific boundary. checkout change. Also inspect effective repository event policy; workflow YAML alone cannot establish whether it applies. GitHub event policy.
Fix: Keep event data separate from executable source:
- name: Show title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
shell: bash
run: printf '%s\n' "$PR_TITLE"
The printf format is fixed and the value is one argument. Later eval, bash -c or JavaScript construction breaks the boundary again. Passing data through with is safe only if the receiving action handles it safely. GitHub script-injection guidance.
Run ordinary PR checks in an unprivileged, secret-free workflow:
on: pull_request
permissions:
contents: read
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- run: make test
persist-credentials:false alone does not fix privileged PR-code execution. Separate trusted jobs for comments, labels or report publication: accept bounded schema-validated JSON/text, verify repo/run/head SHA/PR destination, and never execute/import artifacts. Download data outside the trusted workspace. Private-registry/API tests need a separate design; arbitrary PR code must not receive their secrets. pull_request_target limited to labels/comments can be justified. GitHub Security Lab stage separation.
Verification: Statically trace data and minimal effective permissions including repository settings. In an authorized test CI exercise fork PRs, new SHAs after approval, quoted/newline-containing titles as data, foreign run IDs, malformed schemas and oversized artifacts. Preserve normal checks/report publication; PR code receives neither secrets nor a persistent self-hosted runner with internal access. These workflows were not executed during the catalog review; the offline scanner does not determine effective permissions or Actions relationships.
CFG-DOCKER-TCP. Docker daemon listens on every TCP interface
Search: scanner rule CFG-DOCKER-TCP. Use --explain CFG-DOCKER-TCP for the exact detector contract. Regex with lexical exclusions: dockerd followed on the same line by -H/--host tcp://0.0.0.0 or [::]. Does not evaluate TLS flags, JSON daemon configuration, named interfaces or shell expansions; a TLS-protected listener still requires review.
Vulnerable example:
dockerd -H tcp://0.0.0.0:2375
Fix: Prefer local Docker access. Required remote management needs authenticated encrypted transport and a deliberately restricted management interface; never publish it as a team UI.
dockerd -H unix:///var/run/docker.sock
Verification: Unapproved LAN clients cannot control Docker; approved administration remains possible without exposing credentials.
CFG-FLOATING-IMAGE. Explicit latest image tag
Search: scanner rule CFG-FLOATING-IMAGE. Use --explain CFG-FLOATING-IMAGE for the exact detector contract. Regex with lexical exclusions: Docker FROM or a bare YAML image key using an unquoted image:latest with no digest. Quoted YAML, untagged images, other mutable tags, ARG expansion and resolved architecture need deployment-model audit.
Vulnerable example:
FROM example.invalid/app:latest
Fix: Record the approved source version and architecture-specific image digest; populate the offline image inventory and verify imported images.
FROM example.invalid/app@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Verification: Repeated offline starts use the approved bytes and architecture; no implicit pull or latest fallback occurs.
TPL-AUTOESCAPE-OFF. Template block disables autoescaping
Search: scanner rule TPL-AUTOESCAPE-OFF. Use --explain TPL-AUTOESCAPE-OFF for the exact detector contract. Regex excluding HTML/Jinja comments: Jinja/Twig autoescape false and Django autoescape off blocks. Does not evaluate template engine defaults, enclosing blocks or whether values are trusted.
Vulnerable example:
{% autoescape false %}{{ message }}{% endautoescape %}
Fix: Retain autoescaping for untrusted text; sanitize supported HTML explicitly and review the output context.
{{ message }}
Verification: User tags/attributes remain data and allowed formatting still works.