Starter themes and embeddable widgets arrive with conveniences—typography, navigation, a dark-mode toggle—and sometimes components already wired for third-party trackers, waiting only for an account ID. Because reviewing every line feels expensive, unwanted features and unneeded code often stay in place: if a feature came for free, the reasoning goes, it may as well be used.

That shortcut carries cost. What gets embedded on a site without full understanding cedes control of that feature to a third party. Assumptions fill the gap—that the maintainer knows best because the repository has many stars, or that a recognizable name uses the same script—and the package's legitimacy goes unchecked.

What can go wrong

Malicious code

Popular npm packages have been found carrying malicious scripts that steal passwords and perform other attacks. Cryptojacking—mining cryptocurrency on a site without the operator's knowledge—is more common, and Alibaba Cloud services were recently targeted to mine Monero. A paying customer can at least hope the provider reports a compromise promptly; with an open source package, discovery depends on being online when someone finds the vulnerability so sites can be updated quickly.

Unreliable dependencies

Some third parties behind critical features are simply unreliable. Outages of major internet infrastructure are treated as a joke about an easy workday, but sites that provide vital utilities and information face real consequences.

Third-party services have long been sold as a performance fix, and occasionally a service genuinely serves a site faster and from more locations than could be assembled in-house. Yet the majority of the most popular sites on the web embed far more than one third-party script. From work on Better Blocker, around ten third-party scripts is low and as many as thirty on a single homepage is common, particularly on news sites—a count that raises the question of whether so many scripts help performance.

Exposure of visitors

Regardless of whether an embedded feature is malicious, incompetent, unreliable or working as advertised, it remains a privacy risk to visitors. Developer experience tends to dominate, and it is easy to forget these tools build experiences for other people, with a corresponding responsibility not to put visitors at risk.

Any third-party script, or any resource able to log visitor information, can count as a tracker; at minimum it carries tracker potential. Analytics, fonts, iframes, content delivery networks and CAPTCHAs all can collect information about visitors. What is collected, how much and how often depends on what the feature does and the access granted to it. Data tied to an individual could be used to sell them ads, build sellable profiles or even discriminate against them.

Reducing exposure

Privacy is not a popular topic in the web community, and it can feel like the bottom of a slippery slope has already been reached. Small changes still protect visitors, even starting with personal projects.

  • Audit existing tools. Ask whether two analytics scripts are really needed and whether a font can be embedded locally. Reviewing current tools makes improvement manageable incrementally, with better site performance as a bonus.
  • Switch to privacy-respecting alternatives. Such alternatives to mainstream technology have grown more popular in recent years. Two directories help: switching.software for finding replacements and Good Reports, which explains the reasoning behind its recommendations.

Legal issues around web privacy are a separate matter. Adhering to laws protecting rights is essential, but caring about visitors' privacy produces better experiences than worrying about what can be gotten away with legally. Privacy is not as hard as abandoning defaults, time-saving tools or habits copied uncritically from colleagues—and each tracker removed one at a time makes a difference.