CVE-2023-31584 - cu/silicon におけるクロスサイトスクリプティングの脆弱性
Github リンク: https://github.com/cu/silicon
影響を受けるバージョン: 1
深刻度と CVSS: NIST によるレビュー完了後に更新予定。
種類: クロスサイトスクリプティング
根本原因: ユーザー提供データ(タイトルと本文)をデータベースに挿入する前に、適切な入力検証とサニタイズが行われていない。
影響: 情報漏洩
以下は影響を受ける関数です。
https://github.com/cu/silicon/blob/a9ef3681896481bbb443197b9d1c4cb7d22a5983/silicon/page.py#L66-L80
def write(title, body):
"""
* Write a new revision (title and body) to the database.
* If there was a problem, return error message.
"""
try:
db = get_db()
db.execute(
"INSERT INTO pages (revision, title, body) VALUES (?, ?, ?)",
(datetime.now().isoformat(), title, body)
)
db.commit()
except Exception as err:
current_app.logger.critical(f"Error saving page {title}: {err}")
return "Unable to save page"