-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Enable prototype pollution protection in TSVB #85952
Changes from 2 commits
2724105
8f12f42
389eb9c
9b74da8
631bd57
01711fd
0e2ce95
e773319
679417c
82cff88
0555f02
4160164
7b9aff0
b9185ee
4261fbe
8f1f8a9
59a0e40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import { visPayloadSchema } from '../../common/vis_schema'; | |
import { ROUTES } from '../../common/constants'; | ||
import { ValidationTelemetryServiceSetup } from '../index'; | ||
import { Framework } from '../plugin'; | ||
import { validateObject } from '../../../../core/server'; | ||
|
||
const escapeHatch = schema.object({}, { unknowns: 'allow' }); | ||
|
||
|
@@ -41,6 +42,7 @@ export const visDataRoutes = ( | |
}, | ||
async (requestContext, request, response) => { | ||
try { | ||
validateObject(request.body); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @flash1293 could you please confirm that it's exactly is what you described in #78908. Honestly I don't fully understand why we need it cause I've tried to add _ |
||
visPayloadSchema.validate(request.body); | ||
} catch (error) { | ||
logFailedValidation(); | ||
|
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.
I would really like to avoid static functions leaking outside of core. If this needs to be used in plugins, maybe moving it to a package (existing or new) would make sense. wdyt @legrego?
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.
I'm not opposed to moving this into a package. That'd certainly make it easier to consume
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.
@dziyanadzeraviankina we are currently discussing the details with @legrego. Note that if it's mandatory to have this merged for
7.11
, we could do the moving/refactoring at a later time. So considerer this approved on my side if this is urgent.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.
I'm not sure if there's a suitable package for that, maybe it could be moved to
kbn-config-schema
package, or is it better to create a new one?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.
Would
@kbn/std
work for this?