feat(ethereum): slicing inside iterable parameters
What changed, and why it matters
This commit updates the Trezor Ethereum app's 'clear signing' feature so it can handle data formats that slice inside arrays or structs (for example, taking only a portion of a list). It is a small feature addition, not a fix for a known security bug. There is no evidence in the commit or supplied references that this resolves an active vulnerability.
Treat as a routine feature commit. If reviewing for security, verify that slice indices are validated and cannot produce out-of-bounds or unexpected behavior during path traversal, but no immediate action is indicated by the commit itself.
Security signals we found
No security-relevant keywords in commit title or message
No changelog entry ([no changelog])
No referenced CVE, advisory, or bug report
Change is a feature addition (slicing support) rather than a bug fix
No explicit bounds/safety changes beyond slice handling
Evidence from the diff
The change extends the Ethereum clear-signing path type to allow tuple-encoded slice steps (e.g., (a,) for [a:] or (a,b) for [a:b]) and updates the path walker to traverse those slices inside arrays, structs, or bytes. The diff is a feature implementation (+12/-3 lines) with no changelog entry and no accompanying security explanation.
Changed components
core/src/apps/ethereum/clear_signing.pyTrezor Ethereum clear signing path walkerInspect captured patch +12 / −3
diff --git a/core/src/apps/ethereum/clear_signing.py b/core/src/apps/ethereum/clear_signing.py
index 2d0925ea..9c188f09 100644
--- a/core/src/apps/ethereum/clear_signing.py
+++ b/core/src/apps/ethereum/clear_signing.py
@@ -24,7 +24,7 @@ if TYPE_CHECKING:
ListValue = list[StructValue]
AnyValue = Value | StructValue | ListValue | list[Value | StructValue | ListValue]
- Path = tuple[int, ...] | int
+ Path = tuple[int | tuple[int] | tuple[int, int], ...] | int
PathWalker = Callable[[Path], Value]
# Parses a Value from a slice of the calldata.
@@ -554,10 +554,19 @@ class ParsingContext:
if p is None:
p = None
break
- if isinstance(p, (list, tuple)):
+ if isinstance(p, (list, tuple, bytes)):
# walk inside Arrays or Structs
try:
- p = p[step]
+ if isinstance(step, int):
+ p = p[step]
+ elif isinstance(step, tuple) and len(step) in (1, 2):
+ # steps encoded as tuples represent slices... [a:b] or [a:]
+ if len(step) == 1:
+ p = p[step[0] :]
+ else:
+ p = p[step[0] : step[1]]
+ else:
+ raise InvalidFormatDefinition
except (IndexError, TypeError):
raise InvalidFormatDefinition
else:
Why this scored 28/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.