derrickaw opened a new pull request, #41517: URL: https://github.com/apache/beam/pull/41517
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria: - The PR remediates confirmed, live Code Scanning finding(s) (`CodeQL` / `zizmor`) on `master` without altering intended public API or workflow semantics - The fix is minimal, idiomatic, and avoids suppressing alerts or masking underlying defects - Relevant unit tests, linters, and CI checks have been verified If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :) ## Summary - Resolves CodeQL `js/polynomial-redos` (`CWE-1333` / `CWE-400`, High/Warning, [alert #46](https://github.com/apache/beam/security/code-scanning/46)) in `sdks/typescript/src/apache_beam/transforms/transform.ts`. - Replaces the unbounded lazy regex `/__cov_.*?[+][+]/g` in `extractName` (which exhibits quadratic backtracking on strings with repeated `__cov_` substrings lacking `++`) with the bounded, `+`-delimited pattern `/__cov_[^+\r\n]{0,80}\+\+/g` so matching runs in guaranteed `O(N)` linear time while still stripping Istanbul/c8 coverage counter tokens. - Adds unit tests in `sdks/typescript` verifying both coverage boilerplate stripping and linear-time execution on repeated `__cov_` inputs. ## Verification - `npm run build && npm run prettier-check && npm test` in `sdks/typescript` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
