# VNX-410: Insufficient Resource Pool

A shared server pool capped at one or two members by a literal.

| Field | Value |
|---|---|
| Rule ID | `VNX-410` |
| Severity | Low |
| SARIF level | `note` |
| Kind | `sast` |
| Languages | Java, Any file |
| CWE | [CWE-410](https://cwe.mitre.org/data/definitions/410.html) |
| CAPEC | [CAPEC-66](https://capec.mitre.org/data/definitions/66.html) |
| ATT&CK | [T1190](https://attack.mitre.org/techniques/T1190/) |
| CWSS vector | `CWSS:1.0/TI:L/AP:RU/AL:S/IC:N/FC:LT/RP:RU/RL:S/AV:L/AS:N/IN:A/SC:A/BI:L/DI:H/EX:L/EC:N/P:L` |
| Tags | `resource-pool` `cwe-410` |
| Source | [`internal/sast/rules/vnx-410.rego`](https://github.com/Vulnesis/cli/blob/main/internal/sast/rules/vnx-410.rego) |

## Overview

VNX-410 maps to [CWE-410: Insufficient Resource Pool](https://cwe.mitre.org/data/definitions/410.html). The rule reports a shared server resource pool (database connections, request threads, a request executor) capped at one or two members by a literal.

## Why this matters

When a pool has one or two members, a couple of slow or deliberately held requests take all of them, and every other client blocks until they are released. Whether a larger literal is enough for peak load cannot be judged statically, so only the degenerate sizes are reported.

## What gets flagged

```java
config.setMaximumPoolSize(1);                                    // FLAGGED (HikariCP)
ds.setMaxTotal( 2 );                                             // FLAGGED (DBCP)
QueuedThreadPool threads = new QueuedThreadPool(2);              // FLAGGED (Jetty)
private final ExecutorService pool = Executors.newFixedThreadPool(1);   // FLAGGED in a ServerSocket/servlet/controller file
```

```properties
spring.datasource.hikari.maximum-pool-size=1                     # FLAGGED
server.tomcat.threads.max = 2                                    # FLAGGED
```

Not flagged: sizes from variables or expressions, larger literals, `newScheduledThreadPool(1)` and `newSingleThreadExecutor()`, a one-thread executor in code that does not serve requests, test files, comments and strings.

## Remediation

1. Size pools for peak concurrency, from configuration rather than a literal.
2. Set an acquisition timeout so a starved pool fails fast instead of queueing forever.
3. For confirmed false positives, add a `// vulnetix-ignore: VNX-410` comment on the line.

## References

- [CWE-410: Insufficient Resource Pool](https://cwe.mitre.org/data/definitions/410.html)
- [HikariCP: About Pool Sizing](https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing)

## Suppressing this rule

Put a `nosec` comment on the line, or on line 1 to cover the whole file. Use the comment marker of the file's language (`#`, `//`, `--` or `;`):

```text
# nosec vnx-410
// nosec vnx-410
```

Or record an ignore rule: `vulnetix ignore add --rule vnx-410 --reason "..."`. See [Suppressing findings](/sast/guides/suppressing-findings.md).
