The vulnerability is a path traversal weakness (CWE-22, CWE-59) in @tinacms/graphql and @tinacms/cli. The core issue is that path validation was purely lexical (string-based) and did not resolve symlinks or junctions. An attacker could create a symlink within the media directory that points to a location outside of it. When TinaCMS performed file operations (list, upload, delete), it would follow the symlink and operate on files outside the intended media root directory.
The fix, as seen in commit f124eabaca10dac9a4d765c9e4135813c4830955, involves adding checks that resolve the real filesystem path using fs.realpathSync. The new resolveRealPath helper function was introduced for this purpose. The validation functions assertPathWithinBase, assertWithinBase, resolveWithinBase, and resolveStrictlyWithinBase were updated to use this real-path validation, thus closing the security gap.
The vulnerable functions are the original implementations of these validation functions, which lacked the symlink check. Additionally, the public API functions that relied on this flawed validation, such as those in MediaModel and FilesystemBridge, are also considered vulnerable as they are the entry points for exploitation.