Software Engineering
Researchers develop tool to catch duplicate payment charges hidden across multiple config files
A new static analysis checker identifies exactly-once violations in streaming payment systems by correlating settings scattered across separate configuration artifacts.
Payment processing systems can inadvertently charge customers multiple times after a restart, but detecting this vulnerability requires cross-referencing configuration details that live in different files and documentation—work that nobody typically does.
The Hidden Fault#
A streaming payment pipeline's safety hinges on a critical but rarely examined gap: comparing how long a payment provider remembers an idempotency key against the maximum staleness of a record when the pipeline reprocesses it. The idempotency retention window appears in the provider's official documentation, but the stale-record age is never explicitly written down. Instead, it must be pieced together from fragments scattered across the system: a checkpoint interval in one file, recovery assumptions in a runbook, restart delays elsewhere, and source lateness bounds in a fourth location. Each individual artifact is defensible and correct in isolation, yet the relationships between them harbor the defect.
Automated Detection and Testing#
Researchers have created a static checker that gathers these facts and validates the relationships between them. The tool went further, synthesizing 335 of 515 detected violations into runnable test scenarios that explicitly specify: which records to inject, where in the job lifecycle to kill it, how long to wait before restarting, and what observable outcome to expect. Of the synthesized scenarios, 245 produced duplicate charges.
The team measured how widely the problematic evidence is distributed across codebases. In a corpus of 630 generated pipelines, 210 could not be diagnosed from fewer than three separate artifacts. No single configuration file alone accounted for more than 35 of the 305 detected duration violations.
Validation Against Real Infrastructure#
All 16 live test scenarios were executed against a real Kafka broker with actual process termination, confirming the predicted observable behaviors. Matched controls—where the payment provider's idempotency key never expires—did not reproduce the duplicate charges, confirming that the fault lay in the key lifetime mismatch, not replay logic elsewhere.
Traditional fault injection proved far less effective: a tester simulating five-minute outages caught only 15% of the defects, while 12 hours of simulated downtime was necessary to surface them all. The analysis also uncovered a configuration scenario with no application-level remedy: recovery assumptions above 14 minutes would require transaction timeouts exceeding the broker's hard limit.