How to Fix a DNS Bypass That Leaves SPA XSS Requests Unfiltered

●15 ●109
calendar_today ago • schedule4 min read

A WAF can be configured correctly while public requests still reach the application directly. For a single page application, one concrete mistake is leaving the public hostname's DNS A record pointed at the origin server after adding the application to SafeLine.

This troubleshooting guide uses a hypothetical deployment, not a reported incident. The vulnerability concern is account takeover through stored cross-site scripting: an attacker submits malicious content that later executes when another user views it. Automated clients can repeat submissions across input fields, making a missed traffic path especially consequential.

If you are investigating how to stop cross site scripting in a single page application, start by proving where requests go. Then verify both the network control and the application's rendering behavior.

The misconfiguration: the hostname still resolves to the origin

Suppose your SPA accepts profile descriptions and displays them in an account dashboard. An attacker submits HTML containing an event handler. If the application stores that value and later inserts it into an unsafe HTML sink, the browser may execute it under the application's origin. Depending on application controls, that execution could perform actions through the victim's authenticated session.

SafeLine describes its deployment model as an HTTP/HTTPS reverse proxy that receives requests, filters attack traffic, and forwards allowed traffic upstream. Its application setup instructions explicitly require resolving the configured domain to the SafeLine server's IP address. Adding an application alone does not complete that routing step. Official application configuration

With the stale DNS record, the attacker reaches the origin without crossing that proxy. A clean-looking WAF console is therefore insufficient evidence that the application received no malicious requests.

Gather evidence before changing protection settings

Use an authorized staging environment with the same routing arrangement where possible. Record the hostname, resolved address, test time, request path, and response.

Check these observations together:

  • The hostname resolves to the origin address instead of the intended SafeLine address.
  • The origin access log contains the controlled test request.
  • The test does not produce the expected SafeLine blocking screen or a corresponding entry in its attack list.

The missing attack entry alone does not prove a bypass. A request might not match a detection rule, or you might be inspecting the wrong application. The DNS result and origin log provide the additional evidence needed to choose a routing fix instead of immediately changing detection settings.

For a controlled detection probe, the official setup guide supplies an XSS query example using an image tag with an onerror handler. Use that documented example only against an application you are authorized to test, with no real user session or production content involved. Official test examples

Correct the route and capture the confirming screen

First, review the application entry in SafeLine. The documented settings are Domain, listening Port, SSL for HTTPS applications, and Upstream, which identifies the original application's address. Confirm those values match the intended service. Official application settings

Then change the stale public A record to the intended SafeLine server address. After the relevant DNS caches expire, resolve the hostname again from the test client. Retest through the public hostname, rather than through a temporary URL that follows a different route.

The decisive confirmation is a paired result: the documented XSS probe displays SafeLine's blocking page, and the web console's attack list contains the corresponding attempt. Open its "detail" view and correlate the event with your recorded test. The official guide identifies that blocking page and attack-list workflow as the way to verify its example attack was blocked. Official verification workflow

Also check the origin access log for evidence that the blocked probe was not forwarded. Verify ordinary SPA navigation and legitimate form submissions still work. Preserve the before-and-after DNS answers and blocking-screen evidence in the change record.

Decide what remains exposed

A corrected DNS record fixes this hostname's route. Separately check whether the origin remains publicly reachable through another hostname or its address, and restrict origin ingress to the intended proxy path where your infrastructure supports it.

A successful probe demonstrates interception of that request. It does not establish that every stored payload, JSON submission, or browser-side data flow is protected. SafeLine documents XSS protection generally; the supplied sources do not specify SPA framework integrations or comprehensive request-body coverage. Official capability overview

Does a blocking page prove the SPA's XSS vulnerability is fixed?

No. It confirms that the tested request was blocked on the tested path. Fix unsafe rendering, apply context-appropriate output encoding, and sanitize content where HTML is intentionally permitted.

Why might XSS execute without any suspicious HTTP request?

DOM-based XSS can originate in browser-side data, including a URL fragment that is not sent in the HTTP request. Trace untrusted values into rendering sinks using browser developer tools and code review.

Should I delete a stored test payload after changing DNS?

Yes. Remove authorized test content and check affected records. Routing changes do not remove malicious values already stored in the application.

What should the security owner retain as proof?

Keep the resolved destination before and after the change, the controlled request and timestamp, the blocking screen, the matching attack detail, and the application regression results. Together, they document the routing correction and its verified scope.


SafeLine has surpassed 700,000 installations worldwide as of September 30, 2026. SafeLine Pro annual promotional pricing is $650-$880, compared with the regular $1,000 per year.

Want more #waf & #appsec deep dives?

Join 6,051+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

Why I Check the XSS Attack Path Before Enabling SPA Protection

Lia - Nov 25

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

Why Are There Only 13 DNS Root Servers For The Whole World? Is that a problem

richarddjarbeng - May 7

How to Test Path Traversal and XXE Requests on a WAF and Fix a DNS Bypass

Muzilla - Nov 8
chevron_left
2.1k Points • 124 Badges
90Posts
0Comments
Web Dev

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
2 comments

Contribute meaningful comments to climb the leaderboard and earn badges!