Skip to content

Commit 4fcb3f4

Browse files
DrBaherclaude
andcommitted
release: v0.5.4 — docx entity-expansion DoS + negotiate exit codes
Version bump (pyproject + __version__) and CHANGELOG for the source-audit fixes already on main (commit 41fd1f3). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 41fd1f3 commit 4fcb3f4

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
## [Unreleased]
44

5+
## [0.5.4] - 2026-06-03
6+
7+
Security/robustness fixes from a follow-up source audit.
8+
9+
### Fixed
10+
- **Security (P1): `.docx` entity-expansion (billion-laughs) DoS.** A malicious
11+
`.docx` whose `word/document.xml` declares a `DOCTYPE`/`<!ENTITY>` is now rejected
12+
before parsing via a new stdlib `_safe_xml_fromstring` (raises `ET.ParseError`, so
13+
callers treat it like any other malformed XML). The package stays stdlib-only.
14+
- **Negotiation load now maps to the documented exit codes.** Unsupported schema
15+
version → `2`, hash-chain mismatch → `3` (previously a bare `SystemExit(string)`
16+
exit 1); a valid-but-empty `rounds` list is rejected with a precise structured error
17+
instead of an `IndexError`; `negotiate validate` reports a hash-chain mismatch as `3`
18+
and schema/structural failures as `2`.
19+
- **`generate-office-script` find-replace pack** read routed through `_read_text_file`
20+
so a missing file returns the documented exit `4`, not `2`.
21+
522
## [0.5.3] - 2026-05-31
623

724
Headline: source-level security and robustness hardening from an external source audit — eliminates a command-injection vector in the negotiation finalize hook, removes the remaining raw-traceback crash paths (with a top-level backstop so no command can leak a stack trace), and tolerates malformed/pathological playbook regex.

nda_review_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from xml.etree import ElementTree as ET
1919
from rule_engine import clause_hit, red_flag_hits
2020

21-
__version__ = "0.5.3"
21+
__version__ = "0.5.4"
2222

2323

2424
def _load_json_file(path, label="file"):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "nda-review-cli"
7-
version = "0.5.3"
7+
version = "0.5.4"
88
description = "Local-first NDA review, drafting, and two-party negotiation CLI: deterministic rules + optional second-pass LLM adjudication via Anthropic, OpenAI, Ollama, or any OpenAI-compatible endpoint. Part of the contract-ops CLI suite."
99
readme = "README.md"
1010
requires-python = ">=3.9"

0 commit comments

Comments
 (0)