This repository was archived by the owner on Jun 1, 2026. It is now read-only.
security: CWE-674: Limit embedded signature recursion — VC-53740#2
Open
torresashjiancyber wants to merge 1 commit into
Open
security: CWE-674: Limit embedded signature recursion — VC-53740#2torresashjiancyber wants to merge 1 commit into
torresashjiancyber wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix uncontrolled recursion vulnerability in OpenPGP embedded signature parsing that could cause stack overflow with deeply nested signature chains.
Finding
CWE-674 (Uncontrolled Recursion) / CWE-400 (Uncontrolled Resource Consumption)
CVSS: 6.8 (CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N)
pgpdump processes OpenPGP Signature Packets that can embed other signature packets (via the Embedded Signature subpacket type 32) without limiting recursion depth. An attacker can craft a deeply nested signature packet (e.g., 10000 levels deep) that causes a stack overflow when parsed.
The recursive call chain:
Remediation
Added maximum recursion depth enforcement for signature packet parsing:
MAX_SIG_RECURSION_DEPTHconstant set to 10 levelssignature_recursion_depthcounter to track current depthSignature_Packet()to increment depth on entry, decrement on exitThis prevents stack overflow while allowing legitimate nested signatures (10 levels is more than sufficient for real-world use cases).
Verification
Ticket: VC-53740