Skip to content

[Feature] Correct protobuf contract types in Actuator getOwnerAddress() #6670

@halibobo1205

Description

@halibobo1205

Problem Statement

The getOwnerAddress() method in the following three Actuators uses incorrect Protobuf types for any.unpack():

Actuator Location Current (Wrong) Type Correct Type
UpdateAssetActuator L174 AccountUpdateContract UpdateAssetContract
MarketCancelOrderActuator L224 AssetIssueContract MarketCancelOrderContract
MarketSellAssetActuator L286 AssetIssueContract MarketSellAssetContract

Impact Analysis

  1. Currently not triggered
    The getOwnerAddress() override method on AbstractActuator is not called in production code.

  2. Failure mode analysis:
    All three incorrect any.unpack(WrongType.class) calls would throw InvalidProtocolBufferException at runtime. Protobuf's Any.unpack() validates the embedded type_url against the requested class before parsing; a mismatch is rejected immediately. Field-number-based misdecoding (e.g., AccountUpdateContract.account_name at field 1 being read as owner_address) would only apply if raw bytes were parsed directly via WrongType.parseFrom(bytes), which is not the code path here.

  3. Code quality: Incorrect type parameters pose a maintenance risk for future development.

This issue was identified during a security audit.

Proposed Solution

Replace the unpack() calls in getOwnerAddress() with the correct Contract type corresponding to each Actuator.

Specification

API Changes: None

Configuration Changes: None

Protocol Changes: None

Scope of Impact

  • Core protocol (Actuator layer)

Breaking Changes: None. Only corrects type parameters.

Backward Compatibility: Fully compatible. This method is not called in production code, so the fix does not affect existing behavior.

Implementation

Approach:
Modify the getOwnerAddress() method in each of the three files to use the correct Contract type for unpack(). Minimal change — one line per file.

Willing to implement: Yes

Estimated Complexity: Low (minor changes)

Testing Strategy

Test Scenarios:

  • Verify that getOwnerAddress() returns the correct owner address after the fix for all three Actuators
  • Run existing unit tests to ensure no regressions

Performance Considerations: None

Additional Context (Optional)

Related Issues/PRs: None

References: Claude AI Scan

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions