OreosLab / SSRSpeedN

Audit required: External control of file name or path PTC-W6004
Security
Minor
1 occurrence in this check
External variable 'filename' used in file path
25def push2tg(filename: str, group_id: str, bot_token: str) -> dict:
26    result = {"status": -1, "code": -1}
27    try:
28        with open(filename, "rb") as f:29            sent = telegram.Bot(bot_token).send_photo(photo=f, chat_id=group_id)
30        logger.info(f"Pushing {filename} to telegram group.")
31        print("返回结果:", sent)