Skip to content

Security

The AbLead application uses a secure, industry-standard authentication stack and is designed with defense-in-depth and multi-tenant data isolation as core principles.


Technology Stack

  • Backend: Python/Flask with Flask-SQLAlchemy for database interactions.
  • Password Hashing: Uses Werkzeug's cryptographic password hashing (scrypt and PBKDF2-SHA256) with per-password random salts. Passwords are never stored in plain text; only their cryptographic hashes are stored in the database.
  • Passwordless and FIDO2/WebAuthn: Implements standard WebAuthn/FIDO2 credentials using the webauthn library, supporting public-key cryptography (ECDSA, RSASSA, and EDDSA) directly integrated with modern browsers.
  • Password Strength: Integrates the zxcvbn library to enforce high-entropy passphrases. Initial account setup and passphrase changes require a minimum of 12 characters, a complexity score of at least 3 out of 4, and cannot reuse the current passphrase.
  • Session Management and Instant Revocation: Uses Flask's cryptographically signed sessions paired with server-side session_version tracking. Changing or resetting a passphrase, completing account activation, timing out due to inactivity, or having an administrator disable or sign out an account immediately increments session_version and invalidates all existing browser sessions across all devices.
  • Email and Verification Security: Dispatches automated onboarding and password reset links with 256-bit cryptographically secure tokens (secrets.token_urlsafe(32)), host-header allowlist validation, encrypted SMTP connections (STARTTLS on port 587), and HTTPS transport.

Security Assessment

AbLead implements several layers of defense to protect user data:

Strong Hashing and Brute-Force Throttling

Memory-hard and computationally intensive hashing (scrypt / PBKDF2-SHA256) resists offline brute-force and dictionary attacks. Online authentication endpoints enforce strict rate limiting per client IP (request.remote_addr) for both login attempts and password-reset requests, and TOTP / recovery-code verification enforces a 5-attempt lockout that clears the pending authentication state and requires full re-authentication.

Signed Sessions and Global Session Invalidation

The application uses a unique, high-entropy SECRET_KEY to sign session cookies so session payloads cannot be forged or modified by a client. On every request, the server verifies the user's active status, account expiration, inactivity window, and session_version counter against the database.

CSRF Mitigation

The application configures session cookies with HttpOnly=True, SameSite="Lax", and Secure (on HTTPS deployments). In addition, all state-changing operations across user workspaces, trash management, and administrative controls strictly require POST or DELETE requests rather than GET navigation links, preventing cross-site request forgery via image tags, link pre-fetching, or third-party navigation.

SQL Injection Protection

All database communication is performed via the SQLAlchemy ORM using parameterized queries, ensuring that user input is never concatenated into raw SQL or executed as code.

Multi-Tenant Data Isolation and Access Control

Private application routes and API endpoints are protected by the @login_required decorator, which validates identity, active status, and session state on every request. Resource-level routes enforce strict ownership and granular permission checks:

  • Projects and Analysis Tools: Every project view, calculation endpoint, and export verifies get_project_permissions (read, write, grant, and is_owner). Read-only shared users and restricted (is_read_only) accounts are blocked from modifying sequences, custom liability rules, engineering variants, metadata, or project settings.
  • Organization-Scoped Sharing: Project sharing (ProjectShare) is strictly restricted to active users within the same organization (company_id or verified organization domain). Users without write access cannot grant or revoke write permissions, and soft-deleted projects in Trash are immediately inaccessible to non-owners.
  • Sub-Resource Ownership: NGS libraries (LibraryProject), custom KBC scoring and format sets (KbcScoringSet and KbcFormatSet), project labels (Label), residue observations (ResidueObservation), and 3D structure files all verify user ownership and parent-project permissions before reading or mutating data.

Administrative Impersonation for Training and Troubleshooting

AbLead includes a secure administrative impersonation capability designed strictly for customer support, guided onboarding, user training, and issue replication:

  • Purpose-Driven Support and Training: Impersonation is utilized exclusively to assist users with questions, guide team members through complex antibody analysis workflows during onboarding and training, and rapidly replicate user-reported bugs or unexpected behaviors in the exact project context where they occurred.
  • User-Level View Without Compromising Credentials: System administrators naturally possess access to the underlying application database and server infrastructure for system maintenance. Impersonation provides a user-level view of the application interface, allowing support staff to see projects, analysis tables, and configuration settings precisely as the user experiences them. This eliminates the need for users to share sensitive screenshots, record videos, or disclose login credentials. Administrative impersonation never reveals or compromises user passwords, recovery codes, or WebAuthn/FIDO2 passkey credentials, which remain cryptographically protected and unreadable.
  • Transparent In-App Visibility: Whenever an administrator impersonates a user account, the application displays a prominent, persistent indicator banner across the top of every screen detailing that impersonation is active. The session remains bounded to support activities and can be exited immediately with a single click, instantly returning the administrator to the management console.

Multi-Factor and Passwordless Authentication

AbLead supports multiple methods of advanced identity verification to protect user accounts:

  • Two-Factor Authentication (2FA): Supports the Time-based One-Time Password (TOTP) standard alongside one-time hashed recovery codes. Both TOTP and recovery-code verification enforce maintenance-mode restrictions, concurrent organization seat-token limits, and brute-force attempt limits.
  • Passwordless Authentication (Passkeys/WebAuthn): Supports cryptographically secure, passwordless authentication using FIDO2/WebAuthn. Users can register biometric sensors (Touch ID, Face ID, and Windows Hello) or physical security keys (YubiKey) from their profile. Passkey registration and login flows rely on challenge-response cryptography, protecting against phishing, credential stuffing, and replay attacks.

Model Context Protocol (MCP) and OAuth 2.0 Security

AbLead's Model Context Protocol (MCP) integration is protected by OAuth 2.0 with PKCE and strict per-user authorization:

  • OAuth 2.0 with PKCE (S256): Authorization requests require Proof Key for Code Exchange (S256), validate redirect_uri against registered client callback URIs, and require an explicit POST user consent confirmation before issuing a short-lived, single-use authorization code.
  • Hashed Bearer Tokens: Access and refresh tokens are stored exclusively as SHA-256 hashes in the database (McpOAuthToken) with enforced expiration windows and revocation checks.
  • Per-Tool Permission Enforcement: Every MCP tool requires an authenticated user context (user_id resolved from the verified OAuth Bearer token or API key) and enforces the exact same get_project_permissions (read and write) and library ownership checks as the web interface.

File Upload, Archive, and Script Export Sanitization

  • Archive Decompression Quotas and Path Containment: Project ZIP imports enforce strict member count limits, uncompressed byte quotas (250 MB maximum), symlink rejection, and secure_filename sanitization to prevent Zip Slip path traversal and decompression bombs. Server-side result file pointers (FILE:) are canonicalized with os.path.realpath and restricted to the designated results directory.
  • Structure and Script Export Sanitization: Structure downloads and ZIP exports sanitize filenames via secure_filename. Exported PyMOL scripts validate antibody and residue identifiers (^[A-Za-z0-9_.\-]+$) and strip newline characters from comment headers to prevent script injection, and administrative CSV exports neutralize leading spreadsheet formula characters (=, +, -, and @).

Email Transport and In-Transit Protection

All transactional emails (onboarding invitations, evaluation workspace provisioning, and password reset requests) are protected by multi-layered transport security:

  • SMTP Transport Encryption (STARTTLS): Outbound emails are dispatched over port 587 with explicit STARTTLS encryption between the application server and the outbound mail relay, preventing packet sniffing and man-in-the-middle (MITM) snooping on local networks and intermediate hops.
  • MTA-to-MTA Encryption and Routing Security: Mail relays enforce modern TLS transport in transit to recipient mail servers, protected by standard email domain authentication protocols (SPF, DKIM, and DMARC) alongside MTA-STS and DANE policies where supported by recipient mail exchange servers.
  • Trusted Host and HTTPS Link Generation: All verification and activation URLs are generated against an explicit allowlist of trusted application domains over HTTPS, preventing Host-header poisoning and ensuring end-to-end TLS encryption.

Verification Token Lifecycle and Onboarding Controls

Account invitation, onboarding, and self-service password recovery workflows employ defense-in-depth token management controls:

  • High-Entropy Cryptographic Tokens: Activation and reset tokens are generated using secrets.token_urlsafe(32) providing 256 bits of cryptographic entropy from the OS CSPRNG, making brute-force guessing or URL enumeration mathematically infeasible.
  • Strict Time-to-Live (TTL): Onboarding and evaluation tokens automatically expire within 24 hours (and password reset tokens within 2 hours). Expired tokens are rejected by the server.
  • Single-Use Invalidation: Activation endpoints are restricted to uninitialized accounts, and password-reset endpoints are restricted to active, initialized accounts. Tokens are permanently invalidated and cleared from the database immediately upon the first successful form submission, while incrementing session_version.
  • POST-Based Activation: The activation endpoint requires an explicit POST submission to accept the legal disclosure and establish credentials. Automated mail scanners and pre-fetch link crawlers performing GET requests cannot accidentally trigger or consume activation tokens.
  • Zero Prior Data Exposure: Newly provisioned evaluation and invited accounts contain no proprietary sequence or project data prior to onboarding. Isolated copies of example workspaces are seeded only after successful activation.
  • Real-Time Administrator Audit Alerts: Activation of new evaluation accounts immediately triggers automated notification alerts to system administrators with user and timestamp details for audit tracking.

Data Protection and Backups

To ensure business continuity, disaster recovery, and protection against data loss, AbLead implements a multi-layered 3-2-1 backup and archiving strategy:

  • Transaction-Consistent Database Snapshots: The core relational database (containing all sequences, structural data, liability matrices, and project metadata) is backed up nightly using SQLite's native online backup API. This guarantees transaction consistency, prevents torn pages or corrupt partial reads from concurrent Write-Ahead Log (WAL) writes, and captures a clean snapshot without application downtime.
  • Off-Site Cloud Object Storage Archiving: Immediately following creation and fast compression, snapshots are streamed directly off-site to a private, encrypted cloud object storage repository. Backups are retained under an automated cloud object lifecycle policy for 30 days across multiple fault domains, protecting against VM-level hardware failure, volume corruption, or cloud provider instance termination.
  • Local High-Speed Recovery Cache: The production host retains a single latest compressed snapshot locally. This allows operational maintenance routines (such as refreshing the isolated staging environment over an encrypted private virtual network or developer synchronization) to execute in seconds without cloud egress overhead.
  • Automated Infrastructure Volume Backups: In addition to application-level database backups, the production server utilizes policy-based boot volume backups in OCI (incremental snapshots executed weekly and retained across a strict 30-day lifecycle). This provides complete environment-level disaster recovery, enabling the entire server operating system, dependencies, machine learning models, and configurations to be restored on a new compute instance in minutes.
  • Staging and Non-Production Isolation: Testing and staging VMs operate without automated cloud volume backup policies. Database states on staging are populated on demand from production snapshots over an isolated private virtual cloud network (VCN), ensuring non-production environments generate zero lingering off-site backup footprints.
  • Secure In-Transit and At-Rest Protection: All off-site transfers are encrypted in transit over TLS and stored at rest using Oracle-managed encryption keys. Cloud upload endpoints use scoped Pre-Authenticated Requests restricted to write-only operations, preventing destructive or unauthorized bucket management from the application VM.

Data Retention and Deletion Lifecycles

AbLead enforces deterministic data retention and eradication lifecycles across both application databases and disaster-recovery archives. Depending on whether data is removed through end-user project management or administrative account deprovisioning, distinct lifecycle paths apply:

Scenario 1: Project Soft Deletion (Trash Workflow)

When an end user deletes a project, library, or standalone analysis run, the platform employs a two-stage deletion lifecycle designed to safeguard against accidental operational loss:

  • Trash Grace Period (30 Days): Deleting an item moves it to the Trash (is_deleted = True), initiating a 30-day retention countdown. During this window, the project remains in the active database but is segregated from standard views and analysis tools, allowing users to restore the workspace if deleted unintentionally.
  • Automated Database Purge: Projects and runs exceeding the 30-day retention threshold are automatically and permanently purged from the active database by an automated scheduled maintenance task. Purging permanently deletes all antibody sequences, liability metrics, calculated 3D structural models, and associated filesystem run artifacts.
  • Backup and Archival Expiration: Nightly database snapshots and weekly infrastructure volume backups taken while the item was in Trash continue to hold historical copies. Once the item is purged on Day 31, no subsequent backups contain the data. Older archives in encrypted cloud object storage and rolling volume snapshots automatically expire on their rolling 30-day retention lifecycle.
  • Maximum Eradication Window: All project data is permanently and irreversibly eradicated across live databases, off-site database archives, and infrastructure recovery snapshots within 60 to 61 days of the initial user action (30-day Trash grace period plus 30-day backup expiration).

Scenario 2: Administrative Account Deletion (Hard Purge)

When an administrator deletes a user account (for example, upon contract conclusion or customer request), the system enforces an immediate, hard-deletion protocol:

  • Immediate Cascading Purge: Account deletion immediately bypasses the Trash and executes an atomic, hard-delete purge across all relational tables and disk storage. All associated projects, antibody records, liability matrices, results zip files, and uploaded sequence files are permanently wiped immediately.
  • Audit Metadata Isolation: Only non-sensitive audit metadata (such as username, affiliation, and account creation timestamp) is preserved to maintain compliance logs, with zero proprietary sequence, structural, or project data retained.
  • Backup and Archival Expiration: The very next nightly database snapshot taken at 02:00 UTC reflects the purged state. Historical database archives and rolling weekly infrastructure snapshots containing prior snapshots automatically expire and are purged under the 30-day retention rule.
  • Maximum Eradication Window: All user and sequence data is completely and irreversibly eradicated across live systems, off-site database archives, and infrastructure recovery snapshots within 30 days of account deletion.

Summary of Data Retention and Eradication Lifecycles

Deletion Scope Live Application State Off-Site Database Archives (OCI Object Storage) Infrastructure Disaster Recovery Snapshots (OCI Boot Volume) Maximum Time to Complete Eradication
Project Moved to Trash 30 days (Trash grace period) 30 days (rolling lifecycle) 30 days (rolling weekly lifecycle) 60 to 61 days
User Account Deprovisioned Immediately purged 30 days (rolling lifecycle) 30 days (rolling weekly lifecycle) 30 days

Inactivity Timeout

To protect sessions on shared or public terminals, the system includes a configurable inactivity timeout (typically 30 to 60 minutes). If no activity is detected within this window, the session is invalidated both client-side and server-side (clearing last_activity and incrementing session_version), and the user is automatically logged out.

Overall, the authentication architecture, access control model, and data handling in AbLead adhere to modern web security best practices for enterprise biotherapeutic software.