Skip to content

fix: handle missing relationship descriptions in attackToExcel#226

Merged
jondricek merged 1 commit intomainfrom
fix/relationship-description-citations
Apr 17, 2026
Merged

fix: handle missing relationship descriptions in attackToExcel#226
jondricek merged 1 commit intomainfrom
fix/relationship-description-citations

Conversation

@jondricek
Copy link
Copy Markdown
Contributor

Summary

  • make relationship citation extraction tolerate relationship dataframes that do not contain a mapping description column
  • preserve existing citation behavior for relationships that do include descriptions and citation markers
  • add a regression test covering an in-memory ICS bundle with an asset targets relationship that has no description

Root Cause

relationshipsToDf() only populated mapping description when a relationship had a description, but later citation extraction assumed the column always existed and indexed it unconditionally. ICS asset targets relationships can be valid without a description, which caused a KeyError during Excel export.

Test Plan

  • uv run pytest tests/test_stix_to_df.py
  • uv run ruff check mitreattack/attackToExcel/stixToDf.py tests/test_stix_to_df.py
  • uv run ruff format --check mitreattack/attackToExcel/stixToDf.py tests/test_stix_to_df.py

@jondricek jondricek changed the title Handle missing relationship descriptions in attackToExcel fix: handle missing relationship descriptions in attackToExcel Apr 17, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@jondricek jondricek merged commit 439dd63 into main Apr 17, 2026
4 of 6 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