Skip to content

Commit 0d8aa98

Browse files
committed
chore(release): prepare v6.1.0
Bump Version to 6.1.0 and add CHANGELOG.md covering the release. 6.1.0 is primarily a security update: it closes a {% filter %} sandbox bypass, fixes two renderer panics reachable from template input (removetags, {% ifchanged %}), and clarifies that pongo2's ban-list and loader APIs do not provide a true sandbox.
1 parent 75e020c commit 0d8aa98

3 files changed

Lines changed: 64 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [6.1.0] - 2026-05-02
6+
7+
This release is primarily a **security and bug-fix update**. All users are
8+
encouraged to update.
9+
10+
### Fixed
11+
12+
- **`removetags` filter**: tag names containing regex metacharacters no longer
13+
panic the renderer.
14+
- **`{% cycle %}` tag**: cycle index is now tracked per template execution
15+
instead of mutated on the parsed AST node. Concurrent renders of a cached
16+
template no longer race, and sequential renders no longer leak state from
17+
a previous execution.
18+
- **`{% ifchanged %}` tag**: `lastValues`/`lastContent` are now tracked per
19+
template execution instead of mutated on the parsed AST node, fixing both
20+
a data race under concurrent renders and state leaking between sequential
21+
renders of a cached template.
22+
- **`{% ifchanged %}` tag**: rendering an `{% ifchanged %}` block without
23+
an `{% else %}` branch no longer crashes with a nil-pointer dereference
24+
when the watched value is unchanged. Matches Django's behavior of
25+
producing no output.
26+
- **`{% filter %}` tag**: `BanFilter` is now enforced inside `{% filter %}`
27+
blocks.
28+
29+
### Changed
30+
31+
- **`{% ssi %}` plaintext mode** now reads the included file through the
32+
configured `TemplateLoader` chain instead of `ioutil.ReadFile`, so
33+
non-filesystem loaders (`FSLoader`, `HttpFilesystemLoader`, custom)
34+
can serve SSI content.
35+
- **Template error reporting** (`RawLine`) now reads source lines through
36+
the template's loader chain instead of opening files directly with
37+
`os.Open`. Error line extraction now works for any `TemplateLoader`.
38+
39+
### Removed
40+
41+
- **`SandboxedFilesystemLoader` and `NewSandboxedFilesystemLoader`** have
42+
been removed. They were marked WIP, never wired into any enforcement
43+
path, and behaved as a thin pass-through to `LocalFilesystemLoader`.
44+
Callers should use `LocalFilesystemLoader` directly; sandboxing should
45+
be implemented via a custom `TemplateLoader`.
46+
47+
Note: this is technically an API-breaking removal, but the type was
48+
unused WIP code that never provided sandboxing.
49+
50+
### Documentation
51+
52+
- Clarified that pongo2 does **not** provide a true sandbox. `BanTag` and
53+
`BanFilter` only refuse to compile templates that reference banned
54+
names; they do not isolate Go execution, restrict filesystem access,
55+
or contain malicious templates. README, `TemplateSet` field comment,
56+
`DefaultLoader` comment, and parser error messages updated accordingly.
57+
- Added a Security section to the README documenting that template
58+
loaders (`LocalFilesystemLoader`, `HttpFilesystemLoader`, `FSLoader`)
59+
do not clamp paths to a base directory and that template filenames
60+
must be treated as trusted input.
61+
62+
[6.1.0]: https://github.com/flosch/pongo2/compare/v6.0.0...v6.1.0

pongo2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package pongo2
22

33
// Version string
4-
const Version = "6.0.0"
4+
const Version = "6.1.0"
55

66
// Must panics, if a Template couldn't successfully parsed. This is how you
77
// would use it:

template_tests/pongo2ctx.tpl.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
6.1.0

0 commit comments

Comments
 (0)