---
title: "Protecting user data through source code analysis at scale"
description: "Meta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships."
url: "https://swe.quest/articles/protecting-user-data-through-source-code-analysis-at-scale-357585a0d96f83c8"
canonical: "https://engineering.fb.com/2025/02/18/security/protecting-user-data-through-source-code-analysis/"
source: "Meta Engineering"
published: "2025-02-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["static-analysis","threat-detection","appsec","python"]
---

# Protecting user data through source code analysis at scale

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2025-02-18, 4 min read, Case study. Original: [https://engineering.fb.com/2025/02/18/security/protecting-user-data-through-source-code-analysis/](https://engineering.fb.com/2025/02/18/security/protecting-user-data-through-source-code-analysis/)

## Summary

Meta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships. Rules define sources (user-controlled parameters such as a result count or target ID) and sinks (data returned to the user), and a possible flow between them is raised as an issue for triage. In a mock followers endpoint, an uncapped count lets scrapers pull entire follower lists in one request and slip past rate limiting. The fix clamps count to a maximum, forcing scrapers into many more requests that rate limits then catch. Static analysis cannot catch scrapers that mimic legitimate usage, so it is one part of a broader defense.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Static analysis](https://swe.quest/tags/static-analysis.md) (Engineering practices)
- [Threat detection](https://swe.quest/tags/threat-detection.md) (Security)
- [Application security](https://swe.quest/tags/appsec.md) (Security)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- taint analysis basics
- rate limiting

## Keywords

Zoncolan, Pysa, Hack, Meta

## Related posts

- [Automating dead code cleanup](https://swe.quest/articles/automating-dead-code-cleanup-e03bc4ba07b5bf1c.md): Meta Engineering · 2023-10-24 · Medium · 7 min read · Static analysis, Refactoring & migrations, Developer productivity, Python
  Meta's SCARF framework finds dead code by building a cross-language, symbol-level dependency graph from Glean and augmenting it with runtime usage data such as API endpoint logs, URI dispatch tables and async job invocations, then garbage-collects unreachable nodes, subgraphs and cycles.
- [From single pull requests to full software packages: Detecting malicious code at scale](https://swe.quest/articles/from-single-pull-requests-to-full-software-packages-detecting-malicious-code-at-717a58a001a046a1.md): Datadog Engineering · 2026-06-02 · Medium · 12 min read · Supply chain security, Threat detection, AI agents, LLMs, Cost optimization
  Datadog extended BewAIre, its LLM-based malicious code detector, from pull requests to full dependency packages by stacking a cheap filter model in front of an agentic investigation model.
- [Separating the signal from the noise](https://swe.quest/articles/separating-the-signal-from-the-noise-2cc71e79b18e0d15.md): Engineering@Microsoft · 2021-07-06 · Easy · 3 min read · Static analysis, Developer productivity, Security
  Noisy static analysis rules train developers to ignore all tool findings, including critical ones, so engineering system owners should prune false-positive-prone rules.
- [Automating product deprecation](https://swe.quest/articles/automating-product-deprecation-9c964f5b3db1d6d5.md): Meta Engineering · 2023-10-17 · Medium · 10 min read · Refactoring & migrations, Developer productivity, Static analysis, Developer tools
  SCARF (Systematic Code and Asset Removal Framework) is Meta's tooling for deprecating products by removing dead code and unused data, credited with deleting over 100M lines of code in five years and petabytes of data across 12.8M data types in 21 systems in one year.
- [How Meta built large-scale cryptographic monitoring](https://swe.quest/articles/how-meta-built-large-scale-cryptographic-monitoring-007f3fb06e949eb9.md): Meta Engineering · 2024-11-12 · Medium · 10 min read · Cryptography, Observability, Scaling, C & C++
  Meta logs every operation in FBCrypto, its managed cryptographic library, without sampling by aggregating identical events into per-event counts in an in-process buffer and flushing them periodically to Scribe, with data landing in Scuba and Hive.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
