Language: Python
Label: vulnerable
CWE: NVD-CWE-Other \u2014 Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.

Code:
    def image(
        self,
        tokens: Sequence[Token],
        idx: int,
        options: OptionsDict,
        env: MutableMapping,
    ) -> str:
        token = tokens[idx]

        # "alt" attr MUST be set, even if empty. Because it's mandatory and
        # should be placed on proper position for tests.

        assert (
            token.attrs and "alt" in token.attrs
        ), '"image" token\'s attrs must contain `alt`'

        # Replace content with actual value

        token.attrSet("alt", self.renderInlineAsText(token.children, options, env))

        return self.renderToken(tokens, idx, options, env)