Content Spoofing (Text Injection)
The application displays text taken from the request as part of its own page, so an attacker can make the site show misleading messages to users who follow a crafted link.
| Severity | Medium |
| CVSS 3.1 | 4.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N Open in the calculator |
| CVSS 4.0 | 5.1 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-451: User Interface (UI) Misrepresentation of Critical Information |
| OWASP Top 10 | A06:2025 Insecure Design |
| MITRE ATT&CK | T1598.003 Spearphishing Link |
| Category | Input Validation |
Description
The application takes text from the request, typically from a URL parameter or the path, and displays it in a page as though it were the site's own content, for example as an error, status or welcome message. The text is correctly encoded, so no markup or script can be injected, but its wording is entirely under the control of whoever built the link.
An attacker can therefore write a message that appears on the genuine site, under its address and certificate, such as a warning that an account has been suspended together with a telephone number or web address to contact. Links to the genuine site can in this way support phishing and other social engineering, for example directing users to call a fraudulent support line or to visit a look-alike site, with the credibility of the organisation's own domain. The attacker cannot change data, run script or read anything from the application, and each victim must open the crafted link and act on the message, so the impact depends on how convincingly the text fits the page.
The weakness typically shows itself on a test when a parameter such as message or error is changed to arbitrary text and the page displays it where the site's own messages appear. Pages that echo the requested path, such as custom error pages, are a common variant. It differs from HTML injection in that only plain text can be injected, and some scanners report it as text injection.
Remediation
Keep the wording of the site's messages under the application's control:
- Do not take the text of user-facing messages from the request. Pass a short message code instead, look up the text in a fixed set held by the application, and reject unknown codes.
- Where user input must be shown, such as a search term, present it clearly as the user's own input, for example quoted after a fixed label, and limit its length.
- Avoid echoing the requested path in error pages, or truncate it and label it as the address requested.
- Validate parameters against their expected format and length, as for any other input.
Confirm the fix by repeating the original requests with arbitrary text and checking that it is no longer displayed as a message from the site.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.