Vector icons can carry scripts, and when uploading images, it is necessary to filter out what content should be blocked.

📅 2026-10-11 👁️ 12

Vector icons can have scripts, which refers to the inherent capabilities of the file type, not a specific vulnerability. It has the extension .svg and is often uploaded with images as icons, but it is a document written in a markup language: the official documentation directly describes the script element as 'allows you to add scripts to an SVG document', meaning that scripts can become part of the document, and external scripts can also decide the execution timing through asynchronous or delayed attributes. Therefore, the premise that 'the uploaded is an image' does not apply to this format.

Risk changes with the opening method

The consequences of opening the same file in two different ways are different. Asthe script is generally not executed when loaded from the reference source, the risk is low; but if the user or link directly opens it in the browser tab, it becomes an executable document, and the script runs in the source under which the file is loaded. If it is under the domain and path of the site itself, the running environment is the context of the site, and Cookie and login status are within the scope.

Therefore, it cannot be determined by the extension and MIME type alone. The determination should be based on the content, and the processing should fall before storage.

What content should be blocked during purification

Category Specific object Processing suggestions
Script class Script elements, inline event attributes (such as onclick and the like) Remove directly
External reference Reference elements of embedded external documents, pointing to remote addresses Remove or rewrite as an in-site resource
Jump wrapping Clickable link wrapping element Reserved as needed by business, limited to in-site addresses when reserved
Deformed writing Entity encoding, concatenation of comments, mixed case Normalize first then judge
Volume class Unzipping volume and nesting level of compressed variants Limit the size and level after unzipping
Identification class Identify duplicate elements within the document Rename or deduplicate to avoid conflicts with the page itself

The problem of compressed variants is often ignored: a small volume archive may contain content of a larger magnitude after unzipping, and it will also consume far more resources than expected during the parsing phase. PbootCMS recorded the expansion of upload types in V3.2.22, and at the same time, it was common practice to process both 'Force cleaning SVG and limiting SVGZ unzipping' together.

How to choose blacklist and whitelist

The blacklist is 'list what needs to be deleted', and the whitelist is 'list what can be kept'. The blacklist is convenient, it can preserve the original display effect, but the coverage depends on whether the list keeps up with the new style; the whitelist has a clear security boundary, but the cost is that it may delete unrecognized legitimate elements all at once, resulting in incomplete icon display.

In practice, both are often used together: first retain the elements needed for drawing and structure according to the whitelist, and then explicitly clear the script, event attributes, and external references with the blacklist, and re-serialize the output after purification to avoid transmitting it in its original form.

Where does the in-site processing fall?

The upload purification process deals with the file content layer, which is not the same as the content review within the site. AnQiCMS's content security settings include sensitive word filtering, keyword replacement, and content review, which are for the main text; for the file layer, we need to check the upload verification, type restriction, and purification rules. If the attachment field is only stored as a string in the custom content model, purification will not take effect, and the field definition should align with the actual processing chain.

Common questions

Why not just allow bitmaps?Bitmaps also have historical parsing issues, and vector formats are indeed more efficient in icon scenarios. If you really need to tighten up, you can limit the type by field, but when the business needs to upload icons, cleaning up is more maintainable than banning.

Is storage isolation required after cleaning up?Suggestion. Store files by object or in separate directories, access paths do not accept script execution, which can reduce the consequences of missed cleaning.

Will remote screenshotting bring in similar content?Yes. Remote capture and backend upload go through the same format judgment, any place that is allowed must be synchronized cleaned, otherwise the capture channel becomes a bypass.

Related articles

The redirect address after successful login is brought by parameters, and if not verified, it may be used for what.

The login redirect parameter is an external controllable input. When no centralized verification is performed, a legitimate login process may be transformed into a bridge from a trusted domain to a phishing page. This article explains what such redirect addresses are used for, what types of values the whitelist should block, and the division of labor of captcha and frequency control on the login path.

2026-10-11

The page actually exists but always returns 404, what impact will it have on indexing?

The content is still in the library, but the front-end has deemed the page non-existent. The signal received by the search engine is that the resource has disappeared, and the inclusion and traffic will follow suit. This article explains why a unified error code is dangerous, the several cases of status codes being semantically分流, and the troubleshooting sequence of document status, pseudo-static rules, redirection, and site map configuration.

2026-10-11

Why returning a 503 when the site is upgraded and maintenance page is displayed is more reliable than returning a blank page

The MDN 503 document states that this status code indicates that the server is not ready to handle the request, common reasons include maintenance or overload, the response should only be used for temporary conditions and should ideally include the Retry-After header with the expected recovery time; the document also hints that 503 indicates a temporary issue and should not be cached. This article explains how to configure the status code, retry time, and caching during the maintenance window.

2026-10-11

Why would a translation be sent to someone in another language if the site negotiated the language in the request header and cached it?

The MDN Vary document specifies that this response header describes the method of request information that affects the response content outside of the URL, including Vary to ensure that the response is cached based on the listed header fields separately. The most common use is to construct a cache key during content negotiation. This article explains the cause of the translation string given to other visitors, how to declare the response, and the differences in the two methods of language arrangement.

2026-10-11

It was found that the answers cited first are often the entries at the top of the list, how should the page structure be arranged?

A cross-model test of six models, with a scale of 250,000 times, shows that thematic relevance and list position are the main factors determining the priority of the source being cited. Clear price information and newer timestamps also continue to help. This paper applies these conclusions to the layout of page structure, content model, and publication time.

2026-10-11

An audit has found that about one-tenth of the cited sources in AI answers are self-generated by the model. How should the content site view this number?

An audit of four generative search engines found that about 16% of the cited sources are synthetic sources generated by machines. This article explains that this number describes the composition of the citation list, not the content quality rating, and provides several links to maintain the source distinguishability on the site side.

2026-10-11

The third-party panel says that you can see which AI services are collecting content by opening the box, and what the site can do with this record

This type of panel provides network-level collection visibility: which AI services are accessing, whether there is a violation of the exclusion instructions. This article explains what this record can and cannot answer, as well as how the site aligns it with its own exclusion configuration, site description file, and access statistics before using it.

2026-10-11

Why would the count be lost under high concurrency when the visit volume is written to the database in real time each time, and what does the aggregation rewrite solve?

The count of each visit writing to the database belongs to a read-modify-write operation, which will cause incremental loss due to mutual overlap under concurrency. If the account is settled before the data is written to disk, it will also lose the received increment. This article explains which part the aggregation rewrite modifies, what recovery capabilities need to be considered, and how to read the official口径 such as 50 million PV per machine.

2026-10-11