HustleHub Security & Mini-App Architecture
At HustleHub, trust, student privacy, and infrastructure security are foundational principles. Because our platform enables peer-to-peer campus services, end-to-end encrypted messaging, and student-developed web applications (Mini-Apps), we employ defense-in-depth engineering to isolate untrusted web code, secure transactions, and protect student identity.
1. Mini-App Sandbox Architecture
HustleHub allows verified student developers to publish lightweight web applications that provide utilities and commerce within the campus ecosystem. To prevent cross-site scripting (XSS), data exfiltration, or malicious native execution, all mini-apps run within a hardened container:
-
Isolated WebView Environment: Mini-apps are rendered inside a sandboxed
WebViewinstance. Third-party web code is prevented from accessing Android operating system APIs, file system storage, camera, microphone, or contacts without explicit native runtime user permission. - HTTPS Mandatory: Every mini-app entry point must be served over secure, validated HTTPS. Unencrypted HTTP endpoints are blocked to prevent man-in-the-middle (MITM) attacks and script injection.
-
Intent and Scheme Filtering: The host shell intercepts and validates all navigation requests. External URI schemes (such as
tel:,mailto:, or custom Android intent URIs) are sanitized before being delegated to the operating system, preventing intent redirection attacks. - Controlled Backstack and Navigation: Hardware back-press events and navigation history are managed by the native host container, ensuring students can always exit or close any mini-app immediately without trap-loops.
2. Zero-Trust JavaScript Bridge (HustleBridge)
Communication between the native Android app and the hosted web mini-app occurs exclusively through a strictly defined JavaScript interface: window.HustleBridge.
The bridge operates on a strict principle of least privilege:
-
Profile Minimization (
getStudentProfile()): Mini-apps can request only public student profile attributes (such as display name and public student ID) required to personalize the web interface. Private contact numbers, university login credentials, and private chat histories are physically excluded from the bridge response. -
Main-Thread Dispatched Callbacks: All cross-context invocations and custom events (e.g.
HustlePaymentComplete) are sanitized and dispatched safely on Android's main looper, mitigating thread-concurrency vulnerabilities. - No Arbitrary Code Injection: The native application does not allow mini-apps to execute arbitrary native reflection or manipulate Android application components.
3. Native-Mediated Payment Security
Mini-apps often facilitate campus micro-commerce (event tickets, campus merchandise, club dues, service bookings). To eliminate fraudulent charges, hidden fees, and credential theft:
- No Direct Payment Gateway Access: Mini-apps never touch Safaricom Daraja API keys, consumer secrets, merchant passkeys, or bank credentials.
-
Native Confirmation Bottom Sheet: When a mini-app requests a payment via
requestPayment(amount, memo, reference, callbackId), the call is intercepted by HustleHub's native shell. A native Material 3 modal sheet is displayed to the student, showing the exact amount in KES, recipient app name, and purpose. - Explicit Student Authorization: No transaction can execute automatically in the background. An M-Pesa STK push is initiated only after the student explicitly clicks "Pay with M-Pesa" on the un-spoofable native dialog.
-
Asynchronous Event Notification: Once the transaction resolves, the native host emits a localized DOM event (
HustlePaymentComplete) with the verification receipt number and status. The mini-app never handles or sees the student's M-Pesa PIN.
4. End-to-End Encrypted (E2EE) Campus Messaging
In addition to mini-app security, HustleHub protects student peer-to-peer communication through hardware-backed cryptography:
- On-Device Key Management: Asymmetric key pairs are generated using Android's hardware-backed Keystore system. Private keys never leave the student's physical device.
- Authenticated Encryption: Chat messages are encrypted on the sender's device using AES-256-GCM before transmission over TLS 1.3 to our backend.
- Zero Knowledge on Server: HustleHub servers and administrators cannot read, decrypt, or tamper with message contents exchanged between students.
5. Mini-App Admin Vetting and Lifecycle Moderation
Every mini-app submitted to HustleHub passes through a comprehensive security and quality assurance pipeline:
-
Vetting Queue: All newly submitted mini-apps enter a
PENDINGstate. They are invisible to the campus community until thoroughly tested and reviewed by the moderation team. - Security Inspection: Reviewers verify HTTPS certificates, review requested endpoints for phishing or malicious redirects, check compliance with campus academic integrity policies, and verify that payment flows accurately reflect delivered goods.
-
Immediate Kill-Switch: The HustleHub administration dashboard includes real-time controls to immediately set any mini-app to
REJECTEDor inactive status, revoking platform access instantly if suspicious behavior or a security flaw is detected.
6. Vulnerability Disclosure & Incident Reporting
We welcome responsible security research from MUST students, white-hat security researchers, and the wider tech community. If you discover a vulnerability or security flaw in the HustleHub Android app, mini-app bridge, or backend infrastructure:
We commit to acknowledging vulnerability reports within 48 hours, providing regular remediation updates, and crediting researchers who adhere to responsible disclosure principles.
7. Contact Security Team
Email: kotlin.hustlehub@gmail.com
Team: KDroiders of MUST Innovation Club (Technical & Security Lead)
Institution: Meru University of Science and Technology (MUST), Main Campus, Meru, Kenya