Skip to content

Feature/aptos cre tmp 2#356

Draft
cawthorne wants to merge 11 commits intodevelopfrom
feature/aptos-cre-tmp-2
Draft

Feature/aptos cre tmp 2#356
cawthorne wants to merge 11 commits intodevelopfrom
feature/aptos-cre-tmp-2

Conversation

@cawthorne
Copy link
Collaborator

No description provided.

@cawthorne cawthorne deployed to integration February 27, 2026 20:59 — with GitHub Actions Active
// Another concurrent submission may have created the store first.
txStore = a.accountStore.GetTxStore(tx.FromAddress.String())
if txStore == nil {
ctxLogger.Errorw("failed to create tx store", "fromAddress", tx.FromAddress.String(), "error", err)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to authKey
flows to a logging call.

Copilot Autofix

AI 3 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

// Another concurrent submission may have created the store first.
txStore = a.accountStore.GetTxStore(tx.FromAddress.String())
if txStore == nil {
ctxLogger.Errorw("failed to create tx store", "fromAddress", tx.FromAddress.String(), "error", err)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to authKey
flows to a logging call.

Copilot Autofix

AI 3 days ago

General approach: avoid logging sensitive or user-identifying fields in clear text. Instead, either omit them entirely from logs or log a redacted version (e.g., truncated or hashed), while preserving enough information for debugging. In this case, we should ensure that errors returned from AccountStore.CreateTxStore do not contain the full account address, so when those errors are logged upstream, no sensitive data is exposed.

Best targeted fix without changing functionality: update AccountStore.CreateTxStore in relayer/txm/txstore.go so that the returned error no longer embeds accountAddress. We can still indicate that a TxStore already exists, but we should not include the specific address string. This way, when err is logged in signAndBroadcast (ctxLogger.Errorw("failed to create tx store", "fromAddress", tx.FromAddress.String(), "error", err)), the error field itself will not leak the address. Since the fromAddress is already separately logged in the same statement, if you want to fully satisfy the spirit of the rule you could also consider redacting that, but the CodeQL path specifically flags the flow through the error, so the minimal necessary fix is in CreateTxStore.

Concretely:

  • In relayer/txm/txstore.go, modify the fmt.Errorf call in CreateTxStore to remove the %s placeholder and the accountAddress argument:
    • From: fmt.Errorf("TxStore already exists: %s", accountAddress)
    • To: fmt.Errorf("TxStore already exists")
  • No new imports or helper methods are needed.

This preserves all behavior except that the error text is slightly less specific and no longer contains the account address string.

Suggested changeset 1
relayer/txm/txstore.go
Outside changed files

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/relayer/txm/txstore.go b/relayer/txm/txstore.go
--- a/relayer/txm/txstore.go
+++ b/relayer/txm/txstore.go
@@ -197,7 +197,7 @@
 	defer c.lock.Unlock()
 	_, ok := c.store[accountAddress]
 	if ok {
-		return nil, fmt.Errorf("TxStore already exists: %s", accountAddress)
+		return nil, fmt.Errorf("TxStore already exists")
 	}
 	store := NewTxStore(initialNonce)
 	c.store[accountAddress] = store
EOF
@@ -197,7 +197,7 @@
defer c.lock.Unlock()
_, ok := c.store[accountAddress]
if ok {
return nil, fmt.Errorf("TxStore already exists: %s", accountAddress)
return nil, fmt.Errorf("TxStore already exists")
}
store := NewTxStore(initialNonce)
c.store[accountAddress] = store
Copilot is powered by AI and may make mistakes. Always verify output.
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.

1 participant