Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

fix: path validation for DotExporter/AnnotationManager + remove dead asCollection - #78

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
gardener/security-and-cleanup
Mar 15, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
gardener/security-and-cleanup

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Security fix (CWE-22):

  • \DotExporter.export()\ and \GraphAnnotationManager.exportToFile()/importFromFile()\ were missing the \ExportUtils.validateOutputPath()\ guard that other exporters (CsvReportExporter, GraphMLExporter, InteractiveHtmlExporter) already had. An attacker controlling the file path could read/write outside the working directory.

Code cleanup:

  • Removed dead \IndependentSetAnalyzer.asCollection()\ — a no-op identity method that took a \Collection\ and returned it unchanged. All 8 call sites inlined to use \graph.getVertices()\ directly.

…ad asCollection

Security (CWE-22):
- DotExporter.export(): now calls ExportUtils.validateOutputPath()
  before writing, matching CsvReportExporter/GraphMLExporter/
  InteractiveHtmlExporter which already had this guard.
- GraphAnnotationManager.exportToFile(): same path validation added.
- GraphAnnotationManager.importFromFile(): same validation to prevent
  reading files outside allowed directories.

Code cleanup:
- IndependentSetAnalyzer: removed dead no-op asCollection() method
  (identity function: takes Collection, returns same Collection).
  Inlined all 8 call sites — graph.getVertices() already returns
  Collection<String>, wrapper served no purpose.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sauravbhattacharya001
sauravbhattacharya001 merged commit 45f503c into master Mar 15, 2026
3 of 7 checks passed
@sauravbhattacharya001
sauravbhattacharya001 deleted the gardener/security-and-cleanup branch March 15, 2026 00:55
@github-actions github-actions Bot added visualization Graph visualization and UI size/s labels Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/s visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant