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

📅 2026-10-11 👁️ 20

The redirection address after successful login is brought by parameters, this itself is a reasonable design: the user should return to the original page after being required to log in from a page. The problem lies in the fact that this parameter is completely provided by the outside, and when it is not verified, the attacker only needs to replace it with his own address. This kind of defect is usually called open redirect, it does not change a line of code logic, just replacing 'intra-site address' with 'any address'.

What will be done without verification

The first usage is a phishing jump page. The domain of the link is real, but the path and query string are fake, and the user sees a familiar main domain in the address bar, the login page is also indeed real, but after logging in, it falls onto a fake page, which continues to ask for secondary verification information or诱导下载. Because the jump is initiated by the trusted site itself, the credibility judgment of the link in emails and instant messaging is also easier to pass.

The second usage is配合脚本协议。If the script prefix is allowed, the page does not leave the current domain, but executes the external code provided within the current domain, and the consequences are borne by the logged-in session. You can see these two things written into the same fix in the public version records: PbootCMS records「Fixing member login backurl open redirect and javascript: XSS, centralized verification and safe output of jump URL」in V3.2.24.

The third method is to bypass audit. Some sites attach behavior statistics and source judgment after login to the jump parameters, and the replacement of parameters means that subsequent actions also fall into the wrong context.

Concentrate on checking which types of values need to be blocked.

The check points should be centralized, not scattered in the template. The template can have its own style, but the judgment of jump address can only be one place.

There are roughly four types of values that need to be blocked:

  • Absolute address: external addresses with protocol and host, all require returning to the domain names within the whitelist; different subdomains under the same domain must also be listed explicitly, not relying on suffix matching.
  • The relative writing of the protocol: The writing starting with double slashes is parsed as an external host, which is the most common leak point.
  • Script prefix: Any value starting with the script protocol should not be a target for jump, it should be discarded directly and return to the default address.
  • Encoding deformation: The pseudo-writing composed of multi-layer percentage encoding, white space characters, and control characters should be normalized first before judgment, judged and then output, and re-encoded according to the target context when outputting.

After the verification is passed, there is still one step: output this address safely. Piling the already verified values directly into the script or properties is equivalent to invalidating the previous verification; AnQiCMS has done defense against SQL injection and cross-site scripting at the content layer, and built-in JWT authentication to ensure that the session identifier is not forged. These two solutions address different levels of problems and are indispensable.

The other two defenses on the login chain

The redirect verification manages where to go after logging in, and there are two more sections to manage. The form side接入reCAPTCHA verification code is used to distinguish between real humans and batch scripts, it blocks automated attempts and does not replace password verification; another layer in is frequency control and failure limit, to avoid the same batch of accounts being repeatedly tested.

There is one thing that needs to be clarified: anti-collection and interference codes are aimed at content being batched, and are not on the same path as login redirection, do not configure the two as the same type of protection.

Common questions

Isn't it enough to just use relative paths?Relative paths can block external hosts, but they cannot block the injected content in the page after in-site jump; still need to verify the path segment to avoid falling on unexpected pages.

Where should the whitelist be configured?Configured in the project or site settings, read by the program, do not hardcode in the template. In the case of multi-site scenarios, the back jump domains of each site are different, and the whitelist should follow the site.

Do you need to verify the login status after the check?Yes. The validity of the jump address does not mean that the current session has the right to access the target page, and the two things should be judged separately.

Related articles

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

After logging in, the page is stored in a shared cache, and how should the private and non-cacheable headers in the cache header be written.

The MDN's Cache-Control document states that 'no-store' indicates that no type of cache should store the response, 'private' means that it can only be stored in private caches, and it also hints that shared caches will reuse a response for multiple users, and personalized content should not be given to it. This article explains the boundaries of both and why member-tiered pages are more likely to have issues.

2026-10-11

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

Vector icons are not image data, but a document format that can include script elements. When uploading, it is necessary to filter out scripts and event attributes, external references, and large decompression volumes, while retaining normal display content. This article discusses the trade-offs between the cleaning list and black and white list strategies.

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