feat(rules): add FreeMarker (.ftl/.ftlh/.ftlx) review support#5
Open
chethanuk wants to merge 1 commit into
Open
feat(rules): add FreeMarker (.ftl/.ftlh/.ftlx) review support#5chethanuk wants to merge 1 commit into
chethanuk wants to merge 1 commit into
Conversation
chethanuk
force-pushed
the
feat/issue-371-freemarker-rules
branch
from
July 15, 2026 08:31
b46e102 to
913b329
Compare
Adds the FreeMarker template extensions to the supported-file-type
allowlist and introduces a freemarker.md system rule layer (glob
**/*.{ftl,ftlh,ftlx}) covering SSTI (?new()/Execute/ObjectConstructor,
?eval/?api), output escaping vs the ftlh/ftlx auto-escape formats,
null/missing-value handling, logic-in-template smells, include/import
hygiene, and locale-sensitive formatting. Extends the allowlist and
system-rules tests and documents the new mapping in the en/ja/zh pages.
Closes alibaba#371
chethanuk
force-pushed
the
feat/issue-371-freemarker-rules
branch
from
July 15, 2026 09:14
913b329 to
7b8d823
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds first-class review support for Apache FreeMarker templates, as requested in alibaba#371:
.ftl,.ftlh, and.ftlxadded tointernal/config/allowlist/supported_file_types.json(.ftlh/.ftlxare FreeMarker's official extensions for HTML- and XML-auto-escaping output formats, so all three are covered).internal/config/rule_docs/freemarker.mdrule layer wired intointernal/config/system_rules.jsonwith glob**/*.{ftl,ftlh,ftlx}. The rules focus on template-specific pitfalls: XSS/escaping (?htmlvsftlhauto-escape,noautoesc), null-safety (!default and??existence operators), heavy logic in templates, and include/import hygiene.Type of Change
How Has This Been Tested?
make testpasses locallyallowed_ext_test.goandsystem_rules_test.goextended to cover the three new extensions, including glob-match verification for root-level and nested template paths.make check(tidy + fmt + vet) passes.Checklist
go fmt,go vet)Related Issues
Closes alibaba#371