Tools

Cloudflare Workers

Cloudflare Workers is a service for running functions at the edge of the Cloudflare network. The available source describes its use in multiple applications and tools, and it was also associated with a security incident in which a malicious Worker was used to modify responses at the edge.

Cloudflare Workers is a service for running functions at the edge of the Cloudflare network. It enables developers to execute application logic close to the request path and has appeared in the sources in connection with developer platform tools, video processing, and observability.

Uses mentioned in the sources

  • Using Workers within the Streamline project to handle control and monitoring signals and the application interface in video processing pipelines.
  • Building an EmDash content management system that runs on Workers, with plugins isolated inside Worker environments and predefined permissions.
  • Running applications and tools connected to other Cloudflare services, such as Durable Objects, Containers, and Cloudflare Stream.
  • Displaying Workers execution as a stage within the request path in Cloudflare Traces.

Role in the mentioned security incident

According to a BleepingComputer report based on a Brevo investigation, a stolen API key with full permissions was used to create a malicious Worker, routes, and DNS records. The Worker modified responses at the distribution network edge and injected ClickFix scripts into Brevo websites and JavaScript files embedded by customers. It also removed security headers, including Content-Security-Policy, while the origin servers and original files remained unchanged.

The source does not establish that Cloudflare Workers itself caused the breach; rather, it explains that possession of broadly privileged credentials enabled the attackers to create a Worker and use it to modify responses.

Key points

  • Modifying responses at the edge can affect the content delivered to visitors even when source files or origin servers are unchanged.
  • Expanding API key permissions or embedding them in code increases the impact of a compromise.
  • Distribution of JavaScript files or third-party components can extend the effect of the modification to customer websites that use them.