Summary
A path traversal vulnerability in the Home Assistant Community Store (HACS) 1.10.0 /hacsfiles endpoint allows unauthenticated attackers to read arbitrary files on the Home Assistant host by manipulating file paths.
If exploited, attackers can access sensitive files such as .storage/auth, extract credentials and refresh tokens, and subsequently craft valid JWT tokens to obtain administrative access to affected Home Assistant instances.
Affected context
This vulnerability arises in Home Assistant deployments that use HACS 1.10.0 and expose the /hacsfiles endpoint over the network.
The issue manifests when the endpoint accepts user-supplied paths without adequately constraining them to an intended directory or normalizing and validating the resulting file path.
Environments where Home Assistant is reachable from untrusted networks or the internet are at particular risk, especially if default storage locations and authentication files remain accessible on the same filesystem.
Exploit preconditions
- Attack surface: HTTP interface exposed by the Home Assistant instance, specifically the
/hacsfiles/endpoint. - Required access: No prior authentication; an attacker only needs network access to the vulnerable Home Assistant server.
- Trigger point: An attacker sends crafted requests to
/hacsfiles/with directory traversal sequences (e.g., using../) to escape the intended content directory. - Why exploitation is possible: The server-side handler for
/hacsfiles/trusts user-controlled path fragments, fails to normalize and enforce a fixed base directory, and allows file reads from arbitrary locations on the filesystem, including configuration and authentication storage.
Why this happens
The root cause maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The file-serving logic behind /hacsfiles/ likely concatenates user-supplied path elements with a base directory and passes the resulting path directly to a file read or static file serving routine.
Without canonicalization, normalization, and strict checks that the resolved path remains inside the intended directory tree, directory traversal sequences enable access to files outside the expected scope.
This insecure pattern is common when implementing custom static file endpoints or download handlers that do not enforce a whitelist-based path policy or use safe path-joining utilities.
Potential impact
- Unauthorized reading of sensitive configuration and state files, including
.storage/auth. - Exposure of user credentials, refresh tokens, and other secrets stored on disk.
- Construction of valid JWT tokens, enabling full administrative access to Home Assistant.
- Hijacking of existing Home Assistant accounts or creation of new privileged sessions.
- Potential pivot to further compromise the host environment, depending on what other secrets and configuration files are accessible.
General mitigation guidance
Mitigation focuses on removing direct trust in user-supplied paths and strictly scoping file access:
- Implement path normalization and canonicalization, then enforce that all resolved paths remain within a predefined base directory.
- Use safe path-joining APIs or framework helpers that prevent traversal outside the allowed directory.
- Adopt a whitelist approach to file serving, where only known or enumerated files are accessible by name rather than arbitrary paths.
- Separate sensitive storage (e.g., authentication state, secrets) from web-accessible directories and ensure least-privilege file permissions.
- Limit exposure of the Home Assistant interface to trusted networks and apply network-level controls (e.g., reverse proxies, VPN) to reduce unauthenticated access.
How teams detect issues like this
Detection can combine code-level review with runtime monitoring:
- Static analysis rules or linters that flag direct concatenation of user input into filesystem paths, especially in HTTP handlers.
- Code review checklists that require verification of path normalization and base directory enforcement for any file-serving endpoints.
- Runtime logging and monitoring of file access patterns, including suspicious access to
.storageor other configuration directories via web endpoints. - Web server or application logs reviewed for repeated requests containing
../sequences or unusual paths targeting internal storage directories. - Use of automated security testing tools (e.g., SAST/DAST) configured to probe for directory traversal behavior across HTTP endpoints.

