Skip to content

feat: self state across methods - #62

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/self-state
Sep 4, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/self-state

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Second point of the consolidation: attribute state on self across methods. self.cmd = argv in __init__ then os.system(self.cmd) in run() was invisible, each method seeing its own self.

  • Tests first (test: define self state across methods), implementation follows.
  • The call graph knows the classes of a module: App(x) is a call to App.__init__ whose receiver is the new object, app.run() on an instance, self.run() inside a method and a.run() on a parameter annotated with the class are calls to the class's methods. Unknown classes stay unknown.
  • Taint and dependence treat the receiver as the method's implicit first parameter: a method's summary already expresses what it reads from self as a dependency on its first parameter, and callers now map that parameter onto the receiver, contents included, so a value stored by __init__ or a setter method and read by another flows through the object, reported at the call site with through. It works across files through the project index, where App(x) looks up App.__init__.
  • A method the framework calls, an entry point, starts with the attributes its sibling methods store into self from their own inputs and sources: self.cmd = request.POST[...] in a Django view's post reaches os.system in its get. Methods the project calls get their self from the caller instead, so nothing is invented for a class nobody drives.

On the sixteen repositories nothing changes: their classes hold no attacker-controlled state between methods.

@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 4, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit 9e9e100 into main Sep 4, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/self-state branch September 4, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant