fabtoken: audit path never applies configured resource limits, always falls back to defaults - #2207
Merged
Conversation
Effi-S
marked this pull request as ready for review
August 12, 2026 15:15
Effi-S
force-pushed
the
fix-2028
branch
2 times, most recently
from
August 12, 2026 16:17
5f2f61e to
28bc385
Compare
Signed-off-by: Effi-S <effi.szt@gmail.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2028
Summary
The main fabtoken validator applies deployment-configured resource limits (
MaxInputs,MaxOutputs, metadata size caps, etc.) to deserialized actions viaSetLimits(...)before callingDeserialize(). The audit-path deserializer does not — it always falls back todriver.DefaultResourceLimits()regardless of what limits the deployment actually configured. This is an inconsistency between the validate and audit code paths: an action that the validator would reject for exceeding configured limits could still be processed by the audit path using looser defaults.Where
Main validator wires limits through before deserializing (
token/core/fabtoken/v1/validator/validator.go:32,43):The audit path's
ActionDeserializernever does this (token/core/fabtoken/v1/audit/auditor.go:34-56):Since
TransferAction.effectiveLimits()/IssueAction.effectiveLimits()fall back todriver.DefaultResourceLimits()wheneverSetLimitswas never called, the audit path always enforces the hardcoded defaults, never the deployment's actual configured limits.Impact
Wherever the audit path is expected to reject the same class of oversized/abusive actions the validator rejects (excess inputs/outputs, oversized metadata), it currently enforces a different (and potentially looser or stricter) policy than the one operators actually configured — a DoS-protection inconsistency between validation and audit.
Suggested fix
Thread the configured
driver.ResourceLimitsintoaudit.NewAuditor/ActionDeserializer(the same wayvalidator.goreceives and appliesa.Limits), and callia.SetLimits(...)/ta.SetLimits(...)beforeDeserialize()inDeserializeActions.Severity
MEDIUM — inconsistent enforcement between validate and audit paths, not itself an authentication/validity bypass.