Skip to content

#1703: prevent replacement string injection in update-version action#1754

Open
VasilevNStas wants to merge 1 commit into
zerocracy:masterfrom
VasilevNStas:1703-replacement-injection
Open

#1703: prevent replacement string injection in update-version action#1754
VasilevNStas wants to merge 1 commit into
zerocracy:masterfrom
VasilevNStas:1703-replacement-injection

Conversation

@VasilevNStas

@VasilevNStas VasilevNStas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

String.prototype.replace() interprets $ patterns ($&, ``, $', etc.) in string replacement values. If a tag name ever contained these characters, the README content would be silently corrupted.

Fix

Use a function callback instead of a string for replace() — function return values are used literally without any $ processing.

Closes #1703

Use function callback for String.prototype.replace() to avoid
processing of $ backreference patterns in the replacement value.
@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 plz review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update-version action does not escape $n in replacement string

1 participant