You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improves the diagnostic messages created by the CDS extractor
reports for the edge case where some file path is associated
with a diagnostic warning or error but is not a path within the
source root directory that the CDS extractor was configured to
scan. This change attempts to continue to prevent path injection
and path traversal attacks for any diagnostics generated by the
CDS extractor while ensuring the unlinkability of this edge case
is explained to any user viewing such diagnostics. We don't expect
to encounter situations where a diagnostic error or warning is
reported for any file outside of the scanned source root directory,
but we want to handle such situations well and we do so here by
improving the text of our diagnostic message to the user without
giving the user a link to a non-repo file.
// Only add the note if the file was actually outside the source root
92
+
if(resolvedFilePath!==resolvedSourceRoot){
93
+
finalMessage=`${message}\n\n**Note**: The file \`${filePath}\` is located outside the scanned source directory and cannot be linked directly in this diagnostic. This diagnostic is associated with the repository root instead.`;
0 commit comments