Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Albort - When a PDA (Program Derived Address) is required to perform signing operations but invoke_signed is not used, the transaction will fail #170

Open
sherlock-admin2 opened this issue Oct 27, 2024 · 0 comments
Labels
Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Oct 27, 2024

Albort

High

When a PDA (Program Derived Address) is required to perform signing operations but invoke_signed is not used, the transaction will fail

Summary

https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract/blob/main/solana-vault/packages/solana/contracts/programs/solana-vault/src/instructions/oapp_instr/init_oapp.rs#L31
your apply function, you are attempting to call the init method of oapp_config and passing oapp_signer as the signer:

let oapp_signer = ctx.accounts.oapp_config.key();
ctx.accounts.oapp_config.init(
    params.endpoint_program,
    params.admin,
    ctx.remaining_accounts,
    oapp_signer,
)

However, the PDA (Program Derived Address), which is the address of oapp_config, cannot directly sign transactions because it does not have a private key. To enable a PDA to sign operations that require a signature, you must use the invoke_signed method and provide the correct seed and bump values.

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

No response

PoC

No response

Mitigation

In the init method of oapp_config, ensure that you’re using invoke_signed to perform actions that require the PDA to sign.

@sherlock-admin3 sherlock-admin3 added the Sponsor Disputed The sponsor disputed this issue's validity label Nov 3, 2024
@sherlock-admin4 sherlock-admin4 changed the title Nice Hemp Raccoon - When a PDA (Program Derived Address) is required to perform signing operations but invoke_signed is not used, the transaction will fail Albort - When a PDA (Program Derived Address) is required to perform signing operations but invoke_signed is not used, the transaction will fail Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

2 participants