Skip to content

fix(analyzers): accept capped token overload and trace delete paths - #170

Merged
e128 merged 1 commit into
mainfrom
fix/e128184-e128227-provenance
Nov 16, 2026
Merged

e128 merged 1 commit into
mainfrom
fix/e128184-e128227-provenance

Conversation

@e128

@e128 e128 commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Executive Summary

Two analyzer defects filed in the analyzer-candidates register are fixed.

  • E128227 recommended a remedy that the cancellation analyzers reject. The only accepted call was LoadIntoBufferAsync(long), which carries no token, so CA2016, MA0040, and S8949 reject it.
  • E128184 reported a temp-directory cleanup helper as unsafe, because the delete site saw only a parameter and the rule stopped at the method boundary.

Code Changes

  • E128227 accepts a LoadIntoBufferAsync call whose first parameter is long, with or without a trailing CancellationToken. The token-only and parameterless overloads still do not bound a read.
  • E128184 treats new DirectoryInfo(path) as carrying the safety of path.
  • E128184 traces a private method's parameter to its call sites in the same type part. Every call site must pass a safe path. A call cycle, a non-private method, a split type, or no visible call site stays unsafe.
  • E128.Analyzers moves to 3.1.2.

Tests and Tooling

  • New E128227 tests: token-aware cap is silent, token-only cap still reports.
  • New E128184 tests: temp-directory helper is silent, unsafe helper argument reports, DirectoryInfo over a rooted literal reports.
  • scripts/check.sh --all passed: shell, format, build, and test.
  • Full suite: 2998 total, 2996 passed, 2 skipped, 0 failed.

Review Guide

  • src/E128.Analyzers/Security/HttpBodyReadWithoutSizeBoundAnalyzer.cs: cap overload shape.
  • src/E128.Analyzers/Security/RecursiveDeleteRootAnalyzer.cs: ClassifyDirectoryInfoCreation, ClassifyParameter, ClassifyCallSites.
  • lode/dotnet/analyzers/rule-details.md, rule-details-security.md: current-state rule contracts.

Rollback

Revert the commit. The analyzer behavior returns to the 3.1.1 shape. No migration or data change.

🤖 Generated with Claude Code

E128227 accepts LoadIntoBufferAsync(long, CancellationToken) and still
rejects the token-only and parameterless overloads.

E128184 treats new DirectoryInfo(path) as carrying path provenance, and
traces a private helper parameter to its call sites in the same type part.
The two resolved register captures are removed, and E128.Analyzers moves to
3.1.2.

Co-Authored-By: Claude
@e128
e128 merged commit e34592a into main Nov 16, 2026
2 checks passed
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