-
Notifications
You must be signed in to change notification settings - Fork 665
DYN-9862 UnTrusted Paths Notifications #16752
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
base: master
Are you sure you want to change the base?
DYN-9862 UnTrusted Paths Notifications #16752
Conversation
If TrustedLocations list contain paths pointing to ProgramData, we will be logging a warning notification (also in console but that functionality already existed). Also added resource strings for localization of messages shown in the notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9862
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a security warning notification when trusted locations point to potentially unsafe paths in ProgramData. The implementation logs a warning when any trusted location starts with the CommonApplicationData path, helping users identify potential security risks in their Dynamo configuration.
Key Changes:
- Added localized resource strings for unsafe path detection notifications
- Implemented validation logic to detect and warn about trusted locations in ProgramData
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Notifications/Properties/Resources.resx | Added resource strings for "No notifications" UI text and unsafe path warning messages |
| src/Notifications/Properties/Resources.en-US.resx | Added English-specific resource strings for unsafe path detection warnings |
| src/Notifications/NotificationsViewExtension.cs | Implemented validation logic to check trusted locations against ProgramData path and display warnings |
Files not reviewed (1)
- src/Notifications/Properties/Resources.Designer.cs: Language not supported
| string programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); | ||
| foreach (var location in viewModel.Model.PreferenceSettings.TrustedLocations) | ||
| { | ||
| if (location.StartsWith(programDataPath)) | ||
| { | ||
| Notifications.Add(new NotificationMessage("Preference Settings", Properties.Resources.UnsafePathDetectedTitle, Properties.Resources.UnsafePathDetectedDetail + "\n" + location)); | ||
| } | ||
| } |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path comparison using StartsWith() may produce false positives on case-sensitive file systems or when paths have different separator formats. Use Path.GetFullPath() to normalize both paths before comparison, and consider using StringComparison.OrdinalIgnoreCase for the comparison to handle case differences on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| foreach (var location in viewModel.Model.PreferenceSettings.TrustedLocations) | ||
| { | ||
| if (location.StartsWith(programDataPath)) | ||
| { | ||
| Notifications.Add(new NotificationMessage("Preference Settings", Properties.Resources.UnsafePathDetectedTitle, Properties.Resources.UnsafePathDetectedDetail + "\n" + location)); | ||
| } | ||
| } | ||
| notificationsMenuItem.NotificationsChangeHandler.Invoke(this, null); |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NotificationsChangeHandler.Invoke() call is placed outside the loop, which means it will be called even when no unsafe paths are detected. This should be moved inside the conditional block (after line 122) or wrapped in a check to only invoke when notifications were actually added.
| foreach (var location in viewModel.Model.PreferenceSettings.TrustedLocations) | |
| { | |
| if (location.StartsWith(programDataPath)) | |
| { | |
| Notifications.Add(new NotificationMessage("Preference Settings", Properties.Resources.UnsafePathDetectedTitle, Properties.Resources.UnsafePathDetectedDetail + "\n" + location)); | |
| } | |
| } | |
| notificationsMenuItem.NotificationsChangeHandler.Invoke(this, null); | |
| bool notificationAdded = false; | |
| foreach (var location in viewModel.Model.PreferenceSettings.TrustedLocations) | |
| { | |
| if (location.StartsWith(programDataPath)) | |
| { | |
| Notifications.Add(new NotificationMessage("Preference Settings", Properties.Resources.UnsafePathDetectedTitle, Properties.Resources.UnsafePathDetectedDetail + "\n" + location)); | |
| notificationAdded = true; | |
| } | |
| } | |
| if (notificationAdded) | |
| { | |
| notificationsMenuItem.NotificationsChangeHandler.Invoke(this, null); | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refactoring code for preventing false positives in the StartsWith call
re-trigger job
|
Hi team, do you have any comment about this changes? |

Purpose
If TrustedLocations list contain paths pointing to ProgramData, we will be logging a warning notification (also in console but that functionality already existed).
Also added resource strings for localization of messages shown in the notification (and adding missing localization resources).
Declarations
Check these if you believe they are true
Release Notes
If TrustedLocations list contain paths pointing to ProgramData, we will be logging a warning notification (also in console but that functionality already existed).
Reviewers
@zeusongit @reddyashish
FYIs
@jnealb