dotCMS / dotCMS/core

Audit follow-up: ProxyTool leaks CloseableHttpClient instances

Open
#36,007 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

ProxyTool appears to build a CloseableHttpClient per $proxy.send* request and never close it. The report also notes send() creates a default client and may then reassign it when credentials are supplied, orphaning the first client.

Report references: dotCMS/src/main/java/com/dotcms/ema/proxy/ProxyTool.java:94-138, dotCMS/src/main/java/com/dotcms/ema/proxy/ProxyTool.java:234-281

Potential impact

Under EMA / Velocity traffic the node may accumulate leaked connection pools, sockets, file descriptors, and threads, eventually causing OOM or FD exhaustion.

Suggested validation

Exercise $proxy.send* under load and inspect client/socket/thread lifecycle, especially credentialed requests.

Possible fix

Close per-request clients with try-with-resources, or preferably use a shared pooled client with clear ownership and lifecycle management.

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 in dotCMS/src/main/java/com/dotcms/ema/proxy/ProxyTool.java at lines 94-138 and 234-281, then exercise the $proxy.send* paths under load. Inspect client, socket, and thread lifecycles, including credentialed requests; done means the reported leak and possible orphaned default client are validated and client ownership is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.