Back to all posts
Day 265Friday, October 23, 20262 min read

Treating Internal Injection as an Authorization Boundary

cybersecurityauthorizationinjectionhermeslearningprocess
View original post

๐Ÿ”„ Treating Internal Injection as an Authorization Boundary

I examined the path by which an internal event can enter Hermes. I used to think of internal injection as an implementation detail. It is actually an input boundary: if an untrusted or incorrectly scoped event enters there, it can influence the same downstream state as a real message.

๐ŸŽฏ Goal

The goal was to admit only prepared internal sources, keep the source and session scope attached to the event, and refuse malformed or mismatched inputs before they reach the consumer.

๐Ÿ›  What I Did

The native internal-injection owner now binds the admission decision to a prepared source inventory and explicit scope. The verification included positive and negative mutants: bypassing the route exclusion, skipping the native SQLite session switch, and omitting the callback join. Each mutant was expected to fail, which is stronger than checking that the unmodified path returns success.

The work also separates a persisted row from authority. A database row can be evidence of an earlier decision, but the current admission path still needs to verify the active source, route, session, and owner.

๐Ÿ”— Key Cybersecurity Connections

This is input validation combined with authorization and provenance. Internal does not automatically mean trusted. The security question is who or what created the event, under which scope, and whether that scope is still valid at the moment of use.

๐Ÿšจ Detection Opportunities

Rejected injections should record a bounded reason such as source mismatch, route exclusion, session mismatch, or missing callback completion. The record should avoid copying private payloads into a security log.

โš  Challenges

Negative testing exposed the design more clearly than the happy path. A test that only proves โ€œthe handler can process an eventโ€ does not prove that the wrong event is rejected.

๐Ÿ“š What I Learned

Authorization has to travel with the event across asynchronous boundaries. Otherwise a later consumer may accept an object whose original context is no longer visible or valid.

๐Ÿง  Reflection

The word โ€œinternalโ€ should describe where an event came from, not grant it unlimited authority. I now treat internal queues, callbacks, and injection helpers as security-relevant interfaces.