Commit dec9813
authored
chore(deps): update dependency mako to v1.3.11 [security] (#16695)
This PR contains the following updates:
| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [mako](https://www.makotemplates.org/)
([source](https://redirect.github.com/sqlalchemy/mako)) | `==1.3.10` →
`==1.3.11` |

|

|
### GitHub Vulnerability Alerts
####
[GHSA-v92g-xgxw-vvmm](https://redirect.github.com/sqlalchemy/mako/security/advisories/GHSA-v92g-xgxw-vvmm)
### Summary
`TemplateLookup.get_template()` is vulnerable to path traversal when a
URI starts with `//` (e.g., `//../../../secret.txt`). The root cause is
an inconsistency between two slash-stripping implementations:
- `Template.__init__` strips **one** leading `/` using `if`/slice
- `TemplateLookup.get_template()` strips **all** leading `/` using
`re.sub(r"^\/+", "")`
When a URI like `//../../../../etc/passwd` is passed:
1. `get_template()` strips all `/` → `../../../../etc/passwd` → file
found via `posixpath.join(dir_, u)`
2. `Template.__init__` strips one `/` → `/../../../../etc/passwd` →
`normpath` → `/etc/passwd`
3. `/etc/passwd`.startswith(`..`) → `False` → **check bypassed**
### Impact
Arbitrary file read: any file readable by the process can be returned as
rendered template content when an application passes untrusted input
directly to `TemplateLookup.get_template()`.
Note: this is exploitable at the library API level. HTTP-based
exploitation is mitigated by Python's `BaseHTTPRequestHandler` which
normalizes double-slash prefixes since CPython gh-87389. Applications
using other HTTP servers that do not normalize paths may be affected.
### Fix
Changed `Template.__init__` to use `lstrip("/")` instead of stripping
only a single leading slash, so both code paths handle leading slashes
consistently.
##### Severity
- CVSS Score: 6.3 / 10 (Medium)
- Vector String:
`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- ""
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/googleapis/google-cloud-python).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMjMuOCIsInVwZGF0ZWRJblZlciI6IjQzLjEyMy44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->1 parent 856731e commit dec9813
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
318 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
0 commit comments