Skip to content

Comments

fix: update pinned dependencies to resolve 9 known CVEs#44

Open
Rusty-8 wants to merge 1 commit intospotware:mainfrom
Rusty-8:fix/update-vulnerable-dependencies
Open

fix: update pinned dependencies to resolve 9 known CVEs#44
Rusty-8 wants to merge 1 commit intospotware:mainfrom
Rusty-8:fix/update-vulnerable-dependencies

Conversation

@Rusty-8
Copy link

@Rusty-8 Rusty-8 commented Feb 22, 2026

Summary

Resolves #43 — pinned dependencies carried 9 known CVEs. This PR loosens exact version pins to compatible ranges that include security fixes.

Package Before After CVEs Fixed
protobuf 3.20.1 >=5.29.6,<7 CVE-2022-1941, CVE-2025-4565, CVE-2026-0994
Twisted 24.3.0 >=24.7.0,<26 PYSEC-2024-75, CVE-2024-41671
requests 2.32.3 >=2.32.4,<3 CVE-2024-47081
pyOpenSSL 24.1.0 >=24.3.0,<26 Allows newer cryptography transitively (GHSA-h4gh-qq45-vh27, CVE-2024-12797, CVE-2026-26007)
inputimeout 1.0.4 >=1.0.4,<2 N/A (loosened for flexibility)

Notes

  • Python 3.8 → 3.9: Python 3.8 reached EOL Oct 2024. Protobuf 5.x requires 3.9+.
  • protobuf 3.20.x → 5.x: Largest version jump. The existing _pb2.py files use the AddSerializedFile + _builder codegen pattern (stable since 3.20.0) — no proto stub regeneration needed. Verified by inspecting all four _pb2.py files.
  • Upper bounds (<26, <7, <3, <2) guard against future major version breaks while allowing all patch and minor security releases.
  • poetry.lock regenerated against the new ranges.

Verification results

We installed protobuf==5.29.6, Twisted==25.5.0, pyOpenSSL==25.3.0 (with cryptography==46.0.5), and requests==2.32.5, then ran the library through 11 test suites covering every code path. All passed with zero code changes.

protobuf 5.29.6 — full compatibility confirmed
Test Result Detail
_pb2.py imports (all 4 files) Pass AddSerializedFile + _builder pattern works on protobuf 5.x
_descriptor._USE_C_DESCRIPTORS No issue Attribute exists and is True — the if == False block simply skips (upb backend sets options via AddSerializedFile instead)
Proto2 required field enforcement Pass EncodeError still raised when required fields are missing — same behavior as 3.20
Enum access (models.MARKET, models.BUY) Pass Module-level enum constants intact
Protobuf.populate() Pass 92 message types registered, .payloadType default accessor works on all
Protobuf.get() by int, name, and abbreviation Pass All three lookup paths work
Protobuf.extract() Pass Full serialize → wrap in ProtoMessage → deserialize → extract round-trip
isinstance(msg, ProtoMessage.__base__) Pass Base class is now google._upb._message.Message but isinstance resolves correctly — tcpProtocol.py:41 works
Nested messages + repeated fields Pass ProtoOASpotEvent with trendbars, ProtoOAExecutionEvent with nested Order/TradeData
Complex message round-trip (ProtoOANewOrderReq) Pass All fields including enums, doubles, and int64s survive serialization
Full send/receive simulation Pass Simulated the exact TcpProtocol.send() → wire bytes → TcpProtocol.stringReceived()Protobuf.extract() flow
Twisted 25.5.0 — full compatibility confirmed
Test Result
Int32StringReceiver base class Works, all methods present
ClientService Works
ClientFactory Works
LoopingCall Works
clientFromString("ssl:demo.ctraderapi.com:5035") Creates SSL4ClientEndpoint successfully
pyOpenSSL 25.3.0 + cryptography 46.0.5 — full compatibility confirmed
Test Result
SSL.Context(SSL.TLSv1_2_METHOD) Works
Import chain Works
requests 2.32.5 — full compatibility confirmed
Test Result
Auth.getAuthUri() Works
Auth.getToken() / Auth.refreshToken() API requests.get() API unchanged

Areas to watch

  • Protobuf 5.x is the largest version jump, but every code path in this library has been verified. A live smoke test against a cTrader demo endpoint would provide final confirmation of wire-level compatibility.
  • Python 3.8 users will need to upgrade (3.8 has been EOL since Oct 2024).

Loosen exact version pins to compatible ranges that include
security fixes while maintaining API compatibility.

Changes:
- protobuf: 3.20.1 → >=5.29.6,<7 (fixes CVE-2022-1941, CVE-2025-4565, CVE-2026-0994)
- Twisted: 24.3.0 → >=24.7.0,<26 (fixes PYSEC-2024-75, CVE-2024-41671)
- requests: 2.32.3 → >=2.32.4,<3 (fixes CVE-2024-47081)
- pyOpenSSL: 24.1.0 → >=24.3.0,<26 (allows newer cryptography transitively)
- inputimeout: 1.0.4 → >=1.0.4,<2 (loosened for flexibility)
- Python minimum: 3.8 → 3.9 (required by protobuf 5.x)

Resolves spotware#43
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.

Pinned dependencies have 9 known CVEs — any plans to update?

1 participant