# We run the AWS Labs Document Loader MCP Server so an assistant can read PDFs, Office files and images, and it runs inside our CI pipeline as well as on laptops. An advisory published November 20, 2026 (CVE-2026-130901) says the folder limit could switch itself off. When did that happen, which version fixes it, and what should we set?

**Short answer:** Yes, in versions 1.0.10 through 1.0.20. The server limits read_document, read_image and extract_slides_as_images to files inside DOCUMENT_BASE_DIR, or the current working directory when that variable isn't set. AWS's advisory (GHSA-9wg4-8hq4-rfwv, CVE-2026-130901, medium, CVSS 3.1 5.3, CWE-22 path traversal, published November 20, 2026) says that when DOCUMENT_BASE_DIR was unset or empty and any of CI, GITHUB_ACTIONS or PYTEST_CURRENT_TEST was present in the environment, even set to an empty or false value, the server used the filesystem root as its base directory. Since CI platforms set those variables on every job, a pipeline run lost the limit without any warning. Anyone who could influence the documents an agent processed could then make it read supported files anywhere on the machine, and in 1.0.12 through 1.0.20 write PNG slide images outside the folder. The fix (pull request 4561, merged August 31, 2026) removed the environment check, and 1.0.21 reached PyPI on September 1, 2026, so the advisory came about 11 weeks after the fix. Upgrade (PyPI listed 1.0.27 as newest on November 23, 2026) and set DOCUMENT_BASE_DIR to your documents folder, never to /.

## Checklist
1. Check the installed version of awslabs.document-loader-mcp-server. Versions 1.0.10 through 1.0.20 are affected and 1.0.21 is the first fixed release. Configs that run awslabs.document-loader-mcp-server@latest through uvx, as the README's install buttons do, should pick up newer releases when the server restarts; pinned versions and built container images don't, so check the version that actually runs.
2. Set DOCUMENT_BASE_DIR explicitly in every place the server runs, including CI jobs and containers, to the one folder that holds the documents the agent should see. The advisory says deployments that set it to a directory other than / were not affected.
3. Never set DOCUMENT_BASE_DIR to /. The advisory names that value as the one that removes the restriction, and older project comments suggested it for testing.
4. List where the server ran with CI, GITHUB_ACTIONS or PYTEST_CURRENT_TEST present and no DOCUMENT_BASE_DIR. On 1.0.10 through 1.0.20 those runs had no folder limit, so treat any file the job user could read as reachable.
5. If such a run processed documents from outside sources (uploaded files, pull request contents, fetched attachments), review what the agent read and look for unexpected PNG files outside the intended output folder.
6. In containers, mount only the documents folder, set DOCUMENT_BASE_DIR to that mount and add :ro when the agent only reads, as the project's README suggests. Leave it writable only where extract_slides_as_images needs to write.
7. When you review any MCP server that limits file access, search its code for checks of environment variables such as CI or PYTEST_CURRENT_TEST near the path rules. A test shortcut in the file sandbox is the pattern behind this advisory.

## What is CVE-2026-130901 in the Document Loader MCP Server?
- AWS published GHSA-9wg4-8hq4-rfwv (CVE-2026-130901) in the awslabs/mcp repository on November 20, 2026 for the pip package awslabs.document-loader-mcp-server, versions 1.0.10 up to but not including 1.0.21, patched in 1.0.21. It is rated medium (CVSS 3.1 5.3, CWE-22). The server lets an assistant parse PDF, Word, Excel, PowerPoint and image files from the local filesystem with three tools: read_document, read_image and extract_slides_as_images.
- Those tools are meant to stay inside a base directory: DOCUMENT_BASE_DIR if set, otherwise the current working directory. In the affected versions, the function that chose the base directory returned the filesystem root whenever DOCUMENT_BASE_DIR was unset or empty and the CI, GITHUB_ACTIONS or PYTEST_CURRENT_TEST variable existed at all. The check looked only at whether the name was present, so CI=false or an empty value also switched the limit off.
- The project's 1.0.21 changelog notes that CI platforms set these variables on every run, so standard CI/CD deployments lost the sandbox with no log warning, leaving only the file-extension allowlist in place. In that state, the advisory says, someone who can influence the documents an MCP client processes can make the agent read supported files outside the intended directory, and in 1.0.12 through 1.0.20 write PNG slide images outside it.

## How does Document Loader MCP Server 1.0.21 fix CVE-2026-130901?
- The fix is pull request 4561 in awslabs/mcp, "remove CI/test env bypass of DOCUMENT_BASE_DIR sandbox", merged August 31, 2026. PyPI shows 1.0.21 uploaded September 1, 2026, and the advisory followed on November 20, so anyone who upgraded since September is already covered.
- After the change the base directory is DOCUMENT_BASE_DIR when set, otherwise the current working directory, with no environment-based exception. Both are resolved to their canonical, symlink-free form before containment checks. The project's own tests now set DOCUMENT_BASE_DIR explicitly instead of relying on the shortcut.
- The README now says every resolved path for read_document, read_image and both the input and output paths of extract_slides_as_images must be inside DOCUMENT_BASE_DIR or the request is denied, and that there is no automatic bypass under CI or test environments. Changes merged in November 2026, listed under Unreleased in the changelog on November 23, also change extract_slides_as_images to write slide images atomically inside the output folder and refuse paths that are existing symlinks.
- If you can't upgrade right away, the advisory's workaround is to set DOCUMENT_BASE_DIR to the directory that holds your documents and not to /.

## Why is a CI or test shortcut in an MCP server's file sandbox risky?
- A rule like "skip the folder check when tests are running" makes the sandbox depend on environment variables that nobody sets for security reasons. CI runners, build containers and scheduled jobs set CI for their own purposes, and those are often the unattended places where an agent processes files nobody reviewed first.
- The safer pattern is the one the fix adopted: one path rule with no exceptions, applied to every tool that reads or writes, with tests that set the sandbox they need. When you vet a file-handling MCP server, check how it picks its root folder, whether it resolves symlinks before comparing paths, and whether output paths get the same check as input paths.
- It also helps to give the server less to reach in the first place: run it as a user, container or job that can only see the documents folder, so a gap in its own check doesn't expose the rest of the machine.

## Ask Rightshold (free, no key)
Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code (one-click setup: https://www.rightshold.com/start?ref=seo), then ask: "We upgraded the Document Loader MCP Server past the CVE-2026-130901 fix, set DOCUMENT_BASE_DIR in our CI jobs and containers, and reviewed what the older CI runs read. Record that change so we have a dated entry outside our own logs."

```json
{
  "tool": "record_action",
  "arguments": {
    "action_type": "security.config_change",
    "outcome": "success",
    "occurred_at": "2026-11-23T14:30:00Z",
    "client_event_id": "document-loader-mcp:upgrade-2026-11-23",
    "summary": "awslabs.document-loader-mcp-server upgraded to 1.0.27 (CVE-2026-130901 / GHSA-9wg4-8hq4-rfwv fixed in 1.0.21); DOCUMENT_BASE_DIR set to the documents folder in CI and container configs; earlier CI runs without it reviewed"
  }
}
```
- Needs your API key (or accept_terms:true once to open a free account; the key comes back once). It returns a ledger-committed receipt of what you submitted and when. It proves the entry was recorded, not that the upgrade or the review happened as described.
- Keep folder paths, file names and internal hostnames out of summary, because recorded events can't be edited or deleted. To keep details private, hash a sidecar file and send action_sha256 (64-character hex) instead.

_Rightshold isn't affiliated with AWS or the awslabs/mcp project. It doesn't scan MCP server code, inspect your CI environment or watch file access, and a recorded entry isn't a finding that a setup is safe. Advisory details are as published by AWS in the awslabs/mcp repository (GHSA-9wg4-8hq4-rfwv), the fix as described in pull request 4561 and the project's changelog, settings as described in the project's README, and release dates as listed on PyPI, all read November 23, 2026; advisories get updated, so confirm fixed versions on the linked pages._

## Sources
- [AWS security advisory GHSA-9wg4-8hq4-rfwv / CVE-2026-130901, Document Loader MCP Server base directory restriction not enforced](https://github.com/awslabs/mcp/security/advisories/GHSA-9wg4-8hq4-rfwv)
- [awslabs/mcp pull request 4561: remove CI/test env bypass of DOCUMENT_BASE_DIR sandbox](https://github.com/awslabs/mcp/pull/4561)
- [Document Loader MCP Server changelog (1.0.21 security entry)](https://github.com/awslabs/mcp/blob/main/src/document-loader-mcp-server/CHANGELOG.md)
- [Document Loader MCP Server README (tools, DOCUMENT_BASE_DIR, Docker)](https://github.com/awslabs/mcp/blob/main/src/document-loader-mcp-server/README.md)
- [PyPI: awslabs.document-loader-mcp-server release history](https://pypi.org/project/awslabs.document-loader-mcp-server/#history)

## Related
- [Sandboxing a local stdio MCP server to only the files and hosts it needs](https://www.rightshold.com/answers/how-to-sandbox-a-local-stdio-mcp-server-to-only-the-files-and-hosts-it-needs)
- [Blocking SSRF and path traversal in MCP tool arguments](https://www.rightshold.com/answers/how-to-block-ssrf-and-path-traversal-in-mcp-tool-url-arguments-and-resource-templates)
- [Can an MCP tool marked read-only write files? AWS Pricing MCP Server CVE-2026-126816](https://www.rightshold.com/answers/can-an-mcp-tool-marked-read-only-write-files-aws-pricing-mcp-server-cve-2026-126816)

_Not legal advice. Updated 2026-11-23. JSON: https://www.rightshold.com/answers/can-a-ci-environment-variable-turn-off-the-document-loader-mcp-servers-folder-limit-cve-2026-130901.json_