Skip to content

Conversation

@dev-jodee
Copy link
Contributor

@dev-jodee dev-jodee commented Oct 10, 2025

…s, etc. to prevent sensitive information from being displayed


Important

Sanitizes error messages across the codebase to prevent exposure of sensitive information, with a new sanitize module and unsafe-debug feature flag.

  • Sanitization:
    • Introduces sanitize.rs module for redacting sensitive information from error messages.
    • Adds sanitize_error! macro for conditional sanitization based on unsafe-debug feature flag.
    • Applies sanitization to error messages in cache.rs, config.rs, error.rs, oracle/jupiter.rs, signer/config.rs, signer/keypair_util.rs, usage_limit/usage_store.rs, and usage_limit/usage_tracker.rs.
  • Error Handling:
    • Updates error handling in KoraError conversions to use sanitized messages.
    • Modifies error messages in ConfigValidator to include sanitization.
  • Configuration:
    • Adds unsafe-debug feature flag in Cargo.toml to control error message verbosity.
  • Logging:
    • Adjusts logging in rpc_server/auth.rs to use sanitized error messages.
  • Testing:
    • Adds tests in sanitize.rs to verify sanitization of URLs and hex strings.
    • Updates existing tests to check for sanitized error messages.

This description was created by Ellipsis for 3c7b3de. You can customize this summary. It will automatically update as commits are pushed.


📊 Unit Test Coverage

Coverage

Unit Test Coverage: 83.8%

View Detailed Coverage Report

…s, etc. to prevent sensitive information from being displayed
@dev-jodee dev-jodee requested a review from amilz October 10, 2025 14:32
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 443e702 in 2 minutes and 6 seconds. Click for details.
  • Reviewed 994 lines of code in 14 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. crates/lib/src/validator/config_validator.rs:288
  • Draft comment:
    Consider replacing these 'println!' calls with structured logging (e.g. log::info!) to ensure the output is appropriate for production environments.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. crates/lib/src/validator/config_validator.rs:224
  • Draft comment:
    Consider handling failures of Pubkey::from_str explicitly in the RPC validation loops for allowed tokens and programs instead of silently skipping them.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. crates/lib/src/validator/config_validator.rs:202
  • Draft comment:
    Review the margin validation logic: margin > 1.0 currently produces a warning – verify if this should be an error instead.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. crates/lib/src/validator/config_validator.rs:215
  • Draft comment:
    Avoid using unwrap() on the result of CacheValidator::validate; consider propagating the error to prevent potential runtime panics.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. crates/lib/src/validator/config_validator.rs:235
  • Draft comment:
    Ensure consistent error reporting for Pubkey parsing failures in RPC validation—currently, if Pubkey::from_str fails it is ignored.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. crates/lib/src/validator/config_validator.rs:25
  • Draft comment:
    The 'validate_with_result_and_signers' function is quite lengthy; consider refactoring it into smaller helper functions to improve readability and maintainability.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. crates/lib/src/signer/config.rs:261
  • Draft comment:
    There's a potential interpolation issue on this line. The error message literal uses '{signer_name}' which will not interpolate the variable as intended. If you meant to include the value of signer_name in the formatted string, consider replacing '{signer_name}' with a proper placeholder (e.g., {}) and passing signer_name as an additional argument.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_rjl4XPI1bHs2Z6y8

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed e8663ed in 1 minute and 49 seconds. Click for details.
  • Reviewed 178 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. crates/lib/src/sanitize.rs:62
  • Draft comment:
    Good addition in tests: the assertion now verifies that sanitized messages retain essential context (e.g., 'Failed to connect to') while redacting sensitive parts. This ensures that error messages remain useful without exposing credentials.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_y2JPsZLqBdz79yZD

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

}
#[cfg(not(feature = "unsafe-debug"))]
{
KoraError::SigningError(sanitize_message(&_e.to_string()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes consistently sanitize error messages across conversion implementations. Consider caching the result of _e.to_string() (or similar) in a local variable to avoid repeating the conversion inside sanitize_message(), which can improve clarity and reduce redundant allocations.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed 3c7b3de in 1 minute and 27 seconds. Click for details.
  • Reviewed 30 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. crates/lib/src/error.rs:80
  • Draft comment:
    Good refactoring: reusing the already computed sanitized_error_string avoids duplicate sanitization calls in the non-unsafe-debug branch.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_UzmnzSWARzaBXToj

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@dev-jodee dev-jodee merged commit ef8fc5a into release/feature-freeze-for-audit Oct 10, 2025
9 checks passed
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

Successfully merging this pull request may close these issues.

3 participants