Language: Python
Label: vulnerable
CWE: CWE-306 \u2014 Missing Authentication for Critical Function
The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.

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,
            )