Skip to content

fix(client): hardening round from external audit (0.1.2) - #10

Merged
Autumn-Atlas merged 1 commit into
masterfrom
agent/0.1.2-hardening
Sep 13, 2026
Merged

Autumn-Atlas merged 1 commit into
masterfrom
agent/0.1.2-hardening

Conversation

@Autumn-Atlas

Copy link
Copy Markdown
Contributor

Implements the SHIP-WITH-FIXES findings from an independent external audit of the published 0.1.1 (all findings reproduced against source before fixing).

Fixes

  1. dateutil floor compat_parse_date referenced parser.ParserError (added in dateutil 2.8.1) while setup.py declares >=2.8.0; on 2.8.0 the handler itself raised AttributeError. Now catches (ValueError, OverflowError) only.
  2. Non-JSON errors — HTML 502 raised raw JSONDecodeError; non-object payloads ([]) raised AttributeError inside the exception. Both now raise CurrentsAPIError.
  3. HTTP status in exception.status prefers the real HTTP status code; payload status is fallback only.
  4. Falsey-arg validationkeywords=0/" " rejected instead of silently omitted; all params use is not None guards.
  5. Naive datetimes rejected — previously silently labeled UTC (Z suffix). date objects explicitly formatted as UTC midnight.
  6. Briefing example sanitized — publisher-controlled markdown escaped + URL scheme validation via shared examples/_example_utils.py; verified with a real markdown renderer that the raw form produced a live <a href="javascript:..."> link and the escaped form is inert.

Validation

  • 51 client tests + 26 example tests pass (7 new regressions)
  • twine check PASSED on 0.1.2 sdist+wheel

…tion (0.1.2)

- restore python-dateutil>=2.8.0 compat (drop ParserError reference)
- non-JSON/non-object error responses raise CurrentsAPIError with HTTP status
- status property prefers real HTTP status over payload value
- reject falsey/whitespace keywords; reject naive datetimes; date -> UTC midnight
- sanitize briefing example markdown/URLs (blocks javascript: injection)
- 7 new regression tests (51 total)
@Autumn-Atlas
Autumn-Atlas merged commit 0815c50 into master Sep 13, 2026
5 checks passed
@Autumn-Atlas
Autumn-Atlas deleted the agent/0.1.2-hardening branch September 13, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant