← Lab /Security & privacy

99% of Dockerfiles have misconfigurations; internal references could raise security scores 60%

Adopting internal reference Dockerfiles would increase the average security posture score by 60.4%

Security & privacy arXiv 26 Aug 2026 Measurement Prototype evidence

Published as “Closing the Gap: Automated Discovery of Secure Dockerfile Reference Standards via Semantic Clustering in Enterprise Inner Source”

Why it matters

Enterprises can substantially improve Dockerfile security (≈60% relative gain) by surfacing and reusing existing high-quality internal configurations, enabling automated remediation without the cost of creating new templates.

Summary

Adopting internal reference Dockerfiles could raise the average security posture score by 60.4% without creating new templates. In a single large enterprise, 99% of Dockerfiles have at least one security misconfiguration, 80.8% break best-practice rules, and the median file has not been updated for 838 days. Semantic clustering groups 83% of files into functional clusters, revealing that high-quality references already exist in 83% of those clusters, but 17% of files remain unclustered.

What they found 8

  1. 99% of Dockerfiles contain at least one security misconfiguration

    “99% of files contain at least one security misconfiguration”

  2. 80.8% of Dockerfiles violate Dockerfile best practices

    “80.8% violate Dockerfile best practices”

  3. The median Dockerfile has not been revised for 838 days

    “the median artifact has not been revised for 838 days”

  4. High-quality reference implementations exist within 83% of functional clusters

    “high-quality reference implementations already exist within 83% of functional clusters”

  5. Adopting internal references would increase the average security posture score by 60.4% without new templates

    “increase the average security posture score by 60.4% without developing any new templates”

  6. Semantic clustering covers 83% of Dockerfiles, leaving 17% as noise

    “Semantic clustering produced 251 clusters covering 83% of the dataset (17% noise, i.e., points not assigned to any cluster).”

  7. Mean optimization gap per clustered Dockerfile is 0.29 (29 percentage-point absolute increase), a 60.4% relative improvement

    “The mean optimization gap is Δopt =0.29. The average clustered Dockerfile can increase its absolute score by 29 percentage points-a 60.4% relative improvement-simply by adopting the best practices already present in its functional cluster.”

  8. If all clustered debt were resolved, the global mean score would rise from 0.48 to 0.72 (50.6% improvement)

    “If all clustered debt were resolved, the global mean score (all N=11, 470 files, including noise) would rise from 0.48 to 0.72-a 50.6% global improvement.”

Caveats 6

  • Semantic clustering produced 251 clusters covering 83% of the dataset (17% noise, i.e., points not assigned to any cluster).
  • If all clustered debt were resolved, the global mean score would rise from 0.48 to 0.72-a 50.6% global improvement, lower than the 60.4% figure that applies only to clustered files.
  • The dataset originates from a single corporate environment.
  • The Security Posture Score is a proxy for configuration hygiene, not a runtime CVE count. Equal weighting of all warnings regardless of severity may over-penalize low-severity issues.
  • No labeled ground truth is available for unsupervised clustering on proprietary data.
  • We did not compare HDBSCAN against alternative clustering algorithms (e.g., k-means, agglomerative, or spectral clustering) applied to the same semantic embeddings, so we cannot rule out that a different algorithm would produce different-possibly tighter or looser-functional groupings and a correspondingly different Optimization Gap.

What’s new here 4

  • Uses LLM-generated functional descriptions to cluster Dockerfiles by workload intent rather than syntactic similarity.
  • Quantifies an “optimization gap” showing how much each Dockerfile could improve by adopting an internal golden reference.
  • Demonstrates that 83% of functional clusters already contain high-quality reference implementations, enabling remediation without new templates.
  • Provides a six-stage, reproducible pipeline that integrates static analysis (Hadolint, Trivy) with semantic clustering for enterprise inner-source repositories.