Skip to content

🔒 [security] replace Date.now() with randomUUID() for STIX bundle IDs#17

Closed
miccy wants to merge 1 commit intomainfrom
security-fix-insecure-id-generation-8517850932491619967
Closed

🔒 [security] replace Date.now() with randomUUID() for STIX bundle IDs#17
miccy wants to merge 1 commit intomainfrom
security-fix-insecure-id-generation-8517850932491619967

Conversation

@miccy
Copy link
Copy Markdown
Owner

@miccy miccy commented Apr 28, 2026

🎯 What: The vulnerability fixed

Replaced insecure Date.now() with crypto.randomUUID() for generating STIX bundle IDs in packages/engine/src/extractor/ioc.ts.

⚠️ Risk: The potential impact if left unfixed

Using Date.now() for identifier generation is insecure as it is predictable and has a high risk of collisions in high-throughput or distributed environments. This could lead to data integrity issues or potential exploitation where unique identifiers are expected.

🛡️ Solution: How the fix addresses the vulnerability

The fix utilizes the node:crypto module's randomUUID() function to generate cryptographically secure UUIDv4 identifiers. A new test case has been added to packages/engine/src/extractor/ioc.test.ts to verify that the generated IDs follow the bundle--<UUIDv4> format.


PR created automatically by Jules for task 8517850932491619967 started by @miccy

STIX 2.1 bundle IDs should be unique and ideally non-predictable.
Replacing Date.now() with crypto.randomUUID() ensures uniqueness and
adheres to security best practices for identifier generation.
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 59cf9757-152e-43be-89ad-24893dfee0ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security-fix-insecure-id-generation-8517850932491619967

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@miccy
Copy link
Copy Markdown
Owner Author

miccy commented May 4, 2026

✅ Merged into dev/feat-grant-ready-foundation (commit 4f50b4b).

@miccy miccy closed this May 4, 2026
@miccy miccy deleted the security-fix-insecure-id-generation-8517850932491619967 branch May 4, 2026 03:23
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