The vulnerability in django-unicorn (GHSA-ffv6-jj46-x367) stemmed from an improper access control weakness. The core of the issue was that the framework failed to validate whether properties and methods were public before modifying or executing them. The analysis of the security patches between the vulnerable version (0.66.1) and the patched version (0.67.0) confirms this.
The primary vulnerable functions were set_property_value and _call_method_name. These functions are responsible for handling component state updates and method calls triggered by frontend actions. Before the patch, they would directly use setattr and getattr on component objects based on user-provided input from the action queue. This allowed an attacker to craft a request to modify sensitive internal properties (like template_name) or call protected methods (like reset), bypassing the intended security model which relies on the _is_public check.
The patch, found in commit d8ab55392f2c9a18239271669360c322fdce7332, rectifies this by adding explicit checks using component._is_public() at the beginning of both set_property_value and _call_method_name. This ensures that only attributes and methods explicitly marked as public can be accessed.
A secondary, related vulnerability was fixed in set_property_from_data (commit f98816bbfb47e76cf6691ecca6e1cca1b2aec4ad) as a defense-in-depth measure. This function also lacked the _is_public check, creating another vector for unauthorized state modification. During exploitation, a stack trace would likely show calls to these functions when processing a malicious request.