Secret Vault on Aptos

First Flight #46
Beginner FriendlyWallet
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Empty Event Payload leads to Poor Observability

# Empty Event Payload leads to Poor Observability

## Description

* The `SetNewSecret` event is designed to notify external systems and users when a secret is set or updated in the vault

* The event structure contains no fields or payload data, making it impossible for observers to distinguish between different secret operations, identify which user performed the action, or gather any meaningful context about the state change

```java

#[event]

struct SetNewSecret has drop, store {} // @> No fields - provides no useful information

public entry fun set_secret(caller: &signer, secret: vector<u8>) {

let secret_vault = Vault { secret: string::utf8(secret) };

move_to(caller, secret_vault);

event::emit(SetNewSecret {}); // @> Emits empty event with no context

}

```

## Risk

**Likelihood**:

* Every call to `set_secret()` emits an event with zero informational value

* External monitoring systems receive events but cannot determine the actor or context

* Off-chain applications relying on event data will lack critical operational information

* The issue affects all users and all secret operations consistently

**Impact**:

* Severely degraded observability for security monitoring and auditing

* External systems cannot track which users are setting secrets or when

* Impossible to correlate events with specific addresses or operations

## Proof of Concept

* No proof of concept needed - the issue is evident from the empty event structure definition.

## Recommended Mitigation

* Here is the fix for the event

```diff

#[event]

- struct SetNewSecret has drop, store {}

+ struct SetNewSecret has drop, store {

+ owner: address,

+ timestamp: u64,

+ // Note: Don't include the actual secret for privacy

+ }

public entry fun set_secret(caller: &signer, secret: vector<u8>) {

let secret_vault = Vault { secret: string::utf8(secret) };

move_to(caller, secret_vault);

- event::emit(SetNewSecret {});

+ event::emit(SetNewSecret {

+ owner: signer::address_of(caller),

+ timestamp: aptos_framework::timestamp::now_microseconds(),

+ });

}

```

Updates

Lead Judging Commences

bube Lead Judge 15 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Insufficient Data in `SetNewSecret` event

This is an Informational finding. It has no impact on the security of the protocol.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.