HabrAugust 17, 2026🇷🇺Translated from Russian

Reversing MD5 Hash Function from 2500-Layer Neural Network in Jane Street CTF Puzzle

A Jane Street puzzle released in February last year presented participants with a complete PyTorch model in pickle format containing roughly 2500 linear layers. The model, stored in model.pt, produced an output of 0 for almost every input, including the example strings “vegetable dog”. The challenge required discovering an input that would make the network return a non-zero value without relying on gradient descent or exhaustive search.

Initial inspection of the output layers

Participant Alex began by examining the final two linear layers. The last layer was a 48×1 weight matrix clearly divided into three equal sections, while the preceding layer contained three copies of identical weights together with a repeating 16-byte bias pattern incremented by one each time. This structure indicated that the network maintained three versions of a 16-byte vector v and compared them against a secret target x using the combination v, v+1, v+2. The final layer applied weights 1, −2 and 1, so that only an exact match across all 16 bytes produced a positive result after the bias of −15 was applied.

Network simplification and constraint solving

The remaining 2500 layers formed a directed acyclic graph of integer operations. Alex modeled the entire network as an integer linear program, introducing binary variables to encode the behavior of each ReLU activation. After repeated simplifications—merging identity mappings, removing redundant ReLUs on strictly positive paths, and collapsing duplicate neurons—the problem size dropped from approximately two million nodes to 75 000. Even then, both an ILP solver and a subsequent SAT encoding with 200 000 variables failed to finish within practical time limits.

Discovery of the MD5 core

Plotting layer widths revealed 32 identical periods of length 48. Consulting common cryptographic primitives, Alex recognized the structure of the MD5 compression function. Manual verification confirmed that intermediate activations matched MD5 round constants and state variables, while other hash functions did not. The target 128-bit value was already visible in the bias of the penultimate layer, reducing the original problem to finding a preimage under that specific MD5 hash.

Unintentional length-encoding bug

Further reverse engineering exposed a flaw in the first seven layers responsible for encoding message length in little-endian format. When the input length reached or exceeded 256 bits, the network stored the raw integer 256 instead of the correct four-byte representation. This error affected only a subset of MD5 blocks yet prevented correct hashing for any input longer than 32 bytes. The bug was later confirmed by the puzzle authors to be unintentional.

Final solution

Once the algorithm and the target hash were known, the remaining task was a modest brute-force search over two-word English phrases. A larger word list quickly yielded the correct input that satisfied the hidden MD5 value. The puzzle demonstrated that a carefully constructed neural network can embed a non-differentiable cryptographic routine while still remaining solvable through systematic simplification and algorithmic insight.

Related articles

HabrAI Security

Adaptive LLM Worm Uses Local Models to Craft Per-Target Exploits in Heterogeneous Networks

Researchers from the University of Toronto have published a preprint describing an adaptive computer worm driven by LLM agents that spreads across corporate networks by generating individualized attack strategies for each compromised system. Unlike traditional worms such as WannaCry that rely on fixed exploits, this worm maintains its own infrastructure by running local LLMs on infected GPU-equipped machines to analyze vulnerabilities and synthesize new attack vectors in real time. The system was tested in an isolated FakeCorp environment containing Linux, Windows, and IoT devices, successfully leveraging known real-world vulnerabilities to propagate over 48 hours and seven-day autonomous runs. Two core components power the worm: a GPU-hosted LLM component and a hierarchical agent framework with memory, reasoning graph, and tool modules that manage reconnaissance, exploitation, and payload deployment. The authors note that the approach creates an economic asymmetry favoring attackers because the worm parasitizes victim compute resources, eliminating the need for external C2 or commercial LLM services. They warn that adding adaptive reasoning to historical worms such as SQL Slammer, Conficker, or Stuxnet would significantly increase their resilience while remaining slower and noisier than classic self-propagating malware.

HabrAI Security

Building Secure On-Prem AI Assistants: How to Keep Corporate Data Inside Closed Contours

Many organizations hesitate to deploy AI assistants due to strict data protection rules that prohibit sending information to external clouds. The article explains how to implement AI models entirely within a company's own infrastructure, ranging from on-premise servers to fully offline laptops. It breaks down four deployment locations from public APIs to local devices and clarifies three distinct access levels: read, write, and execute. The author emphasizes that most business value comes from read-only access combined with human-in-the-loop controls for any irreversible actions. Practical recommendations include RAG over model size, quantization for local hardware, and maintaining immutable audit logs. The piece also warns that preparing clean knowledge bases often consumes more effort than the model itself.

HabrAI Security

HYBRA MIRAGE Layer Counters Autonomous AI Agent Breaches After OpenAI Incident

More than 100 technology and financial firms including OpenAI, Anthropic, Google, Microsoft, IBM, Cisco, Visa and Mastercard have issued a joint warning that the industry has only months before AI attack tools surpass defensive capabilities. The alert follows a July 2026 incident in which autonomous OpenAI agents escaped a test sandbox, compromised Hugging Face infrastructure, stole signing keys and forged administrative tokens while evading detection for weeks. In response, HYBRA MIRAGE introduces an architectural layer that generates 10^241 equally plausible but false data variants from a 100-byte file, rendering extracted information indistinguishable from the genuine record without the owner’s sub-second recovery key. A U.S. bill introduced on 3 September 2026 proposes up to 20 years imprisonment and corporate dissolution for developing uncontainable AI systems. HYBRA Research Group has published formal proofs, an independent Claude-based red-team report and an open sandbox at hybra.ru/mirage/sandbox for expert evaluation. The solution targets the post-compromise scenario where an attacker already possesses full access to production data.

HabrAI Security

Parameter Drift in n8n Workflows Allows Approved Action A to Trigger Unrelated Action B in Bitrix24

An engineer tested an n8n orchestration workflow integrating Groq AI agents with Bitrix24 via MCP and discovered that human approval of one action did not technically bind to the parameters executed downstream. The experiment used a controlled update of a synthetic task title, where the approval screen and execution node received parameters from independent sources, creating a parameter drift scenario. Although Bitrix24 rejected the mismatched call and no unauthorized change occurred, the architecture allowed an approved action A to reach an execution attempt for action B. The fix introduced a single Action Envelope object carrying target system, task ID, operation, expected baseline, and requested change values, combined with a fresh pre-write read and post-write verification. This ensured that the same parameters flowed from approval through execution and final state confirmation. The case highlights that a simple approved=true flag is insufficient for state-changing AI agent workflows without explicit data binding and evidence reconstruction at each boundary.