preference-cooldown-bypass-bug

Separate cooldown tracking from preference enable/disable state to prevent rate-limiting bypass.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/Hankanman/claude-config --skill preference-cooldown-bypass-bug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: preference-cooldown-bypass-bug
Source: https://github.com/Hankanman/claude-config/tree/main/config/skills/preference-cooldown-bypass-bug
Command: npx skills add https://github.com/Hankanman/claude-config --skill preference-cooldown-bypass-bug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The vulnerability arises when rate limiting uses a preference's updatedAt timestamp, allowing users to bypass cooldowns by toggling the preference on and off. This Skill proposes a secure pattern that separates cooldown tracking from the enabled/disabled state.

Core Features & Use Cases

  • Separate cooldown storage from the enable/disable flag to ensure toggling never resets cooldowns.
  • Migration guidance and concrete code patterns for updating queries and data models.
  • Use Case: A messaging system that should throttle messages for each user even if they toggle their notification preference.

Quick Start

Review your current cooldown checks relying on updatedAt, introduce a dedicated cooldown key, migrate data, and run tests to confirm cooldown persistence across preference toggles.

Frequently Asked Questions about preference-cooldown-bypass-bug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does toggling a preference reset the rate-limiting cooldown in my backend?

Bypassing rate limiting happens when the updatedAt timestamp for a preference also drives the cooldown timer, so toggling the preference refreshes the timestamp and resets the cooldown. Separating the cooldown state into a dedicated key prevents this bypass.

How do I separate cooldown tracking from enable/disable state in TypeScript?

To separate cooldown tracking in TypeScript, introduce a dedicated cooldown key in your data model, store timestamps in ISO format, and update your queries to check this key independently of the boolean preference flag. This ensures cooldown persistence across preference toggles.

When do I need to separate cooldown state from user preferences?

You need to separate cooldown state from user preferences whenever a boolean preference gates a feature while the same timestamp drives a cooldown timer. This pattern applies to scenarios like messaging systems that must throttle notifications even if users toggle their preferences.

What is the best way to prevent rate-limiting bypass when users toggle preferences?

The best way to prevent rate-limiting bypass is enforcing a data-model separation with dedicated cooldown keys and ISO timestamp storage. This approach maintains cooldown integrity by ensuring the preference toggle state cannot overwrite the cooldown tracking timestamp.

Do I need to migrate existing data to fix the preference cooldown bypass bug?

Yes, you need to migrate existing data by introducing a dedicated cooldown key and transferring the current timestamp values. The Skill provides migration guidance and concrete code patterns for updating queries and data models to maintain cooldown integrity.

How do I test that a preference toggle does not reset the cooldown timer?

To test that a preference toggle does not reset the cooldown timer, run tests that confirm cooldown persistence across preference toggles. Verify that toggling the boolean flag leaves the dedicated cooldown key and its ISO timestamp unchanged.