Skip to content

security: MountableFs missing validate_path(), misc VFS gaps (TM-DOS-046, TM-DOS-049, TM-DOS-050) #498

@chaliy

Description

@chaliy

Summary

Several lower-severity VFS and parser issues found during the deep audit:

TM-DOS-046: MountableFs at fs/mountable.rs:348-491 has zero validate_path() calls across all FileSystem trait methods. Path depth/character validation is completely bypassed for mounted filesystems.

TM-DOS-049: collect_dirs_recursive at interpreter/mod.rs:8352 has no explicit depth limit when recursing through VFS directory trees. Mitigated by max_path_depth in FsLimits but no direct protection.

TM-DOS-050: parse_word_string at parser/mod.rs:109 creates a parser with default limits, ignoring caller-configured tighter limits. Parameter expansion in word contexts gets unlimited parser operations.

Impact — LOW to MEDIUM

  • TM-DOS-046: Path validation gaps in mounted filesystems
  • TM-DOS-049: Theoretical deep recursion DoS (mitigated by existing limits)
  • TM-DOS-050: Parser limit bypass in parameter expansion

Recommended fix

  • Add validate_path() to all MountableFs FileSystem methods
  • Add explicit depth parameter to collect_dirs_recursive
  • Propagate limits through parse_word_string

Cross-references

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecuritySecurity vulnerability or hardening

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions