Watch
1
0
Fork
You've already forked ypsopump-research
0
mirror of https://github.com/SandraK82/ypsopump-research.git synced 2026-11-04 12:19:19 +01:00
Reverse engineering documentation and AndroidAPS driver for the Ypsomed YpsoPump insulin pump. #WeAreNotWaiting
  • Kotlin 93%
  • JavaScript 7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sandra Theresa Keßler de7e867241 some updates
2026-02-28 01:40:20 +01:00
aaps-driver Initial release: YpsoPump reverse engineering documentation + AAPS driver 2026-02-27 00:08:01 +01:00
docs some updates 2026-02-28 01:40:20 +01:00
guides Initial release: YpsoPump reverse engineering documentation + AAPS driver 2026-02-27 00:08:01 +01:00
ypsopump-test some updates 2026-02-28 01:40:20 +01:00
.gitignore some updates 2026-02-28 01:40:20 +01:00
LICENSE Initial release: YpsoPump reverse engineering documentation + AAPS driver 2026-02-27 00:08:01 +01:00
README.md some updates 2026-02-28 01:40:20 +01:00

YpsoPump Research

Reverse engineering documentation and AndroidAPS driver for the Ypsomed YpsoPump insulin pump.

#WeAreNotWaiting — Because patients shouldn't have to wait for interoperability.

What is this?

This repository contains the findings of a comprehensive security and protocol analysis of the mylife YpsoPump insulin pump and its companion app CamAPS FX (v1.4(190).111). The goal is to enable the diabetes community to build open-source drivers for the YpsoPump, particularly for AndroidAPS.

This repository does NOT contain decompiled source code. All findings were obtained through static analysis of a publicly available APK and documented in a clean-room manner.

Key Findings

Topic Finding
BLE Encryption XChaCha20-Poly1305 AEAD via libsodium 1.0.20
Key Exchange 9-step protocol involving app, backend (gRPC), and pump
Key Derivation Curve25519 ECDH + HChaCha20 KDF
Commands 33 BLE commands (indices 0-32) across 4 services
Backend connect.cam.pr.sec01.proregia.io:443 — no certificate pinning
Key Expiry 28-day expiry enforced app-side only — pump doesn't check
Hardware STM32F051 (MCU) + EM9301 (BLE radio)
Bypass Shared key extractable via Frida after single legitimate key exchange

Documentation

Document Description
01 — Hardware PCB analysis, STM32F051, EM9301, FCC filings
02 — BLE Protocol All 33 commands, GATT UUIDs, service structure
03 — Encryption XChaCha20-Poly1305, 5-layer encryption stack
04 — Key Exchange 9-step protocol, 116-byte payload, Curve25519
05 — Backend gRPC services, AWS, Azure, Dexcom, Firebase
06 — Algorithm Encrypted native library, 2-stage protection
07 — Obfuscation DexGuard techniques, deobfuscated class map
08 — Security Vulnerabilities, CVEs, attack surface
09 — Bypass Frida pump faking, key extraction, gRPC MITM
10 — Legal EHDS, GDPR, DMCA, right to interoperability
11 — CamAPS Algorithm Cambridge Algorithm analysis
12 — CamAPS Sideload Sideload bypass attempt
13 — Play Integrity STRONG_INTEGRITY bypass via TrickyStore
14 — mylife Overview mylife App architecture, Xamarin/.NET stack
15 — mylife Security No root detection, no anti-tamper, no obfuscation
16 — mylife Protocol ProRegia gRPC, Key Exchange, Commander Key
17 — mylife Components Activities, Dexcom SDK, Cloud integration
18 — mylife Bypass Bypass-Plan für gerootetes A22
19 — Key Lifecycle Pump-seitige Rotation, Counter-Management

Practical Guides

Guide Description
Building a Driver App Complete walkthrough: BLE, crypto, commands
Frida Key Extraction Scripts for shared key capture + pump faking
BLE Sniffing Setup nRF Sniffer + Wireshark + decryption

AAPS Driver

The aaps-driver/ directory contains a work-in-progress AndroidAPS pump driver module:

  • Full XChaCha20-Poly1305 encryption implementation
  • Curve25519 key exchange (local steps)
  • All 33 command codes
  • PumpType.YPSOPUMP integration (already exists in AAPS)
  • Dagger DI module
  • Status, bolus, and TBR command classes

Status: The driver structure is complete, but requires a real YpsoPump for BLE payload verification and integration testing. The key exchange must be bootstrapped via Frida/CamAPS proxy (see Strategy A: Pump Faking).

The Pump Faking Approach

The recommended strategy for bootstrapping the driver:

Phase 1: Use Frida to fake a virtual YpsoPump towards CamAPS FX
         → CamAPS performs the key exchange with the backend
         → Capture the 116-byte payload and shared key
         → No need to reimplement backend communication!

Phase 2: Custom driver communicates directly with real pump
         → Uses the captured shared key
         → XChaCha20-Poly1305 encrypted BLE
         → Independent of CamAPS

This approach is documented in detail in docs/09-bypass-options.md.

Responsible Disclosure

These findings were obtained through static analysis of a publicly available APK. No active exploitation of production systems was performed. Security vulnerabilities have been documented to enable the vendor to improve their product.

We believe in responsible disclosure and recommend Ypsomed/CamDiab:

  • Implement certificate pinning on gRPC and REST channels
  • Enforce key expiration server-side
  • Rotate hardcoded credentials

This research is conducted under:

  • EU Software Directive 2009/24/EC Art. 6 (decompilation for interoperability)
  • EU EHDS Regulation 2025/327 (right to health data access and portability)
  • GDPR Art. 15/20 (right of access and data portability)
  • US DMCA §1201(f) (reverse engineering for interoperability)
  • EU Cyber Resilience Act 2024/2847 Art. 13(6) (security research)

See docs/10-legal-analysis.md for full analysis.

Disclaimer

THIS SOFTWARE IS PROVIDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY.

  • This is NOT a medical device and is NOT approved for therapeutic use
  • Do NOT use this to control insulin delivery without understanding the risks
  • Incorrect insulin dosing can cause severe hypoglycemia or death
  • Always have a fallback to the official CamAPS FX app
  • The authors are not responsible for any harm resulting from use of this information

If you choose to use this with a real insulin pump, you do so entirely at your own risk.

Credits & References

Contributing

Contributions are welcome! Areas where help is needed:

  • Verifying BLE command payload structures with a real YpsoPump
  • Completing the AAPS driver integration
  • Testing the Frida pump faking approach
  • Documenting per-command request/response formats
  • Adding support for extended bolus and basal profile commands

License

MIT License