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

add KeyManager stuff from old wallet sdk #98

Closed
wants to merge 4 commits into from

Conversation

acharb
Copy link
Contributor

@acharb acharb commented Feb 13, 2024

ticket

largely just lifted from old wallets sdk

Copy link

socket-security bot commented Feb 13, 2024

Copy link

socket-security bot commented Feb 13, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Network access npm/[email protected]
Network access npm/[email protected]
Network access npm/[email protected]
Network access npm/[email protected]
Filesystem access npm/[email protected]

View full report↗︎

Next steps

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

What is filesystem access?

Accesses the file system, and could potentially read sensitive data.

If a package must read the file system, clarify what it will read and ensure it reads only what it claims to. If appropriate, packages can leave file system access to consumers and operate on data passed to it instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

import { ledgerHandler } from "./handlers/ledger";
import { plaintextKeyHandler } from "./handlers/plaintextKey";
// TODO - fix trezor errors
// import { trezorHandler } from "./handlers/trezor";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the trezor code is throwing some errors so I'm commenting out for a next PR

@piyalbasu for this error:

Cannot find module 'stellar-sdk' from 'node_modules/@trezor/connect-plugin-stellar/lib/index.js'

    Require stack:
      node_modules/@trezor/connect-plugin-stellar/lib/index.js
      src/walletSdk/KeyManager/handlers/trezor.ts
      src/walletSdk/KeyManager/index.ts
      src/index.ts
      test/keyManager.test.ts

Because trezor has a peer dependency of stellar-sdk , instead of @stellar/stellar-sdk

That's something we need to ask them to change right? or do you know of a way to bypass that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Vibrant is only using KeyType.plaintextKey so we should be fine removing trezor unless Freighter is using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cool, I'll leave it commented out for now

looks like freighter is only using plaintextKey too atm

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the late reply, yeah Freighter is only using plantextKey, so probably okay to drop Trezor support for now

I created this ticket to have Trezor update their deps: https://stellarorg.atlassian.net/browse/WAL-1316

@acharb
Copy link
Contributor Author

acharb commented Feb 13, 2024

some dev dependencies w/ vulnerabilities looks like, looking into fixing those

@acharb
Copy link
Contributor Author

acharb commented Feb 13, 2024

hmm looks like there's a dependency alert for cross-fetch and node-fetch, both from the trezor-connect package

maybe another thing to ping trezor about, wdyt @piyalbasu ?

@acharb
Copy link
Contributor Author

acharb commented Feb 13, 2024

@acharb acharb marked this pull request as draft February 13, 2024 19:24
src/index.ts Show resolved Hide resolved
@piyalbasu
Copy link
Contributor

hmm looks like there's a dependency alert for cross-fetch and node-fetch, both from the trezor-connect package

maybe another thing to ping trezor about, wdyt @piyalbasu ?

Yeah, the cross-fetch has a medium supply chain security warning. I'm trying to understand what exactly caused that warning. But something worth flagging with Trezer

The node-fetch warning is less concerning. That warning is more about the fact that node-fetch can load remote code, which is an understood risk and reasonable for the Trezor lib to have to do

@acharb
Copy link
Contributor Author

acharb commented Mar 11, 2024

closing this PR in lieu of this one that's using yarn workspace

@acharb acharb closed this Mar 11, 2024
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