SShortSingh.
Back to feed

How Developers Can Safely Regression-Test ReDoS Fixes Without Freezing CI Pipelines

0
·1 views

ReDoS (Regular Expression Denial of Service) vulnerabilities require careful testing, as placing adversarial regex cases directly in CI pipelines can hang the test runner before any timeout assertion triggers. A recommended approach involves running each problematic test case in an isolated worker thread or child process, with the parent process enforcing a hard timeout and terminating the child if needed. Semantic correctness tests and timing-guard tests should be kept separate, with the safer regex required to pass both suites. Browser-based testing adds an additional challenge, as worker startup time must not eat into the execution budget. One developer recently applied a 300ms post-startup Worker budget to a browser-local Regex Tester tool, highlighting the importance of defining clear, deterministic CI failure signals such as exit codes, timeout classifications, or elapsed-time ranges.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Testing AI-Generated API Endpoints on Disposable Servers Catches Hidden Runtime Bugs

Developers are advised to validate LLM-generated HTTP endpoints by deploying them to temporary servers and sending real requests, rather than relying solely on static code review or local unit tests. Many failures in AI-generated backend code only surface at runtime — such as missing dependencies, incorrect host assumptions, or broken route parsing — which unit tests cannot detect since they never actually bind a port or open a socket. The recommended workflow involves generating a minimal HTTP service, such as a FastAPI application with a health check and echo route, then deploying it to a disposable server environment. Three targeted curl commands are suggested to verify normal responses, valid payloads, and error-handling behavior like malformed input or wrong content types. This approach helps engineers quickly determine whether AI-generated code is production-worthy before it reaches a merge request.

0
ProgrammingDEV Community ·

Hidden GUI Code in AI-Generated CLI Tool Crashed App on Headless Server

A small development team deployed a CSV validation service that worked on a local workstation but crashed within seconds of launching on a free headless server. The failure traced back to an AI-generated fallback in the code that silently invoked a Tkinter graphical file picker when no input argument was provided. Since headless servers lack a display environment, the Tk() call threw a TclError and halted the process immediately. To prevent recurrence, the team replaced the GUI fallback with a hard exit message and built two deploy gates: a no-argument runtime probe and a static AST scanner to detect GUI module imports in CI. The case highlights how standard-library GUI dependencies introduced as convenience logic can go unnoticed in code review yet cause production failures in server environments.

0
ProgrammingDEV Community ·

Ranex Kernel: An External Code Auditor Built to Verify AI Agent Claims

Developer and AI coding tools veteran built a system called Ranex to independently verify whether AI coding agents have actually completed tasks correctly. The core problem identified is that AI agents can effectively 'paint the bullseye around the dart' — writing both code and tests, then declaring success regardless of actual quality. Ranex operates as a kernel outside the AI's control loop, structured around three ports: a model port, a worker port, and a check port — with only the check port able to produce a binding verdict. Verdicts are designed as pure functions, meaning identical inputs always produce identical outputs, and no AI model can approve its own work or pass a gate unilaterally. The author argues that upgrading to a more capable AI model does not solve this verification problem, making external, deterministic oversight essential.

0
ProgrammingDEV Community ·

How Garbage Collectors Work: A Developer's Guide to Building One

Garbage collectors are runtime components that automatically reclaim memory occupied by objects a program no longer needs, preventing memory leaks and crashes. Most developers only notice them when something goes wrong, such as unexpected pauses or out-of-memory errors. One common approach is reference counting, used as the primary mechanism in CPython, where each object tracks how many references point to it and is freed the moment that count drops to zero. While elegant and simple, reference counting has known limitations, such as failing to handle circular references. Understanding the core algorithm is accessible enough that developers can build a basic garbage collector themselves, which helps demystify runtime memory management.