dotCMS / dotCMS/core

Audit follow-up: TarGzipBundleOutput leaks FileInputStream per binary asset

Open Beginner friendly
#36,006 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Parent epic: #36004

Finding

TarGzipBundleOutput.innerCopyFile uses IOUtils.copy(new FileInputStream(source), tar) without closing the input stream. The finally block closes the archive entry, not the source stream.

Report reference: dotCMS/src/main/java/com/dotcms/publishing/output/TarGzipBundleOutput.java:98

Potential impact

Large or sustained bundle generation / push publishing may leak file descriptors until publishing fails with Too many open files or broader node I/O issues.

Suggested validation

Run bundle generation with many binary assets and observe open file descriptor growth around this code path.

Possible fix

Use try-with-resources, for example try (InputStream in = Files.newInputStream(source.toPath())) { IOUtils.copy(in, tar); }.

Caveat

This was AI-found by Claude from .scratch/audit/REPORT.md. Please perform secondary validation of correctness, severity, and value before actioning.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at dotCMS/src/main/java/com/dotcms/publishing/output/TarGzipBundleOutput.java:98 and inspect innerCopyFile, focusing on the source stream and archive-entry cleanup. Run bundle generation with many binary assets while observing open file descriptor growth around this path. Done means the source stream is reliably closed and the validation no longer shows descriptor growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.