Unays Learn · Editing challenge

Find the data leak

Below is a real-looking feedback form. It works fine on the surface, but its code secretly sends everything a visitor types to an outside server, without telling them. Your job: edit the code so the form still works, but nothing leaves the browser except what belongs there.

This is a safe simulation. Nothing you type here, and nothing the sample code tries to send, ever leaves your browser. The address it tries to contact doesn't exist, and this page actively blocks every outgoing request and shows it to you instead of letting it through. You're learning to spot and stop a real technique called data leaking, used in real phishing and “formjacking” attacks.

How to do this

  1. Click Run to load the form in the preview.
  2. In the preview, type a name and a message, then click Send feedback.
  3. Watch the Security Monitor on the right. If it turns red, the code just tried to send data somewhere it shouldn't.
  4. Edit the code on the left to stop it, then click Run again and test once more.
  5. When you can send feedback and the monitor stays green, you've fixed the leak.
Hint 1: where to look

Read every function the code calls when the form is submitted. One of them does more than its name suggests.

Hint 2: what "normal" looks like

Showing the feedback back on the page itself, in the "Recent feedback" list, is fine: that data never leaves the browser. Sending the visitor's name and message to a different website, especially one nobody mentioned, is not fine, even if the function is named like something harmless such as "analytics" or "tracking".

Hint 3: a fix

Stop calling the function that sends data to insightify-metrics.example — either delete the call, delete the function, or rewrite it so it no longer sends anyone's name or message anywhere. The form can still work perfectly without it.

Real trackers and malicious scripts use exactly this trick: a form that looks normal, plus one quiet line of code that copies what people type to a server the site's own team never agreed to. It's one reason to think carefully before typing a password or personal details into any form, and why developers review code like this before it goes live.

index.html

Preview

Security Monitor

Click Run, then try the form.

    This exercise was written with AI assistance and reviewed by Unays. It is a simulation for learning: no real network requests ever leave this page. Spotted a mistake? Tell us at [email protected].