fix(server): harden docs API path resolution for doc content#3091
Merged
fix(server): harden docs API path resolution for doc content#3091
Conversation
|
Generated by: track-bundle-size
new sizes (raw)To set the sizes as a new baseline, you can copy/paste next content to the {
"version": "6.4.4",
"timestamp": "2026-04-10",
"sizes": {
"templateApp": {
"css": 255089,
"js": 445908
},
"@epam/app": {
"css": 720897,
"js": 4936203
},
"@epam/electric": {
"css": 2275,
"js": 2883
},
"@epam/promo": {
"css": 47756,
"js": 9145
},
"@epam/uui-extra": {
"css": 0,
"js": 213
},
"@epam/loveship": {
"css": 55330,
"js": 43225
},
"@epam/uui-components": {
"css": 25157,
"js": 241794
},
"@epam/uui-core": {
"css": 0,
"js": 336983
},
"@epam/uui-db": {
"css": 0,
"js": 42718
},
"@epam/uui-docs": {
"css": 2152,
"js": 197287
},
"@epam/uui-editor": {
"css": 12954,
"js": 163688
},
"@epam/uui-timeline": {
"css": 2199,
"js": 75104
},
"@epam/uui": {
"css": 215800,
"js": 345665
}
}
}Generated by: generate-components-api Total amount of exported types/props without JSDoc comments
|
MSt1ch
approved these changes
Apr 16, 2026
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.
Problem
Snyk SAST (Javascript/Pt, CWE-23):
req.body.namefromPOST /get-doc-contentandPOST /save-doc-contentwas joined into a filesystem path forreadFileSync/writeFileSyncinserver/api/docs.ts. The previous check (includes('public/docs/content/')) is not a reliable path containment guarantee.Root cause
User-controlled
namewas combined with the docs content directory usingpath.joinand a substring check, which does not strictly prove the resolved path stays under the intended folder (and is weaker thanpath.resolve+path.relative).Fix
docsContentDirviapath.resolve(__dirname, '../../../public/docs/content').resolveDocJsonPath(name)usingpath.relative(docsContentDir, resolvedPath)and reject when the relative path starts with..or is absolute; reject missing/non-stringname.Files:
server/api/docs.tsHow to verify
cd server && yarn buildnamevalues; expect errors / no read outsidepublic/docs/contentfor invalid names.Affected areas for QA
server/), routes that load/save doc JSON underpublic/docs/content.@epam/uuipackages or main library bundles.