Skip to content

Sensitive credential path detection can be bypassed through path construction(malicious skill example that bypasses this static detection model) #477

Closed

Description

@2002lcy0401

Summary

With LLM analysis explicitly disabled (--no-llm), the scanner detects a literal /etc/passwd path but fails when the same path is constructed using os.path.join().

Scan command:

skillspector scan .\xxx --no-llm -f json

Original:

with open('/etc/passwd', 'r') as f:
    passwd_data = f.read()

Result:

PE3 - Credential Access
Severity: HIGH
Finding: /etc/passwd

Variant:

import os

path = os.path.join('/etc', 'passwd')

with open(path) as f:
    passwd_data = f.read()

Result:

No security issues detected.

Expected Behavior

Both variants should trigger the same credential-access finding because the constructed path resolves statically to /etc/passwd.

Impact

Without LLM analysis, simple path construction completely bypasses the PE3 credential-access detection.

Suggested Fix

Add static constant propagation and path resolution for expressions such as os.path.join() before matching sensitive paths.

Activity

  1. changed the title [-]Sensitive credential path detection can be bypassed through path construction[/-] [+]Sensitive credential path detection can be bypassed through path construction(malicious skill example that bypasses this static detection model)[/+] on Sep 7, 2026
  2. rng1995 commented on Sep 16, 2026

    @rng1995
    Collaborator

    Implementation is in progress in PR #545, which detects constructed sensitive credential paths. Keeping this issue open until the PR merges and the reported construction bypass plus benign controls are verified.

  3. rng1995 commented on Sep 28, 2026

    @rng1995
    Collaborator

    Resolution verified: PR #545 merged into main on September 28, 2026 (5d370aa) and automatically closed this issue.

    The reported os.path.join('/etc', 'passwd') construction now produces PE3 credential-access detection without evaluating arbitrary code. On current main (79b855b), 14 focused pattern/shared-AST regression tests pass, including the exact report, literal-only resolution, supported import aliases, multiline and bounded-window handling, and benign controls.

    This supersedes the earlier in-progress status. The fix is merged on main; no new tagged release is implied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions