Language: Python
Label: vulnerable
CWE: CWE-284 \u2014 Improper Access Control
The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

Code:
    def change_version(self, new_version: str, dry: bool):

        changelog = CHANGELOG.read_text(encoding="utf-8")
        if new_version not in changelog:
            raise Exception(
                (
                    f"{new_version} is absent in CHANGELOG.md file."
                    f" Please update the changelog first."
                ).format(new_version=new_version)
            )

        for location in self.locations:
            replace_version(
                path=location.path,
                template=location.template,
                old=self.current_version,
                new=new_version,
                dry=dry,
            )