Can the background field execute content as a template, and where does the server-side template injection occur?
Will the content written in the background form field be executed as a template, and at which layer does the server-side template injection occur? The answer is that it occurs at the rendering layer: the storage itself will not execute the content, only when the value of this field is given to the template engine as a template for parsing, will the writing inside be executed.A content management system Drupal released two announcements of this type on the same day: SA-CONTRIB-2026-203 (project inline_formatter_field) and SA-CONTRIB-2026-200 (project linked_field) were both released on 2026-October-07, with a rating of Moderately critical, and labeled as Server-side template injection.Two announcements, the project names all point to 'field', this is no coincidence.
The difference between template injection and script injection
Cross-site scripting is when content is executed as a script by the browser, the problem lies in the end after the output to the page; template injection is when content is executed as template syntax by the server-side template engine, the problem lies in the moment of rendering.
Both look the same in the storage layer—they are all suspicious strings in the database. The difference lies in the rendering process: the former needs to be parsed by the browser, affecting visitors; the latter is executed in the server process, affecting what the machine can read.
Therefore, the troubleshooting methods are also different. Check for script injection by looking at whether the output is escaped; check for template injection by seeing if there is a call to 'parse the field value as a template string again.' The latter often appears in the places where features are combined: formatting fields, referencing fields, configurable text, and the ability to generate content according to a template.
What fields are considered template syntax?
The trigger condition is only one: this value has entered the function 'input as a string, parsed by a template engine'. There are three common sources.
The first type is the formatted field. The scenario where placeholders or expressions are allowed in the field value is the easiest to go out of bounds - it is supposed to be parsed, the difference is just whether the parsing range is limited to placeholders.
The second type is the reference type field. When referencing another entity, the display form is often composed into a template for rendering, and the input side changes from 'select one' to 'write a paragraph'.
The third category is configurable text. Positions like email body, activity page text, and prompts that 'let the operation write themselves,' if there is no distinction between data and template between the writing end and the rendering end, will become the entry point.
The two project names in the sample announcement fall into the first two categories. When reading the announcement, the project name itself is a clue: it tells you which field form the problem lies in.
Content review and sensitive word filtering are what manage on this path.
AnQiCMS's content security settings provide sensitive word filtering and keyword replacement, as well as content review, which play a role in the template injection chain to 'prevent content from entering the formal rendering position', belonging to access control, not execution control.
It is clear that this division of labor should be: the review process determines according to words and rules, whether a segment of template writing can be identified depends on whether the rules cover it; filtering and replacement handle the matched words without changing the rendering method. What truly determines whether 'the value will be executed' is how the rendering layer handles it.
So, the three things that need to be done on-site are: field values are processed according to data processing, and do not participate in secondary parsing; in scenarios requiring template syntax, templates are defined by the backend and parameters are filled in by the frontend; before publishing, content review and sensitive word filtering are carried out, and拦住命中项 to avoid suspicious content from entering the formal display position.
The built-in protection of the self-owned system covers SQL injection and XSS attacks, sensitive word filtering and anti-crawling interference codes are on the other end of the chain; each layer manages a section, do not expect one layer to manage everything.
How can the template changes take effect on the site?
The modification of the template layer should follow the path of the template layer, which is crucial for troubleshooting and repair. AnQiCMS provides AI visual template editing, which can directly modify the template code with AI assistance, and the scope of modification is within the template file, not in the main text data.
The actual consequences of the difference are: if a field value is treated as a template, the solution is to change the rendering call instead of changing the content; conversely, if it is just a display style issue, changing the template is enough, no need to touch the data. Mixing it up will leave two side effects - the suspicious content is still in that field, and the template has been changed to an unusable state.
After the repair, three checks need to be made: the field value is displayed as is, the template syntax is no longer executed, and the review and filtering rules still hit the same type of input. Check all three before releasing.
Common questions
Can writing styles in the rich text editor mean that it can be injected into the template?They are not equivalent. The rich text processing is a collection of tags and whitelist tags, and the syntax parsing of the template engine is a separate path. It should be viewed separately: is the output of the editor handed over to the template engine for parsing again, if not, it does not belong to this type of problem.
Can escaping alone stop it?The escaping process is the output, template injection occurs before parsing. It is to block the step of 'treating the value as a template string', escaping only has meaning when you are sure that it will not be parsed again.
The announcement rating is moderate and serious, can we take it easy?The rating reads dimensions but not words. Moderate and serious usually means that the establishment conditions are limited, but the type is a template injection problem. Once established, the impact on the server is significant, and we should follow the pace of the site and be more stable.
How should we reduce this kind of risk for the fields of the custom content model?When designing a field, make it clear whether it is 'parsed text'. Fields requiring template syntax should only allow backend definition of templates and frontend filling of parameters; fields for pure display should be processed according to data handling and not participate in secondary parsing.