Allowing customization of the position of the style, why does the style content also need to be filtered?

📅 2026-11-01 👁️ 0

Why even the style content needs to go through a filter? Because the style is not just a presentation layer description text: the attribute names and values can point to external resources, can change the presentation of page elements, and can also replace the visible content with another set. In this round of security fixes, the WordPress official listed the issue of CSS injection achieved by users with Author and above roles bypassing the security style attribute filter, the direction of treatment is to do whitelist filtering on the style content itself, rather than just checking if it can be parsed.

What can be hidden in the style?

Common types. One type is to reference attribute values from external addresses, where the page sends requests to services outside the site; another type is to cover layout values, which can obscure or replace existing content, affecting what visitors see in the text; and another type is the writing style that联动 with script behavior, affecting page interaction by changing the visibility of elements. All three types do not require script tags, yet they can all change the actual experience of visitors, which is why 'Filtering tags alone is not enough to prevent style injection.'

Why is the whitelist filter bypassed

Filter three segments at the same time: selector, attribute name, and attribute value. Only the attribute name is released without limiting the value, and external addresses can be included in the value; only check the literal value of the attribute, encoding transformation and splicing writing may bypass it; only look at the text submitted at the time, and it can be spliced together with other segments after being stored in the database to form the unopened writing.

Therefore, the scope is 'dual whitelist plus review before storage': a list of allowed attribute names and allowed value forms are listed separately, and a final check is made on the merged final text before writing. This is the same approach as the rich text content filtering, but the object has changed from tag to style.

The three segments of content to be filtered over.

The first is the structure and semantics layer. The in-station sensitive word filtering and keyword replacement processing of text content, content review for the pre-publication review, style filtering should be listed together, and cannot be considered as having been solved by the rich text filter. The second is the identity and authentication layer. The JWT authentication at the back-end entry is responsible for determining who the request comes from, and this is two issues with「whether the style submitted by this person is safe」. The third is the out-station processing of anti-crawling and interference codes, which change the rendering of the text but do not change the judgment object of the style filtering.

There is still protection against script injection and database injection within the site, style filtering is a link in the same content security boundary, and if it is missing, no matter how strict the other layers are, gaps will appear from this entry.

Who can write custom styles

The exposed surface is determined by the role. The wider the range of roles that can be written with a custom style, the stricter the filtering rules should be; if only the site administrator can change it, it is still recommended to keep the filter to prevent it from being reused in batch imports or template content. AnQiCMS provides visual template editing capabilities, and the modification of templates and styles is a routine operation in authorized roles. Changes to such locations should also follow the same filtering and review criteria, rather than skipping them because 'it is written by the administrator.'

This issue in the official repair list is for Authors and above roles, it indicates that 'Trusted Role' is not an exemption condition; the release notes also remind that only newer versions are actively supported, and leaving such repairs outside the old versions will continue to expose them.

Can't we just turn off the custom style entry?Yes, this is the most convenient way to handle it. If the business really needs it, it can be opened in two steps of dual whitelist and final text review.

Will filtering styles written by administrators also cause harm?Answer: There will be a normal release method that needs to be opened, which is to add the confirmed safe attributes and values to the whitelist instead of skipping the filtering for the entire role.

Question: Should the styles in the template file be checked in the same way?Answer: The template belongs to the code layer and is generally controlled by the deployment process; only the style fragments that can be submitted in the external form need to be filtered at runtime, and the control means are different but the judgment criteria should be consistent.

Related articles

The confirmation process for members changing their email addresses is bypassed, and what else does the account side need to verify?

The confirmation process of changing the member's email binding is bypassed, which means the bypasser has obtained the password recovery channel. The account side needs to verify not only this logic. This article explains why property changes require two-way confirmation, how user groups and access permissions should be tightened, the role of email reminders in the process of handling, and provides four records to be checked after the repair.

2026-11-01

The alias of the article address can be listed externally, where should the list interface receive it?

The article address alias can be enumerated externally, usually requiring two conditions to be met: the alias can be guessed according to a regular pattern, and the list interface allows bulk pagination return. Therefore, the bottleneck is on the interface side rather than the page side, and it is necessary to limit the scale of single returns, set the exposure range according to the domain, and tighten the access to unpublic content. This article explains the conditions for enumeration, what list is exposed, and the location to be checked for internal interface.

2026-11-01

Why is it necessary to limit server access to internal network addresses in the place where external links can be filled in the background?

The place where external links can be filled in the background needs to limit the server's access to the internal network address because the server will replace the user to retrieve this address: Once the link verification is bypassed, the request can be sent to the link-local address range, exposing the internal network service to external inputs. The verification should be done both at the time of writing and before the request, and then supplemented by the outgoing network limit, especially for entry points such as importing and remote image retrieval, which should be separately controlled.

2026-11-01

Why do we need to tighten the registration entry first and then patch the multi-site user registration open?

The reason why a multi-site with open user registration needs to tighten the registration entry first and then patch it is because the triggering conditions of this kind of risk are written together: registration is open, and ordinary users can create new sites. Closing the registration during the patch window period and restricting the permission to create new sites can directly cut off the attack entry; after patching, it is also necessary to check back on the sites that have been created and to synchronize the backup and permission review.

2026-11-01

Components that cannot be found in the vulnerability library, can they be considered risk-free?

A component that cannot be found in the public vulnerability library cannot be considered risk-free, as it is often just that the scope of collection and naming criteria do not match. The vulnerability library categorizes entries by core, extension, and theme, and verifies them one by one. Self-built and commercial components are often not included. This article provides three reasons for not finding them, the handling criteria for the worst-case scenario, and how to turn the asset list into an executable mitigation action sequence.

2026-11-01

The window for the secure version and the major version release are scheduled in the same week, which one should the site follow first?

When the fixed secure version window and the annual major version are scheduled in the same week, follow the secure version first. The secure version closes known exploitable entries, while the major version changes data structures and template behaviors, with a higher verification cost. This article explains the differences in the nature of the two types of updates, how to evaluate the cost of delaying the major version by one week, and the two-step verification and rollback preparation to be reserved in the scheduling.

2026-11-01

The garbage station update in September took nearly fourteen days to end, when is it suitable for review?

This round of garbage content update in September started in the late month and was marked completed in the early October, lasting for more than thirteen days. Before the update was completed, the ranking reading was the intermediate state within the rolling period, which cannot be taken as a conclusion; the time suitable for review should meet two conditions: the official panel is marked completed, and the data after the completion day returns to a stable interval. The waiting period should first check basic items such as robots and site maps.

2026-11-01

Only a little over 30% of the pages referenced in the AI overview come from the top ten, so should we still pay attention to the ranking?

A large-scale study shows that only about 30% of the pages referenced in AI overviews are also in the top ten natural search results, while this proportion was about 75% a year ago. The decline in overlap does not mean that the ranking has become ineffective: the ranking is still the entry point, but is no longer a condition for reference. The focus should be on which issues the reference hits, whether paragraphs can be extracted separately, and whether the keyword library and anchor text can stably identify the content.

2026-11-01