Skip to content

Blue patch: Add generator replay detection (Pattern 16) - #37

Closed
lalith-AE30 wants to merge 1 commit into
gpu-mode:mainfrom
lalith-AE30:blue-patch-generator-replay
Closed

lalith-AE30 wants to merge 1 commit into
gpu-mode:mainfrom
lalith-AE30:blue-patch-generator-replay

Conversation

@lalith-AE30

Copy link
Copy Markdown

Blue Team Patch: Generator Replay Detection

Summary

Adds Pattern 16 to detect generator-based replay attacks where:

  • A generator function is defined with yield
  • The generator is primed with next()
  • generator.send is exposed as custom_kernel

Target Red Submission

  • KG Red ID: 94
  • Author: WazupSteve
  • Attack: custom_kernel = g.send where g is a primed generator retaining replay state

Detection Results

>>> kg.detect_generator_replay(code)
[{'pattern': 'GENERATOR_REPLAY', 'severity': 'high', 'evidence': 'Generator-based replay attack: generator.send() exposed as callable'}]

Files Changed

  • kernelguard.py: Added RE_GEN_REPLAY pattern and detect_generator_replay() function

KernelGuard-Red-Submission: 94

Detects generator-based replay attacks where:
- A generator function is defined with yield
- The generator is primed with next()
- generator.send is exposed as custom_kernel

This patches red submission KG Red ID 94 (WazupSteve).

KernelGuard-Red-Submission: 94
@lalith-AE30
lalith-AE30 temporarily deployed to kernelguard-api-control-plane May 1, 2026 18:29 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

KernelGuard Blue Evaluation

@SinatrasC

Copy link
Copy Markdown
Collaborator

Thanks for the KernelGuard Flywheel Campaign contribution. We are not merging this narrow variant separately because the consolidated rule-family implementation in #273 is the merge path for this detector area.

@SinatrasC SinatrasC closed this Jun 20, 2026

This branch was previously deployed

1 inactive deployment
kernelguard-api-control-plane — b92bd33d Deployed May 1, 2026 by lalith-AE30 via sync #50
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.

2 participants