-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix accessibility and small patch #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a72c606
fix accessibility
Chenglong-MS dedf016
update vega-lite
Chenglong-MS 1252902
planning on some data input redesign
Chenglong-MS f92c55f
redesign data loader
Chenglong-MS ad342b9
keep this for now..
Chenglong-MS 0cb1183
ok
Chenglong-MS e2bb8cc
fixes and improvements
Chenglong-MS cb925ee
ok
Chenglong-MS 6932f78
TODO add agentic data selection
Chenglong-MS 12b123e
fixes
Chenglong-MS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Copilot Autofix
AI 5 days ago
General approach: Avoid returning raw exception details from the sandbox directly to the client. Instead, log detailed error information on the server, and return a generic but user-friendly error message over the API. If some feedback is needed for user-authored transformation code, keep it high-level and ensure it cannot contain stack traces or sensitive environment details.
Best fix in this context:
In
py_sandbox.run_in_main_process:error_messagederived from the exception, log the full details (including traceback) server-side usingtraceback.format_exc()."An error occurred while executing the transformation code.", or at most a brief classification (e.g.,"Import not allowed"), not including arbitrarystr(err).In
py_sandbox.run_transform_in_sandbox2020:{'status': 'error', 'content': ...}), but ensure that thecontentcomes from the sanitized error message produced byrun_in_main_process(as above). No changes needed if we change only whatrun_in_main_processreturns.In
tables_routes.refresh_derived_data:result.get('content', 'Unknown error during transformation')as the message, but becausecontentwill now be sanitized, it will no longer contain sensitive exception details.contentitself is safe.Concretely, we will:
Modify the
exceptblock inrun_in_main_process(lines around 106–111 inpy-src/data_formulator/py_sandbox.py) to:traceback.format_exc()and return it only in a field not propagated to the HTTP response (or not at all—just log it).'status'and'error_message', but ensureerror_messageis sanitized and does not embed arbitrarystr(err).Optionally, to preserve server-side diagnostics without changing imports, we can log the detailed traceback inside
run_in_main_processusingprintorwarnings, but a better approach (if a logger were available) would be logging. Since we must not add new imports beyond well-known ones and no logger is defined in this file, we will just avoid returning the sensitive details and, if desired, include a comment encouraging logging via outer layers.No changes are required in
tables_routes.refresh_derived_databeyond relying on the now-sanitized message, since the vulnerability is the content coming from the sandbox, not the shape of the JSON response.