view_component: System Test Entry Point Path Check Allows Sibling Directory Escape
The system test entrypoint canonicalizes a user-controlled file path with File.realpath, then checks whether the resolved path starts with the temp directory path. This is not a safe containment check because sibling directories can share the same string prefix. Severity: Medium; test-route scoped. Example: Allowed base: /app/tmp/view_components Outside path: /app/tmp/view_components_evil/secret.html.erb The outside path is not inside the base directory, but it passes: @path.start_with?(base_path)