upgrade tern to v1.1.3 to point to rpcallowip when bitcoin core closes the rpc connection as the request is sent
What changed, and why it matters
This commit updates a small internal library (tern) used by Sparrow Wallet to talk to Bitcoin Core. The change makes Sparrow show a clearer, more accurate error message when Bitcoin Core rejects or closes the remote-control (RPC) connection, specifically guiding users to check Bitcoin Core's rpcallowip setting. It also adds handling for a 'Connection reset' socket error. The patch is defensive and improves diagnostics rather than fixing a code-execution vulnerability.
Treat as a routine maintenance/diagnostic-improvement commit. Review the tern v1.1.3 changelog or diff if available to confirm no additional behavioral changes. No urgent security response is indicated by the supplied materials.
Security signals we found
Dependency version bump for internally-controlled library
Improved error-message guidance for RPC connection rejection
Addition of SocketException handling for connection reset detection
No direct fix for memory corruption, injection, or cryptographic flaw visible in diff
Evidence from the diff
The commit bumps com.sparrowwallet:tern from 1.1.2 to 1.1.3 and updates the lark submodule. In BitcoindTransport.java it catches SocketException and, when no proxy is in use and the message contains ‘Connection reset’, rethrows it as an IOException carrying a pre-existing closedMessage. That message now points users to rpcallowip when Bitcoin Core closes the RPC connection as the request is sent. The change is about error classification and user guidance, not about cryptographic or network protocol security.
Changed components
Sparrow Wallet Bitcoin Core RPC transport layer (BitcoindTransport.java)com.sparrowwallet:tern library v1.1.2 -> v1.1.3lark submoduleInspect captured patch +14 / −7
### build.gradle
@@ -99,7 +99,7 @@ dependencies {
exclude group: 'org.slf4j'
}
implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0')
- implementation('com.sparrowwallet:tern:1.1.2')
+ implementation('com.sparrowwallet:tern:1.1.3')
implementation('io.reactivex.rxjava2:rxjava:2.2.21')
implementation('io.reactivex.rxjava2:rxjavafx:2.2.2')
implementation('org.apache.commons:commons-lang3:3.20.0')
### gradle/verification-metadata.xml
@@ -491,12 +491,12 @@
<sha512 value="2b743191e44fb3035032fa9f70d6eb1bbca33315760387928ed7a8ead8b10bbda30c4b62e73c9e204d11426be5b49b38496194617873a309b6bf365cdd8ee858" origin="Generated by Gradle"/>
</artifact>
</component>
- <component group="com.sparrowwallet" name="tern" version="1.1.2">
- <artifact name="tern-1.1.2.jar">
- <sha512 value="e576f8f434999456257a281758795b2becf539d2afaaddf2214c7b2d7a3058f77fb30ae007070d6ce38d86d0d3f544a1ecd728a269c6053396806af361874555" origin="Generated by Gradle" reason="Artifact is not signed"/>
+ <component group="com.sparrowwallet" name="tern" version="1.1.3">
+ <artifact name="tern-1.1.3.jar">
+ <sha512 value="711ecd718d63ba673bca0acca0accbfa512579ccc5b42e122704ca4761029eadbf13a4995a98dd187b69d6737a197d3333366547f22036fe668644b4f7b6e03e" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
- <artifact name="tern-1.1.2.module">
- <sha512 value="3f3074389a190111e2d7884bf523de2c3a72d661d09e016db9750f1b4fe0deed9e093cd322e6cc87e59e1180a32eab4cef7a544ff8c7ac51f11150c7da5fc7a0" origin="Generated by Gradle" reason="Artifact is not signed"/>
+ <artifact name="tern-1.1.3.module">
+ <sha512 value="316ac409468de3202c6832e1776d0cbb7e208b428c0d9e286235ed910c28727c6435af1731ebd920014eae7e48bc5a52e994c4bd8af840a4914caeda41c84aa1" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.sparrowwallet" name="toucan" version="0.9.0">
### lark
@@ -1 +1 @@
-Subproject commit 4eaaf9d2ef242164c801ab21247e616e5c4ef8f7
+Subproject commit c0fc3ad2900dbebb4887c2ebe2a77e263087e914
### src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindTransport.java
@@ -103,6 +103,13 @@ public String pass(String request) throws IOException {
} catch(EOFException e) {
//Also thrown where the node resets the connection instead of closing it, as the client reports a failed read or write on a connected socket as its end
throw new IOException(closedMessage, e);
+ } catch(SocketException e) {
+ //The close can also reset the connection before the connect completes, where other socket errors (unreachable network, local firewall) never reached the node,
+ //and a reset from a proxy is the proxy's own failure
+ if(proxy == null && e.getMessage() != null && e.getMessage().contains("Connection reset")) {
+ throw new IOException(closedMessage, e);
+ }
+ throw e;
}
int statusCode = httpResponse.statusCode();Why this scored 33/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.