Boundary Fuzzing & Malformed Payload Generation
Synthetic Test Data Sprint β Day 5
Test API resilience against extreme numeric boundaries, Unicode injection vectors, SQL/XSS exploit strings, and programmatic schema mutation fuzzing.
APIs don't just receive happy-path payloads. They receive 64-bit integer overflows, zero-width Unicode spaces, null bytes, and SQL injection strings. In this lab, you build a mutation fuzzer that systematically tests how robustly microservices reject or sanitize malicious payloads.
The official reference codebase for Day 5 is hosted in the repository. Clone the repository and navigate to day-5-boundary-fuzzing to run the working solution.
git clone https://github.com/777abhi/synthetic-test-data-roadmap.git
cd synthetic-test-data-roadmap/day-5-boundary-fuzzingInspect Boundary Fuzzing Engine
Review numeric boundaries, exploit string catalogs, and schema mutators.
cat synthlab/boundary_fuzzer.py | head -45import unittest
from synthlab.boundary_fuzzer import BoundaryFuzzer, SchemaMutator
from synthlab.schema_engine import SchemaValidator, ValidationError
class TestDay5BoundaryFuzzing(unittest.TestCase):
def setUp(self):
self.mutator = SchemaMutator(seed=777)
self.valid_payload = {"order_id": "ord_9999", "quantity": 5, "total_usd": 49.99}
def test_dropped_required_field_mutant_fails_schema(self):
mutant, label = self.mutator.drop_required_field(self.valid_payload, ["order_id", "quantity"])
with self.assertRaises(ValidationError):
SchemaValidator.validate(mutant, self.schema)
def test_type_flip_mutant_fails_schema(self):
mutant, label = self.mutator.flip_data_type(self.valid_payload, "quantity")
self.assertIsInstance(mutant["quantity"], str)
with self.assertRaises(ValidationError):
SchemaValidator.validate(mutant, self.schema)Execute Day 5 Tests
Run the boundary fuzzing and mutation test suite.
npm run test:day5- Curated boundary vectors covering int16/int32/int64 limits, floating-point subnormals, and NaNs.
- Assembled high-impact string exploit catalogs including SQLi, XSS, SSTI, Log4Shell, and Unicode RTL.
- Created programmatic schema mutators that flip types, omit required fields, and verify graceful 400 rejection.
π§ Knowledge Check
What should a well-architected microservice API do when receiving an adversarial boundary mutant?