Summary
Amazon Deep Java Library (DJL) may allow a crafted model archive to control file paths used during processing. If an affected DJL process handles such an archive, a remote unauthenticated attacker may be able to read files accessible to that process.
Affected context
The issue affects DJL versions 0.7.0 through 0.38.0 when model archives are processed in a way that lets archive-supplied paths influence file access. Risk depends on whether an application accepts and processes archives from untrusted sources, and on which files the DJL process can access.
Exploit preconditions
- Attack surface: A service or workflow that processes model archives using an affected DJL version
- Required access: The description indicates that authentication is not required; the attacker must be able to supply a crafted archive to the processing path
- Trigger point: The application processes the supplied model archive
- Why exploitation is possible: Archive-controlled paths may direct file access beyond the intended model or extraction location
Why this happens
The underlying issue is external control of a file path, classified as CWE-73. If archive-provided path values are used without sufficient validation or containment, they may influence which files the process opens. This is related to CWE-36, which covers path traversal involving absolute path names.
Potential impact
- An attacker may read sensitive files that the DJL process can access.
- Exposed files could contain application data, configuration, or credentials.
- Disclosure of secrets could enable further compromise, depending on the deployment and the contents of accessible files.
General mitigation guidance
Defensive patterns focus on treating archive contents as untrusted and constraining file access:
- Use secure archive-processing APIs and reject paths that escape an explicitly defined destination.
- Resolve and normalize paths, then verify they remain within the intended directory before accessing files.
- Prefer allowlisted archive entries and avoid using archive-supplied paths directly.
- Limit the DJL process's filesystem permissions and access to sensitive files.
- Reduce exposure by accepting model archives only from trusted sources and validating them before processing.
How teams detect issues like this
- Use static analysis to identify archive extraction or file-access code that uses externally supplied path values without normalization and containment checks.
- Review model-loading flows for path validation, archive entry filtering, and checks that resolved paths remain within the intended directory.
- Enforce code-review or CI policies requiring safe archive-handling patterns and least-privilege filesystem access.
- Monitor archive-processing services for unexpected file access or attempts to access paths outside designated model directories.

