The relationship filtering of the content API has not been purified, what data will the interface return more?

📅 2026-11-01 👁️ 0

When the relationship filtering of the content interface is not done and the query is not purified, what kind of data will be returned in excess? The direct answer is: the endpoint will spit out all the undeclared fields in the associated table, common ones include internal identifiers of authors on multi-level associations, password hashes of this kind of credential form data, order and user grouping fields, and draft and unpublished content.Determine it does not rely on guesswork, but rather obtain the difference set of the actual keys in the response body and the fields declared in the interface document, each item in the difference set belongs to the data that should not be disclosed.The cause chain is also clear: the filtering conditions come from the query string, which itself is external input, unfiltered, entering the query construction and result serialization stages, thereby bypassing the boundary of read permissions.

Why is the filtering condition the input

The relationship filtering generally allows the caller to specify three things: which associated field to filter by, to which level to retrieve associations, and whether to return records from a certain associated table at the same time.These three parameters are all from the request party, just like the form fields, which are not trustworthy. If the program directly concatenates them into the query statement, SQL injection has a foothold;If the echo of filtering conditions is rendered to the page without being processed, XSS gets an entry point; if the depth retrieved is unrestricted, sensitive fields in the association chain will naturally leak out.So the defense line cannot only be pressed on the JWT authentication layer: the authentication answer is 'Who can call', the purification answer is 'What can be transmitted and what can be brought back', the two layers are independent of each other, and any layer missing will leave a readable exposed surface.The filtering syntax should be treated as a configuration item, not as a convenient feature to be arbitrarily released.

Version range of the day's口径

There are examples of checkboxes in open-source content management programs, the associated filtering information of Strapi was exposed with the announcement number CVE-2026-27886, with a severity of nine and a third, affected versions from 4.0.0 to before 5.37.0, and the fix is in Strapi 5.37.0, registered in the same number in the GitHub Advisory Database.Here is only the repetition of the announcement facts and self-check entry, without elaborating on any exploitation process. The transferable rule is: sites staying on the old release line need to upgrade actively, just by looking at the access logs, it is not apparent that there is a field-level exposure;The affected range given in the announcement should be checked against your own deployment version section by section.

Parameter boundary self-inspection list

Parameter Type Main risk Whitelist practice
Related field name Trigger SQL injection by concatenating query, or read unauthorized related tables Directly reject the field set that can be filtered according to the content model declaration, and outside the set
Retrieve depth The level is too large, it brings out the certificate type fields in the associated chain The maximum level is limited, exceeding the limit is truncated according to the upper limit and an alarm is recorded
Sorting and pagination Column name reflected in the query statement Only registered column names are accepted, the value is converted to an integer and the upper limit is set
Comparison operator Extended to any combination of conditions Only a limited number of comparison semantics are opened, the rest are rejected
Field selection returned undeclared fields are returned with the response body Fixed output field list of the endpoint, extra keys are discarded in the serialization layer

The order of landing should start from the returned field, as it only modifies the output layer and has the lowest risk; then handle the associated field names and operators, which affect the query construction; finally, tighten the depth of retrieval.

Authorization and document collaboration

The interface document is an exposed accounting tool, each endpoint should clearly write readable fields, filterable fields, and allowed retrieval depth. Delete any declarations more than the code requires.Declare less than actually needed, the caller will create a filtering syntax to试探, which will actually amplify the risk. API calls issue authentication tokens with the least privilege, separate authorization for read and write classes, and do not include backend management endpoints in the scope of public tokens.The defense chain of the site itself must be configured in pairs: content sensitive word filtering to prevent entry, SQL injection and XSS defenses respectively at the query and rendering stages, and if one is missing, it should be supplemented from that stage.Before upgrading, run a regression test case first, write the three types of assertions related to data retrieval, field trimming, and depth limitation into the test case set, and confirm that the field returns are consistent with the document before providing external services.

Common questions

Question: If the interface returns a field that is not in the document, is it a vulnerability? Answer: It is a sign of information exposure. First, compare whether the extra fields involve credential data or unannounced content. If involved, handle it as a defect and tighten the output layer; if it is just redundant display fields, add it to the interface document and explain the purpose.

Ask: Can only doing authorization prevent this kind of multiple returns? Answer: No. Authorization controls the identity of the caller, and the filtering syntax is still effective within the scope of the same identity's capabilities. Legitimate callers can also make the endpoint return associated fields, and the whitelist for cleaning and field whitelist must exist independently of authorization.

Ask: The front-end indeed needs to display multi-level associated data, how to avoid SQL injection and XSS at the same time? Answer: Hand over the depth and fields to the server-side to decide, and the front-end only transmits options with business semantics; on the query side, go for parameterization and column name whitelist, and on the rendering side, escape the reflected content.治理, not rely on single-point filtering.

Related articles

Why would making a page into an HTML cache turn it into an entry point for executable code?

To speed up the front-end page by making it an HTML static cache, but if the content with parameters is reflected in the cache file exactly as it is and the cache product is then handed over to the script parsing engine, malicious code can be executed in the cache. There are two boundaries: strip executable tags when writing, and do not treat the cache directory as the script directory when parsing. After the repair, the historical cache should be cleared, and then check the pseudo-static rules and page structure.

2026-11-01

Why can't the registrar be changed within two months after changing the domain holder's email address?

Changing the name, organization, or email of the domain holder will trigger a transfer lock, during which the domain cannot be transferred to another registrar, regardless of whether the domain is due to expire. When scheduling website construction or replacing the host, this period needs to be reversed: first confirm that the holder's information is stable, then apply for the transfer code, and finally move the resolution. When managing multiple site domains, it is necessary to check if there are any domains that have just changed records.

2026-11-01

Static site hosting charges per head, how much does a five-person team need to pay in one year?

Static site hosting's free tier excludes deployment and bandwidth, but when it comes to team collaboration, it switches to per-head seat fees, plus additional minutes and traffic overages. For a team of five, the annual bill needs to be calculated separately for seats, overages, and construction. Self-hosted content management charges by resource rather than by headcount, and multiple sites sharing a single backend can also reduce unit costs, with memory usage reduced by about 80%.

2026-11-01

After turning off the switch for the Generative AI feature, can you still receive AI recommended traffic?

Turning off the Generative AI feature switch is different from turning off natural search: the former affects the display and traffic brought by that feature, while the latter affects regular inclusion and recommendation. Before making a judgment, first look at the two dates, the report data start date should be earlier than the switch effective date, and the observation window must be after the effective date. The recommended traffic should be checked by grouping the proxy sources, and changes should retain the rollback records.

2026-11-01

The traffic share of the Generative platform is rearranged in a year, which foreign trade websites should pay attention to which entry points

The traffic share among generative AI platforms has been significantly reordered within a year, making it unreliable to consider a single entry as the entire source. Foreign trade websites should keep separate accounts for each entry, compare the conversion differences with recommended sessions, and match corresponding landing pages for multi-language sites and multi-sites. Look back quarterly once to avoid using the share structure of the previous quarter to judge this quarter.

2026-11-01

First look at the crawling log to decide who to block, and find out which paths the proxy is accessing.

Before deciding which AI agents to intercept, first use the server to capture logs and group the access volume by agent identifier and access path. Most sites place llms.txt, which is almost never read, and the few that do read it are concentrated on a few paths. Understand the real access distribution before writing robots rules, which is more bandwidth-saving than copying others' intercept lists and easier to roll back and review.

2026-11-01

The content referenced by AI is generally more up-to-date, and for old articles, it's better to change the date or rewrite them.

The AI engine tends to reference fresh content, but the last modified time displayed on the page is not the same as the freshness of the facts. Only changing the date and not the conclusion will continue to be referenced by the expired judgment. First, check if the data, version, and conclusion are still valid, and then decide whether to supplement paragraphs, rewrite the entire article, or withdraw, and write the refresh rhythm into the schedule; make a backup before batch replacing fields to prevent accidentally harming other pages.

2026-11-01

Why can the template replacement of the form module become an entry point for code execution?

When the form module hands over the submitted content to the template for rendering, if the replaceable markers are not limited to safe sources, the field values may be treated as instructions and form an entry point for code execution. The defense is divided into two stages: on the input side, use captcha to block automated submissions and suspicious content, and on the rendering side, only whitelist markers are allowed. External modules need to be on the version list, and once the announcement is made, it can be located to one's own site.

2026-11-01