Conversation
…ent prototype pollution
|
LGTM |
|
Could we prioritize merging this? |
… test for '__proto__' key
aloisklink
left a comment
There was a problem hiding this comment.
Looks good to me!
I think this new approach using Object.defineProperty is much better then what you had in ad80439, and it's less likely to break any existing code if it does happen to use __proto__ or constructor.
I think we can make the new prop writable too, to avoid potentially breaking anybody that is directly using the addConflict() function, but I doubt anybody is, and dagre doesn't seem to care if the created props are writable or not.
This won't affect any code that dagre uses, but it might affect third-party libraries.
|
@tbo47, I don't have publish permissions on NPM. Would you be up for merging this and making a 7.0.13 release? I don't think anybody is using this |
## Description Upgrade the patch version of dagre-d3-es to the [latest release](tbo47/dagre-es#54) to address a critical vulnerability ([CVE-2025-57347](GHSA-cc8p-78qf-8p7q)) identified in recent security scans. ## Motivation and Context ## Impact N/A ## Test Plan Manual test ## Contributor checklist - [x] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards). - [x] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced. - [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality. - [ ] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines). - [ ] Adequate tests were added if applicable. - [ ] CI passed. - [ ] If adding new dependencies, verified they have an [OpenSSF Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or higher (or obtained explicit TSC approval for lower scores). ## Release Notes Please follow [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines) and fill in the release notes below. ``` == RELEASE NOTES == General Changes * Upgrade dagre-d3-es to 7.0.13 in response to `CVE-2025-57347 <https://github.com/advisories/GHSA-cc8p-78qf-8p7q>`_.
|
This didn't seem to work so I have created this with the help of cursor #59 |
* test: type `var conflicts` vars in `bk.test.js` This fixes any potential type errors when calling the `addConflict` function in our unit tests, after the changes from dbe53cb (fix: Prototype Pollution (#54), 2025-10-21). Fixes: dbe53cb * test: import missing `beforeEach` and `afterEach` Vitest adds these automatically, so it didn't cause any issues when running the tests, but it did cause issues with TypeScript. * test: type `var g` with `Graph` This lets TypeScript check that the functions we call on this type are valid. * build: change `tsconfig.json` to type-check tests Update the `tsconfig.json` file to also type-check the tests, checking for any potential mistakes we make in TypeScript. The new `tsconfig.build.json` file is then used for actually building the types. * fix(types): improve horizontalCompaction type * feat(types): improve `Graph` documented types I've manually gone through the JSDoc references within the `src/graphlib/graph.js` file and added JSDoc comments when TypeScript couldn't automatically find detect the types. I've tried to keep the types as backwards compatible as possible. There's also an MIT-licensed [`@types/graphlib`][1] package that we can copy code from, but I didn't do that since I noticed issues with it that were causing our unit tests to fail type-checking (e.g. not allowing `number`s as params for lots of functions, even though the test code uses it a lot). [1]: http://npmjs.com/package/@types/graphlib * docs: copy over graphlib documentation for Graph Update the Graph documentation with a mixture of: 1. API documentation from the graphlib wiki: https://github.com/dagrejs/graphlib/wiki/API-Reference 2. Documentation from https://github.com/dagrejs/graphlib/blob/64b31ef3df0270c9bda85b45cb338481ce25618d/lib/graph.js Both of these are from the graphlib MIT license, which we're already complying with.
This PR addresses a prototype pollution vulnerability (CVE-2025-57347, CWE-1321) in the addConflict() function within src/dagre/position/bk.js. The vulnerability allowed attackers to inject malicious property keys like proto to modify the JavaScript Object prototype chain, potentially leading to denial of service, application crashes, or arbitrary code execution.
This approach:
Resolves #52