Skip to content

Fix stability, resource, and correctness bugs - #1780

Merged
dsyme merged 1 commit into
fsprojects:mainfrom
Thorium:audit-critical-fixes
Jul 29, 2026
Merged

Fix stability, resource, and correctness bugs#1780
dsyme merged 1 commit into
fsprojects:mainfrom
Thorium:audit-critical-fixes

Conversation

@Thorium

@Thorium Thorium commented Jul 6, 2026

Copy link
Copy Markdown
Member
  • HTML: decode hex charrefs (A) correctly; clamp table colspan/rowspan to spec limits (was OverflowException/OOM/hang on malicious spans); stack-safe HtmlNode.ToString (was uncatchable StackOverflow at ~5k nesting depth)
  • HTTP: CombinedStream no longer treats partial reads as EOF (silent multipart truncation) and drops the 2GB int overflow; Range supports bytes=N-/-N; body streams disposed even when an upload faults
  • CSV: skipRows survives re-enumeration of Rows; Save quotes headers, lone CR, and all document separators (round-trip corruption); Save(TextWriter) no longer disposes the caller-owned writer; reentrant enumeration synchronized
  • JSON: NaN/inf/1e300 floats route through JsonValue.Float instead of throwing OverflowException; stray '/' no longer swallowed as whitespace
  • Caching/IO: no Int32 overflow for >24.8-day expirations (could crash host); atomic temp-file-then-rename cache writes; conditional expiry removal; file-watcher subscriptions locked (IDE crash risk)
  • WorldBank: HTTP-200 error bodies validated before caching (30-day cache poisoning); empty topics no longer throw KeyNotFoundException; URL segments escaped with EscapeDataString (path injection)
  • XML: CreateRecord no longer corrupts structure for same-named nested paths
  • DesignTime: Interlocked instance ids, locked dispose-action set, web cache key includes Encoding/row-limit parameters

- HTML: decode hex charrefs (A) correctly; clamp table colspan/rowspan to
  spec limits (was OverflowException/OOM/hang on malicious spans); stack-safe
  HtmlNode.ToString (was uncatchable StackOverflow at ~5k nesting depth)
- HTTP: CombinedStream no longer treats partial reads as EOF (silent multipart
  truncation) and drops the 2GB int overflow; Range supports bytes=N-/-N;
  body streams disposed even when an upload faults
- CSV: skipRows survives re-enumeration of Rows; Save quotes headers, lone CR,
  and all document separators (round-trip corruption); Save(TextWriter) no
  longer disposes the caller-owned writer; reentrant enumeration synchronized
- JSON: NaN/inf/1e300 floats route through JsonValue.Float instead of throwing
  OverflowException; stray '/' no longer swallowed as whitespace
- Caching/IO: no Int32 overflow for >24.8-day expirations (could crash host);
  atomic temp-file-then-rename cache writes; conditional expiry removal;
  file-watcher subscriptions locked (IDE crash risk)
- WorldBank: HTTP-200 error bodies validated before caching (30-day cache
  poisoning); empty topics no longer throw KeyNotFoundException; URL segments
  escaped with EscapeDataString (path injection)
- XML: CreateRecord no longer corrupts structure for same-named nested paths
- DesignTime: Interlocked instance ids, locked dispose-action set, web cache
  key includes Encoding/row-limit parameters
@dsyme

dsyme commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@Thorium Thanks for this! will review shortly

@Thorium

Thorium commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Hi Don,

If you happen to have any extra time, don't focus on this one, but instead:

  1. Fix concurrent type translation minting duplicate target types (#521) FSharp.TypeProviders.SDK#522
  2. perf: stop re-deserializing CodeGenerator quotation patterns per member body (issue #341) FSharp.TypeProviders.SDK#520

Those 2 affect all the TypeProviders, not just FSharp.Data.

@dsyme
dsyme merged commit 29b79a7 into fsprojects:main Jul 29, 2026
10 checks passed
@dsyme

dsyme commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Thank you so much for these fixes @Thorium !!!

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.

2 participants