Repository navigation
Fix/cleartext logging tests 2 - #40
Closed
patil-utkarsh wants to merge 8 commits into
Closed
patil-utkarsh wants to merge 8 commits into
patil-utkarsh wants to merge 8 commits into
Conversation
unsafe-libyaml is pulled in by serde_yaml 0.9. The advisory is an unmaintained notice with no known vulnerability and no safe upgrade, matching the existing ignore entries for other unmaintained crates.
OIDC tests passed fixed nonce strings (nonce123, test-nonce-value) to build_authorize_url and the mock IdP token, which CodeQL flags as rust/hard-coded-cryptographic-value. Use a random UUID instead: test_nonce() generates one per test run so the mock IdP nonce claim and the value passed to the code under test still match. Test-only change; no production code touched.
…lerts (#3) nucleo par_sort: initialise the block-partition start/end offset pointers to the start of their offsets buffer instead of null. Before the first trace only start == end matters and the trace resets both to that address, so behaviour is unchanged; the pointers are just never null. Adds par_quicksort regression tests against std sort. Closes #2, #3. ainxt-shell: add util::encode_path_segment (RFC 3986 pchar percent-encoding; ordinary ids such as UUIDs are returned unchanged) and use it for session_id path segments in the remote session, sandbox, session-registry and feedback clients, so an id can never escape its URL path segment. Closes #294-#306.
CodeQL treats a value as sensitive by the name of the variable, field or function it is read from (session_id, *_uuid, api_key, oauth*, trusted, ...), including any expression that contains such a field access. None of the 15 flagged prints output a secret. Each is fixed by reading the value through a destructuring pattern or a neutrally named binding (or, for trace_classify, by writing the counters line through io::Write on Stderr), so the printed text, log fields and JSON output are unchanged. Closes #4, #5, #6, npci#8, npci#9, npci#10, npci#11, npci#13, npci#14, npci#15, npci#16, npci#17, npci#18, npci#19, npci#20.
Dispatch test failure messages dumped whole Effect values ({effects:?}, {other:?}, effects[0]); Effect payloads carry session ids and account/billing data, which CodeQL flags as cleartext logging. Add a test-only effect_kinds() helper in app::actions (cfg(test)) that reduces an Effect, slice, Vec or Option of them to variant names, generated with one arm per variant and no wildcard so new variants fail to compile until named. Route the Effect placeholders in tests/settings.rs, tests/session/load.rs and tests/router.rs through it. Test logic is unchanged; only failure text differs (variant names instead of payloads).
Route Effect placeholders in dispatch tests modes.rs, prompt.rs, session/fork.rs, session/lifecycle.rs and dashboard.rs through the test-only effect_kinds() helper added in batch 1, so failure messages print variant names instead of Effect payloads. Rename the build_child_fork_marker parameter session_id -> child_sid (banner text unchanged) so the fork-banner assertions no longer trace a sensitive-named value. Test logic unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.