|
| 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 |
0 commit comments