heuristic
function_tostring_self
family
automation.tamper
severity
critical
reads
vectors.tamper.toStringSelf
reader
readAutomation() covers the generic tamper flag; this rule reads the block directly
since
ruleset r3

The check that checks the checker

Raised when vectors.tamper.toStringSelf does not itself contain the native-code placeholder form.

Read this row before any other tamper row, because it says whether the instrument doing the measuring was itself replaced. A raised reading here does not add a finding, it removes your grounds for trusting the ten-function finding beside it.

What function_tostring_self reads

Every check in the rule above runs through `Function.prototype.toString`. A spoofer that knows this replaces that function first, so that it lies about all the others — and, in a well-built one, about itself.

The collector therefore calls `Function.prototype.toString` on `Function.prototype.toString` and stores the result whole. If the returned source is not the native placeholder, the patch did not cover its own tracks, and every other reading in this family is confirmed rather than merely suggested.

This is the only heuristic on the site whose result changes how you should read another heuristic. If it is raised, `patched_natives` is reporting a floor, not a total.

Who reads this signal

The self-referential form of this check appears in public detection code and in academic work on JavaScript instrumentation. No vendor documentation is cited here because none names it.

In our correspondence index this heuristic is listed alongside DataDome , HUMAN (PerimeterX) and Kasada . That correspondence is our reading of which products have access to this class of signal. It is not a claim that any of them checks this, and no test against any of them has been run.

When function_tostring_self fires on an ordinary browser

Any tool that instruments `toString` for legitimate reasons — some debuggers, coverage tools and userscript managers — will produce this.

What a clean reading looks like

Clean is what licenses the rest of the family. With this reading clean, the ten-function result is a complete list; without it, the honest sentence is that you know functions were replaced and cannot know how many, and the plan states that inline rather than leaving you to infer it.

What actually moves function_tostring_self

The same answer as the rule above: change values in the engine and there is nothing to patch in the page.

What changing this flag does to the plan

No other row here changes how a different row should be read, and the plan states that dependency where you will see it rather than leaving you to work it out. If it moves from unchanged to raised between two runs, the correct reading of that diff is not that one new thing was found: it is that the previous run's tamper readings were taken with a ruler you can no longer trust, and the comparison you were about to make is void.

Questions about function_tostring_self

Why check toString on toString itself?

Because a patch that lies about other functions and tells the truth about itself is trivially caught, and one that lies about itself changes what every other tamper reading means. The self-referential call is the cheapest available statement about whether the measuring instrument was replaced, and it costs one function call.

What does it mean when Function.prototype.toString is not native?

That something replaced the mechanism the runtime uses to report function sources. It is done by debuggers, coverage tools and userscript managers for legitimate reasons, and by fingerprint spoofers to cover replacements elsewhere. The plan stores the returned source whole so that the two cases can be told apart by reading rather than by assuming.

Can this rule be defeated completely?

A sufficiently careful page-level patch can return the placeholder for itself and for everything it replaced. At that point the page-level checks in this family stop being informative, which is exactly why the ruleset also carries a cross-context check that no page-level patch reaches: the Worker gets its own copy of the runtime.

Read next

the ten checked natives The functions whose readings this rule licenses or invalidates, and why that particular set was chosen.
the cross-context check The rule a page-level patch cannot reach, because a Worker gets its own global scope and its own copy of the runtime.
what this page cannot see The limits of running every check inside the page, stated plainly, including the ones this rule cannot resolve.

Change what this row says

The endgame of page-level spoofing is a patch that lies convincingly about itself, and the endgame of page-level detection is a check that does not go through the patched surface at all. Donut Browser sidesteps the exchange: with the fingerprint applied in the engine there is no replacement anywhere for this rule to be careful about. Install it, run this plan in a profile, and compare the tamper family against the record you saved beforehand.

curl -fsSL https://donutbrowser.com/install.sh | sh
Download Donut Browser macOS, Windows, Linux · AGPL-3.0 · zero telemetry · what it changes and what it does not

To see this heuristic's reading for your own browser, run the plan. Nothing on this page has read anything about you.