mizazhaider-ceh/agentarsenal/hash-length-extension
Claude Code and agent skill by mizazhaider-ceh/agentarsenal
- community
Checking that the SKILL.md file is still in the repository.
Use when testing for hash length extension attacks on an
Install
npx vskill@latest install mizazhaider-ceh/agentarsenal/hash-length-extensionSKILL.md
The same SKILL.md was published earlier as mizazhaider-ceh/agentarsenal/hash-length-extension.
Hash length extension exploits Merkle Damgard hashes (MD5, SHA-1, SHA-256): given hash(secret + message), an attacker can compute hash(secret + message + padding + extension) without knowing the secret. This skill covers authorized testing: spotting the vulnerable construction, forging payloads, and recommending HMAC. Test only systems you may assess.
Quick Workflow
- Find the construction: hash(secret + message) used as a MAC, in
URLs, cookies, or API signatures.
- Confirm the hash function is Merkle Damgard (MD5, SHA-1,
SHA-256).
- Get a valid (message, hash) pair from normal use.
- Forge: append your extension with the right padding for a
guessed secret length.
- Try secret lengths across the plausible range; the server tells
you when you hit it.
- Prove impact with the forged payload (authorized target).
- Recommend HMAC with a proper key, or a non extendable hash.
- Document the exact forgery that worked.
1. Forging the payload
2. Code review for the pattern
Edge cases
- The hash is SHA-3 or BLAKE2. Not vulnerable to extension; verify
the algorithm before claiming.
- The secret length is unusual. Extend the candidate range; the
server's acceptance is the oracle.
- The MAC includes a length prefix or uses HMAC already. Then it is
safe; verify the HMAC key handling instead.
Escalation
- Forgery works: demonstrate the impact (privilege parameter,
file path) once, then stop.
- Construction unclear: test with a chosen message pair to
distinguish HMAC from plain hash.
Detection and defender view
Defenders see length extension as requests with unusually long signed parameters that still validate. The fix is constructional: HMAC-SHA-256 with a secret key, never hash(secret + message). Detect the pattern in code review with the grep above, and in traffic by validating that signed payloads match expected formats.
Key references
- CWE-328 (Use of Weak Hash): Merkle Damgard MAC misuse.
- CWE-354 (Improper Validation of Integrity Check Value).
- Length extension attack literature (Ferguson-Schneier).
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/crypto/hash-length-extension/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mizazhaider-ceh/agentarsenal/hash-length-extension)