Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
3.7
Docker hardened images may skip safety check in templates
published 8 days ago
Summary
The affected Docker images use a template function that can bypass a security check, allowing raw data to be read without proper validation. This only happens when the compatibility mode is turned on. Disable the {compat: true} setting in those images to prevent the issue.
What to do
The CVE record does not list a fixed version. Check the vendor's site or the advisory links below - a fix may already be released.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| Docker Hardened Images:Alpine:3.24 | docker hardened images | jupyterhub-k8s-singleuser-sample-fips | All versions |
| Docker Hardened Images:Debian:13 | docker hardened images | datahub-ingestion | All versions |
| Docker Hardened Images:Debian:13 | docker hardened images | jupyterhub-k8s-singleuser-sample-fips | All versions |
| Docker Hardened Images:Debian:13 | docker hardened images | jupyterhub-k8s-singleuser-sample | All versions |
| Docker Hardened Images:Debian:13 | docker hardened images | superset | All versions |
Original advisory text
## Summary
## Summary
In `lib/handlebars/runtime.js`, the `container.lookup()` function uses `container.lookupProperty()` as a gate check to enforce prototype-access controls, but then discards the validated result and performs a second, unguarded property access (`depths[i][name]`). This Time-of-Check Time-of-Use (TOCTOU) pattern means the security check and the actual read are decoupled, and the raw access bypasses any sanitization that `lookupProperty` may perform.
Only relevant when the **compat** compile option is enabled (`{compat: true}`), which activates `depthedLookup` in `lib/handlebars/compiler/javascript-compiler.js`.
## Description
The vulnerable code in `lib/handlebars/runtime.js` (lines 137–144):
```javascript
lookup: function (depths, name) {
const len = depths.length;
for (let i = 0; i < len; i++) {
let result = depths[i] && container.lookupProperty(depths[i], name);
if (result != null) {
return depths[i][name]; // BUG: should be `return result;`
}
}
},
```
`container.lookupProperty()` (lines 119–136) enforces `hasOwnProperty` checks and `resultIsAllowed()` prototype-access controls. However, `container.lookup()` only uses `lookupProperty` as a boolean gate — if the gate passes (`result != null`), it then performs an independent, raw `depths[i][name]` access that circumvents any transformation or wrapped value that `lookupProperty` may have returned.
## Workarounds
- Avoid enabling `{ compat: true }` when rendering templates that include untrusted data.
- Ensure context data objects are plain JSON (no Proxies, no getter-based accessor properties).
In `lib/handlebars/runtime.js`, the `container.lookup()` function uses `container.lookupProperty()` as a gate check to enforce prototype-access controls, but then discards the validated result and performs a second, unguarded property access (`depths[i][name]`). This Time-of-Check Time-of-Use (TOCTOU) pattern means the security check and the actual read are decoupled, and the raw access bypasses any sanitization that `lookupProperty` may perform.
Only relevant when the **compat** compile option is enabled (`{compat: true}`), which activates `depthedLookup` in `lib/handlebars/compiler/javascript-compiler.js`.
## Description
The vulnerable code in `lib/handlebars/runtime.js` (lines 137–144):
```javascript
lookup: function (depths, name) {
const len = depths.length;
for (let i = 0; i < len; i++) {
let result = depths[i] && container.lookupProperty(depths[i], name);
if (result != null) {
return depths[i][name]; // BUG: should be `return result;`
}
}
},
```
`container.lookupProperty()` (lines 119–136) enforces `hasOwnProperty` checks and `resultIsAllowed()` prototype-access controls. However, `container.lookup()` only uses `lookupProperty` as a boolean gate — if the gate passes (`result != null`), it then performs an independent, raw `depths[i][name]` access that circumvents any transformation or wrapped value that `lookupProperty` may have returned.
## Workarounds
- Avoid enabling `{ compat: true }` when rendering templates that include untrusted data.
- Ensure context data objects are plain JSON (no Proxies, no getter-based accessor properties).
References
- https://scout.docker.com/v/DHI-fh4s-zoih-tev7-rfyr Vendor Advisory
- https://github.com/advisories/GHSA-442j-39wm-28r2 Vendor Advisory
- https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-442j-3... Vendor Advisory
- https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c... Patch
- https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9 URL
Internet-facing
14 days
Internal
60 days
- Not known to be exploited
- Can be exploited automatically (estimated)
- Gives an attacker partial control (estimated)
Timeline
Published14 Nov 2026
Updated16 Nov 2026
First seen16 Nov 2026
Sources
DHI-fh4s-zoih-tev7-rfyr · OSV
Track software like this
Free during beta