Skip to content

Conversation

@hxrshxz
Copy link
Contributor

@hxrshxz hxrshxz commented Dec 19, 2025

Description

Fixed RootTheBox XML export to generate categories with text content instead of attributes. The previous implementation used <category name="value"/> format, which is incompatible with RootTheBox's import parser. Categories now correctly generate as <category><category>XSS</category></category>.

Changes:

Affirmation

Copilot AI review requested due to automatic review settings December 19, 2025 22:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical compatibility issue with RootTheBox's XML import parser by refactoring how category elements are generated in the RTB export functionality. The previous attribute-based format was incompatible with RootTheBox's parser, and this has been corrected to use text content instead.

Key Changes:

  • Fixed category XML generation to use text content (<category><category>XSS</category></category>) instead of attributes (<category name="XSS"/>)
  • Updated TypeScript interface signatures to properly support both attribute objects and text content (string/number values)
  • Removed duplicate FlagElement interface definition to improve code maintainability

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/generators/rtb.ts Updated interface type signatures to support text content parameters and fixed category generation logic to produce RootTheBox-compatible XML format
test/unit/generateRtbData.spec.ts Added regression test to verify categories generate with text content format and prevent future attribute-based format regressions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bkimminich bkimminich changed the base branch from master to develop December 20, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant