Skip to content

[FIX] medium severity - #27

Merged
neto737 merged 7 commits into
mainfrom
fix/medium-severity
Oct 18, 2026
Merged

neto737 merged 7 commits into
mainfrom
fix/medium-severity

Conversation

@neto737

@neto737 neto737 commented Oct 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

…ations.

BitGoSDK now declares accessToken, coin and testNet, and BitGoExpress declares
hostname, port and coin. They stay public, as they were when PHP created them
dynamically, so existing reads keep working.

The tests no longer construct clients with @.
The PSR-12 pass in cd4c88c already converted every `string $x = null` to
`?string $x = null`. This test reads each method's declaration and fails if a
typed parameter that defaults to null is no longer marked nullable, since PHP
8.4 deprecates the implicit form.
__execute() now passes the result of curlOptions() to curl_setopt_array(), so
tests can check URLs, headers and TLS settings without making a request. No
behaviour change.
login() set a flag that was never cleared, so every later call went out with
no Authorization or Content-Type header. The token it returned was thrown
away too.

login() now stores a successful response's access_token in $accessToken, and
only the login request itself leaves out the Authorization header. Every
request sends Content-Type: application/json.
Express could only be reached over plain http://, so passphrases and private
keys crossed the network unencrypted whenever Express ran on another host.

Prefix the hostname with https:// to use TLS, for example
new BitGoExpress('https://express.internal', 3080). A bare hostname still
uses http://, and any other scheme throws InvalidArgumentException.

setCaFile() trusts the CAs in a PEM file. For a self-signed Express
certificate, pass the certificate itself. setVerifyTls(false) turns off
certificate and hostname checks. It is meant for local testing only.
The UTXO list included Stacks (stx, tstx), which is account-based, and left
out Dogecoin and Bitcoin Gold testnet. Most other checks compared against the
mainnet code only, so testnet wallets silently lost params: gasPrice,
enterprise and the like on teth, feeTxConfirmTarget on tbtc, segwit on tltc,
dt on txrp and memoId on txlm.

Each check now uses a coin family that lists the mainnet and testnet codes.
The ETH family also includes the Goerli (gteth) and Holesky (hteth) codes.

generateWallet() also stops sending gasPrice: 0 for non-ETH coins. That 0
used to be filtered out, but since 0 values are sent, it reached BitGo.
Both clients set CURLOPT_IPRESOLVE to IPv4 unconditionally, which breaks
IPv6-only hosts. cURL now uses IPv4 or IPv6 as the system allows. Call
setForceIPv4(true) to get the old behaviour back.

When BitGoSDK::setRequestIP() binds a local address, requests resolve to that
address's IP version, since a bound address can't reach the other one.
@neto737
neto737 merged commit 036148d into main Oct 18, 2026
23 checks passed
@neto737
neto737 deleted the fix/medium-severity branch October 18, 2026 08:22
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