fix(dashboard): harden config selector paths - #9656
Open
LIghtJUNction wants to merge 1 commit into
Open
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
astrbot-docs | fbbb681 | Commit Preview URL Branch Preview URL |
Aug 13 2026, 06:24 AM |
LIghtJUNction
marked this pull request as ready for review
August 13, 2026 07:22
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider extracting the repeated
['__proto__', 'prototype', 'constructor']list into a shared constant or helper function to avoid duplication and make future changes to disallowed keys easier. - You might want to guard
Object.prototype.hasOwnProperty.call(current, key)with a more explicit object check (e.g.,current !== null && typeof current === 'object') to avoid surprising behavior ifcurrentis ever a non-object value during traversal.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the repeated `['__proto__', 'prototype', 'constructor']` list into a shared constant or helper function to avoid duplication and make future changes to disallowed keys easier.
- You might want to guard `Object.prototype.hasOwnProperty.call(current, key)` with a more explicit object check (e.g., `current !== null && typeof current === 'object'`) to avoid surprising behavior if `current` is ever a non-object value during traversal.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__proto__,prototype, andconstructorsegments in dashboard config selectorsdevcommit99f57c9Why
The selector setter accepted arbitrary path segments and could write through JavaScript prototype-related keys. The getter also traversed inherited properties. This keeps selector access limited to the intended configuration object.
Impact
This is a one-file defensive change with no API, dependency, or configuration changes. Normal selector paths keep the existing behavior.
Extracted as a small, reviewable part of the broader draft PR #6325.
Validation
pnpm run typecheckpnpm run buildgit diff --checkThe production build completed successfully. Its existing Google Fonts download step logged a DNS warning in the restricted build environment but did not fail the build.
Summary by Sourcery
Harden dashboard configuration selector handling to avoid unsafe prototype path access while preserving existing behavior for normal selectors.
Bug Fixes: