Frontmatter
| id | 8466 |
| title | Prevent Prototype VDOM Mutation in Component.Base afterSetId |
| state | Closed |
| labels | bugaicore |
| assignees | tobiu |
| createdAt | Jan 9, 2026, 2:56 PM |
| updatedAt | Jan 9, 2026, 2:58 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8466 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 9, 2026, 2:58 PM |
Prevent Prototype VDOM Mutation in Component.Base afterSetId
tobiu assigned to @tobiu on Jan 9, 2026, 2:58 PM

tobiu
Jan 9, 2026, 2:58 PM
Input from Gemini 3 Pro:
✦ ✦ I have implemented a guard in
afterSetIdto prevent prototype mutation during the construction phase.Details
- The Issue:
afterSetIdwas running duringconstruct()beforeinitConfig()had cloned the_vdomobject. This caused the method to write IDs directly into the class prototype's_vdom.- The Fix: Added a check for
this.configsApplied. This ensures the VDOM update logic only runs for runtime ID changes. The initial ID setup is now safely delegated toVdomLifecycle.initVnode.Verified with existing unit tests.
Commit: b9098cbf8 (#8466)
tobiu closed this issue on Jan 9, 2026, 2:58 PM
The
afterSetIdmethod insrc/component/Base.mjswas found to be executing during theconstruct()phase before the instance-specific_vdomclone is created. This causes the method to write IDs directly to the shared class prototype_vdomobject, which is architecturally unsafe and leads to prototype pollution.The fix involves adding a guard
if (this.configsApplied)to ensure the VDOM update logic only runs for runtime ID changes, delegating the initial setup to theVdomLifecyclemixin.