← Latest papers
💻 computer science

On the Variability of Source Code in Maven Package Rebuilds

This paper investigates the assumption that alternative security-focused builds of Maven packages use identical source code, finding that build-time code generation extensions are the primary cause of non-equivalence and suggesting strategies to address this reproducibility challenge.

Original authors: Jens Dietrich, Behnaz Hassanshahi

Published 2026-02-24
📖 5 min read🧠 Deep dive

Original authors: Jens Dietrich, Behnaz Hassanshahi

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you run a massive, high-security bakery. You want to make sure that every loaf of bread sold in the city is made from the exact same recipe and ingredients, with no hidden surprises. To do this, you don't just trust the original baker; you hire a second, independent team to bake the bread from scratch using the same recipe card. If the two loaves look, taste, and smell exactly the same, you know the recipe is safe. If they are different, you know something went wrong—maybe the original baker slipped in a secret ingredient, or the recipe card was tampered with.

This is essentially what software companies like Google and Oracle do with Maven packages (the building blocks of Java software). They try to "rebuild" software from its source code to verify its security.

However, this paper by Jens Dietrich and Behnaz Hassanshahi discovered a strange problem: Sometimes, the "recipe cards" (source code) provided by the original developer and the independent rebuilders aren't actually the same, even though they claim to be.

Here is a simple breakdown of what they found, using some everyday analogies.

1. The "Magic Recipe" Problem

The researchers looked at 28 popular software packages. They expected that if two teams started with the same source code, they would get the same result. But they found that in many cases, the source code itself was different.

Why? Because modern software often uses "Magic Recipe Generators."

Imagine a baker who doesn't just follow a recipe but has a robot that writes part of the recipe while the oven is heating up.

  • The Robot (Build Plugins): In software, these are tools that write code automatically during the build process.
  • The Issue: If the robot writes a line saying "Baked on Tuesday at 2:00 PM," the independent baker's robot will write "Baked on Wednesday at 3:00 PM." Even though the bread is the same, the recipe cards look different because of the timestamp.

2. The Three Main Culprits

The paper identified three main reasons why these "recipe cards" don't match:

  • The "Self-Inserting" Robot (Code Generation):
    Some tools generate code on the fly. For example, a tool might create a list of all the ingredients used. If the tool runs at a slightly different time or uses a slightly different version of itself, the list it generates might be in a different order. It's like two chefs writing down the ingredients for a soup; one writes "Salt, Pepper, Carrots," and the other writes "Carrots, Salt, Pepper." The soup tastes the same, but the written list is different.

    • Real-world example: Tools that generate parsers for specific languages or create API documentation often do this.
  • The "Shaded" Box (Shading):
    Sometimes, to avoid conflicts, a baker puts their own private version of a tool inside the box instead of using the public one. This is called "shading."

    • The Mix-up: The original baker might use a "Private Brand" of flour inside the box, while the independent re-builder tries to use the "Public Brand" because they didn't know the private one was required. This leads to different ingredients being used, resulting in different bread.
  • The "Wrong Page" in the Cookbook (Inconsistent Commits):
    Sometimes, the independent team grabs the wrong page from the cookbook. The developer might have updated the recipe after they published the bread, but the independent team grabbed the new version of the recipe, while the original bread was made with the old version.

    • The result: They are comparing apples to oranges because they are looking at two different versions of the source code.

3. Why Should You Care?

You might think, "If the bread tastes the same, who cares if the recipe card is slightly different?"

In the world of software security, the recipe card is everything.

  • Hidden Malware: If a hacker compromises the "Magic Robot" (the build plugin), they could inject malicious code that only appears in the final product but isn't in the source code you see.
  • Broken Trust: If we can't verify that the source code matches the final product, we can't trust that the software is safe. It's like buying a car and being told, "Trust us, the engine is safe," but you can't check the blueprints because they don't match the car.

4. The Proposed Solution: A Better "Sticky Note"

The authors suggest a fix. Currently, software has a "sticky note" called @Generated that says, "Hey, this part of the code was written by a robot." But this note is flawed:

  1. It often includes the time and date (making it change every time).
  2. It's hard for security scanners to read.
  3. It doesn't tell you which robot wrote it or what version of the robot it was.

The Fix: They propose upgrading this sticky note to be more like a digital passport.

  • It should say exactly which tool generated the code.
  • It should include the version of that tool.
  • It should not include the time or date.

This way, security tools can look at the code, see the "passport," and say, "Ah, this code was generated by Tool X, version 1.0. I know Tool X has a quirk where it changes the order of ingredients. I will ignore that difference and still consider the bread safe."

Summary

This paper is a warning that our current way of checking software security is a bit like trying to compare two handwritten recipes when one of them was written by a robot that changes its handwriting every time it blinks.

The authors found that build-time code generation is the main reason these recipes don't match. To fix this, we need better tools to track exactly how and by what the code was generated, so we can trust that our software supply chain isn't being tampered with.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →