<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Michael Errington</title>
    <description>The latest articles on Forem by Michael Errington (@michael_s_errington).</description>
    <link>https://forem.com/michael_s_errington</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3776529%2F80846615-2ee2-454f-85f1-0658da1a1af3.png</url>
      <title>Forem: Michael Errington</title>
      <link>https://forem.com/michael_s_errington</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/michael_s_errington"/>
    <language>en</language>
    <item>
      <title>Userland Authority: How Non-Root Termux Can Mint TLS Identities and Expose Hidden Trust Gaps</title>
      <dc:creator>Michael Errington</dc:creator>
      <pubDate>Tue, 17 Feb 2026 03:27:15 +0000</pubDate>
      <link>https://forem.com/michael_s_errington/userland-authority-how-non-root-termux-can-mint-tls-identities-and-expose-hidden-trust-gaps-2k98</link>
      <guid>https://forem.com/michael_s_errington/userland-authority-how-non-root-termux-can-mint-tls-identities-and-expose-hidden-trust-gaps-2k98</guid>
      <description></description>
      <category>android</category>
      <category>infosec</category>
      <category>cybersecurity</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>X.509 Beyond Trust: Weaponizing Certificate Extensibility Without Breaking TLS</title>
      <dc:creator>Michael Errington</dc:creator>
      <pubDate>Tue, 17 Feb 2026 01:05:16 +0000</pubDate>
      <link>https://forem.com/michael_s_errington/x509-beyond-trust-weaponizing-certificate-extensibility-without-breaking-tls-2knj</link>
      <guid>https://forem.com/michael_s_errington/x509-beyond-trust-weaponizing-certificate-extensibility-without-breaking-tls-2knj</guid>
      <description></description>
      <category>cybersecurity</category>
      <category>android</category>
      <category>python</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>Abuserland: The most elegant attacks require nothing more than the device already in your hand.</title>
      <dc:creator>Michael Errington</dc:creator>
      <pubDate>Mon, 16 Feb 2026 22:38:16 +0000</pubDate>
      <link>https://forem.com/michael_s_errington/i-built-a-reproducible-pki-and-tls-lab-inside-a-constrained-mobile-environment-3b5p</link>
      <guid>https://forem.com/michael_s_errington/i-built-a-reproducible-pki-and-tls-lab-inside-a-constrained-mobile-environment-3b5p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Abuserland: Living Off The Land&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Exploiting Python’s Naive Timestamps in Unprivileged Android Termux Environments&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Version 1.2&lt;/strong&gt; – Living Off The Land Edition&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Written and Researched&lt;/strong&gt; by &lt;strong&gt;Michael S. Errington&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;In this report, I document a practical, systemic weakness that manifests as a pure Living Off The Land (LOTL) attack: the use of Python’s &lt;code&gt;datetime.datetime.utcnow()&lt;/code&gt; in unprivileged userland environments such as Android Termux. While &lt;code&gt;utcnow()&lt;/code&gt; has long been relied upon to obtain current UTC time, it produces a naive datetime object that carries no timezone metadata. In environments lacking hardened system level protections, this naive timestamp becomes a silent weapon. Userland processes inherit a fully malleable local device clock with no cryptographic assurance of accuracy or NTP synchronization.&lt;/p&gt;

&lt;p&gt;When these naive timestamps are embedded in security critical artifacts — TLS/X.509 certificates (&lt;code&gt;notBefore&lt;/code&gt;/&lt;code&gt;notAfter&lt;/code&gt;), JWT/OAuth tokens (&lt;code&gt;nbf&lt;/code&gt;/&lt;code&gt;exp&lt;/code&gt;/&lt;code&gt;iat&lt;/code&gt; claims), signed session tokens, or forensic log events — downstream consumers interpret them under divergent assumptions (UTC, local time, or implicit coercion). The resulting interpretive drift creates exploitable gaps in validity windows, replay protection, and timeline integrity.&lt;/p&gt;

&lt;p&gt;I have found that Termux transforms this ambiguity into a high fidelity LOTL vector: the attack requires zero additional tools, zero privilege escalation, and zero external payloads. An adversary simply installs Termux (a legitimate terminal emulator), runs stock Python, manipulates the accessible device clock via builtin Android settings or Termux commands, and generates security artifacts using only the platform’s native capabilities. This is classic Living Off The Land — the device itself becomes the attack platform.&lt;/p&gt;

&lt;p&gt;The vulnerability I describe is not a bug in Python but a structural failure at the intersection of naive time semantics and untrusted userland clocks. In the pages that follow, I provide a complete, production ready framework for proof of concept (PoC) documentation, red team exercises, and responsible disclosure.&lt;/p&gt;

&lt;p&gt;Python’s &lt;code&gt;datetime.datetime.utcnow()&lt;/code&gt; returns a naive &lt;code&gt;datetime&lt;/code&gt; object — a numeric timestamp stripped of any timezone metadata or offset. By longstanding convention it represents UTC, yet the object itself contains no proof of that assumption.&lt;/p&gt;

&lt;p&gt;In my research, I observed that consuming libraries and validators therefore apply their own interpretation rules: some assume UTC, others coerce to local system time, and still others apply legacy platform specific parsing. In hardened server environments this drift is usually masked by uniform NTP enforcement. In heterogeneous, mobile, or userland generated scenarios, however, the same numeric value can resolve to materially different absolute instants.&lt;/p&gt;

&lt;p&gt;Security primitives built on strict temporal semantics are therefore placed at risk:&lt;br&gt;
 X.509 certificate &lt;code&gt;notBefore&lt;/code&gt; / &lt;code&gt;notAfter&lt;/code&gt; fields&lt;br&gt;&lt;br&gt;
 JWT/OIDC &lt;code&gt;nbf&lt;/code&gt; / &lt;code&gt;exp&lt;/code&gt; / &lt;code&gt;iat&lt;/code&gt; claims&lt;br&gt;&lt;br&gt;
 Shortlived token issuance and replay windows&lt;br&gt;&lt;br&gt;
 Forensic log timestamps used for SIEM correlation  &lt;/p&gt;

&lt;p&gt;Because the entire attack lives off the land — using only Python’s builtin standard library and the device’s native clock — detection and prevention are significantly harder than for traditional malware based threats.&lt;/p&gt;

&lt;p&gt;In my analysis, Android Termux is the perfect embodiment of LOTL attack surface:&lt;/p&gt;

&lt;p&gt;Pure userland execution: No root, no custom kernel modules, no sideloaded binaries required.&lt;br&gt;&lt;br&gt;
 No enforced NTP or kernel level time protections: The Python interpreter inherits the device system clock, which any unprivileged app or user setting can alter.&lt;br&gt;&lt;br&gt;
 Frequent timezone and clock mobility: Mobile devices routinely cross timezones or undergo manual adjustments — all accessible without elevation.&lt;br&gt;&lt;br&gt;
 Absence of time attestation primitives: Termux cannot cryptographically prove to a remote verifier that its clock was NTP synchronized at the moment of artifact generation.&lt;br&gt;&lt;br&gt;
 Mass replication at scale: An attacker can spin up dozens or hundreds of Termux instances across cheap Android devices or emulators, each with deliberately skewed clocks, all using only legitimate, pre-installed tools.&lt;/p&gt;

&lt;p&gt;Pure LOTL Characteristics&lt;br&gt;&lt;br&gt;
The entire chain uses only components already present or legitimately installed on the target device:&lt;br&gt;
 Termux terminal emulator&lt;br&gt;&lt;br&gt;
 Stock Python 3 runtime&lt;br&gt;&lt;br&gt;
 Android system clock controls&lt;br&gt;&lt;br&gt;
 Builtin certificate and token libraries  &lt;/p&gt;

&lt;p&gt;No C2, no dropped files outside Termux’s home directory, no privilege escalation. The land itself provides the weapon.&lt;/p&gt;

&lt;p&gt;To support responsible disclosure and controlled testing, I outline a high level LOTL PoC structure that demonstrates interpretation divergence and temporal control subversion using only conceptual descriptions suitable for lab documentation.&lt;/p&gt;

&lt;p&gt;High level LOTL PoC Structure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Artifact Generation Phase&lt;br&gt;&lt;br&gt;
An unprivileged Termux Python process generates a security artifact (CSR, self signed certificate, or signed token) using only &lt;code&gt;datetime.datetime.utcnow()&lt;/code&gt; for all temporal fields.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clock Manipulation Phase (lab controlled, userland only)&lt;br&gt;&lt;br&gt;
The device system clock is adjusted forward or backward using builtin Android/Termux mechanisms prior to generation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Divergent Validation Phase&lt;br&gt;&lt;br&gt;
The artifact is submitted to multiple validators with differing timestamp interpretation policies (strict UTC vs. implicit local-time coercion).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Observation&lt;br&gt;&lt;br&gt;
Record acceptance/rejection outcomes, effective validity windows, and timeline discrepancies across systems.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Success Criteria (documentation only):&lt;br&gt;&lt;br&gt;
 Artifact accepted outside intended temporal window on at least one validator.&lt;br&gt;&lt;br&gt;
 Aggregated logs show non monotonic or conflicting timelines.&lt;br&gt;&lt;br&gt;
 All steps remain conceptual; no code, commands, or operational instructions are supplied.&lt;/p&gt;

&lt;p&gt;Through my testing and analysis I have identified the following illustrative abuse scenarios, all executable entirely within the legitimate Termux environment:&lt;/p&gt;

&lt;p&gt;Extended Certificate Validity (LOTL Forward Skew): Clock advanced before generation → naive &lt;code&gt;notAfter&lt;/code&gt; resolves far into the future on UTC assuming systems.&lt;br&gt;&lt;br&gt;
 Premature Token Acceptance (LOTL Backward Skew): Clock set back → naive &lt;code&gt;nbf&lt;/code&gt;/&lt;code&gt;iat&lt;/code&gt; makes tokens appear immediately valid despite global time.&lt;br&gt;&lt;br&gt;
 Cross Endpoint Token Replay: Shortlived tokens generated with naive timestamps remain valid longer on lax validators, enabling reuse well beyond intended lifetimes.&lt;br&gt;&lt;br&gt;
 Log Poisoning &amp;amp; Forensic Obfuscation: Skewed naive timestamps create inconsistent timelines in SIEM aggregates, placing malicious activity outside analyst review windows.&lt;/p&gt;

&lt;p&gt;In operational environments I recommend monitoring for these behavioral indicators:&lt;br&gt;
 Divergent validation results for identical artifacts across services&lt;br&gt;&lt;br&gt;
 Clusters of artifacts from mobile/unprivileged sources with anomalous validity windows&lt;br&gt;&lt;br&gt;
 Frequent device clock or timezone adjustments originating from Termux processes&lt;br&gt;&lt;br&gt;
 Non monotonic sequences in aggregated logs from userland Android contexts&lt;br&gt;&lt;br&gt;
 Presence of &lt;code&gt;utcnow()&lt;/code&gt; (or equivalent naive calls) in code paths that generate security artifacts&lt;/p&gt;

&lt;p&gt;I propose the following safe, actionable detection strategies:&lt;br&gt;
 Runtime instrumentation to flag/block naive datetime usage in security paths&lt;br&gt;&lt;br&gt;
 UEBA/SIEM anomaly scoring on clock change frequency and Termux activity&lt;br&gt;&lt;br&gt;
 Mandatory independent time attestation for artifacts from mobile/untrusted sources&lt;br&gt;&lt;br&gt;
 Log normalization that rejects or alerts on timestamps lacking zone metadata&lt;br&gt;&lt;br&gt;
 LOTL specific monitoring: baseline legitimate Termux usage and alert on security artifact generation&lt;/p&gt;

&lt;p&gt;Source Level (Immediate &amp;amp; Mandatory)&lt;br&gt;&lt;br&gt;
I strongly recommend replacing every instance of &lt;code&gt;datetime.datetime.utcnow()&lt;/code&gt; with:&lt;br&gt;&lt;br&gt;
&lt;code&gt;datetime.datetime.now(datetime.UTC)&lt;/code&gt; (Python 3.11+) or &lt;code&gt;datetime.datetime.now(timezone.utc)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Engineering Hygiene&lt;br&gt;&lt;br&gt;
 Static analysis and code review gates that treat naive date times as disallowed in security paths.&lt;br&gt;&lt;br&gt;
 Explicit &lt;code&gt;timezone.utc&lt;/code&gt; everywhere timestamps enter cryptographic boundaries.&lt;br&gt;&lt;br&gt;
 Certificates must encode UTC offsets; logs must be normalized against trusted UTC at ingestion.&lt;/p&gt;

&lt;p&gt;Server Side Policy (Defense in Depth)&lt;br&gt;&lt;br&gt;
 Never trust client supplied timestamps without crosscheck against authoritative server time.&lt;br&gt;&lt;br&gt;
 Conservative acceptance windows + supplementary evidence (OCSP, timestamping authorities, NTP attestation).&lt;br&gt;&lt;br&gt;
 Shortened tolerance for mobile/unverified sources.&lt;/p&gt;

&lt;p&gt;Endpoint &amp;amp; Platform Controls&lt;br&gt;&lt;br&gt;
 MDM posture checks requiring verified NTP sync before artifact acceptance.&lt;br&gt;&lt;br&gt;
 Monitor and, where possible, restrict Termux like userland runtimes in production.&lt;br&gt;&lt;br&gt;
 Recognize that in userland environments, naive time must never be treated as a secure boundary.&lt;/p&gt;

&lt;p&gt;Through this research I have demonstrated that this LOTL temporal semantics vulnerability undermines the foundations of authentication, authorization, revocation, and forensic integrity. Certificates and tokens can bypass intended lifetimes, sessions can be replayed, and forensic timelines can be poisoned — all without introducing a single malicious binary.&lt;/p&gt;

&lt;p&gt;What I have uncovered is a structural vulnerability: the gap between &lt;code&gt;utcnow()&lt;/code&gt; behavior and consuming system interpretation, amplified by the malleability of userland clocks. By weaponizing only legitimate platform features, attackers achieve persistent, low and slow access that evades traditional detection.&lt;/p&gt;

&lt;p&gt;In the realm of security, time itself is not neutral — it is a boundary that must be guarded with the same rigor as keys, credentials, and code. Abuserland: Living Off The Land exposes how the simplest assumption (“the clock is correct”) becomes the weakest link when the land itself can be turned against you.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>security</category>
      <category>android</category>
    </item>
  </channel>
</rss>
