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

Crash when executing an tx-result transaction #356

Open
duyhla opened this issue Mar 14, 2024 · 0 comments
Open

Crash when executing an tx-result transaction #356

duyhla opened this issue Mar 14, 2024 · 0 comments

Comments

@duyhla
Copy link

duyhla commented Mar 14, 2024

Title:

  • Finding Security Vulnerabilities.

Summary:

  • Crash when executing an tx-result transaction.

Details:

  • When executing the command namadac tx-result --tx-hash "DuyTestSomething '&& 1=1" during testing phases to assess SQL injection vulnerabilities, the application crashes. The error message received is as follows:
The application panicked (crashed).
Message:  Unable to query for transaction with given hash: 
   0: response error
   1: Internal error: 
      parse error near PegText (line 1 symbol 17 - line 1 symbol 40):
      "'DuyTestSomething \\'"
       (code: -32603)

Location:
   /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flex-error-0.4.4/src/tracer_impl/eyre.rs:10

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Location: /home/runner/work/namada/namada/crates/sdk/src/rpc.rs:683

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Steps to Reproduce:

  1. Execute the command namadac tx-result --tx-hash "DuyTestSomething '&& 1=1".
  2. Observe the application crash.

Expected Behavior:

  • The application should handle the SQL injection test gracefully, providing appropriate error handling or rejecting the input.

Actual Behavior:

  • The application crashes with the provided error message when encountering the SQL injection test.

Additional Information:

  • This issue poses a potential security risk as it indicates vulnerability to SQL injection attacks.
  • The error message suggests an internal parsing error near the provided input 'DuyTestSomething \'.

Environment:

  • Operating System: Linux Ubuntu 22.04.4 LTS
  • Application Version: v0.31.9

Proposed Solution:

  • Review the code handling transaction queries to identify and fix the parsing error.
  • Implement input validation or sanitization to prevent SQL injection vulnerabilities.
  • Consider adopting parameterized queries or ORM frameworks to mitigate SQL injection risks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant