CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

CWE-470 là gì?

CWE-470 là Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'). Lỗi phát sinh khi the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. Hiện có 73 lỗ hổng trong kho dữ liệu liên quan đến CWE-470 và 1 trong số đó nằm trong danh mục khai thác thực tế của CISA.

Đang phân tích dữ liệu...

THỨ HẠNG OWASP TOP 10:20255 — A05:2025 — Injection
Tổng số CVE liên quan (365 ngày)73
Mức trừu tượngCơ bản
Khả năng khai thác-

Số lượng lỗ hổng nằm trong CWE-470

73 lỗ hổngTăng 1360% so với cùng kỳ

Số lượng lỗ hổng trong CISA KEV của CWE-470

1 lỗ hổng

Định nghĩa chính thức

TheoMitre CWE

Đặc điểm

Dữ liệu MITRE CWE chính thức

Tên gọi khác

  • Reflection Injection

Giai đoạn hình thành

  • Kiến trúc và thiết kế
  • Hiện thực hóa

Hậu quả thường gặp

Dữ liệu MITRE CWE chính thức
Tác độngPhạm viDiễn giải
Thực thi mã hoặc lệnh trái phép, Thay đổi logic thực thiTính toàn vẹn, Tính bí mật, Tính sẵn sàng, KhácThe attacker might be able to execute code that is not directly accessible to the attacker. Alternately, the attacker could call unexpected code in the wrong place or the wrong time, possibly modifying critical system state.
Từ chối dịch vụ: sập, thoát hoặc khởi động lại, KhácTính sẵn sàng, KhácThe attacker might be able to use reflection to call the wrong code, possibly with unexpected arguments that violate the API (CWE-227). This could cause the product to exit or hang.
Đọc dữ liệu ứng dụngTính bí mậtBy causing the wrong code to be invoked, the attacker might be able to trigger a runtime error that leaks sensitive information in the error message, such as CWE-536.

Biện pháp giảm thiểu rủi ro

Dữ liệu MITRE CWE chính thức
  1. Kiến trúc và thiết kếRefactor your code to avoid using reflection.
  2. Kiến trúc và thiết kếDo not use user-controlled inputs to select and load classes or code.
  3. Hiện thực hóaApply strict input validation by using allowlists or indirect selection to ensure that the user is only selecting allowable classes or code.

Cách phát hiện trong hệ thống

Dữ liệu MITRE CWE chính thức
Phương phápCách làmHiệu quả
Phân tích tĩnh tự độngAutomated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)Cao

Lỗ hổng điển hình

Dữ liệu MITRE CWE chính thức
Nguồn (2)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Tìm hiểu thêm

Kiểm tra chuyên sâu cùng giải pháp quản lý rủi ro Web toàn diện

Giải pháp CyStack VulnScan liên tục phát hiện tài sản, xác minh lỗ hổng và giúp đội ngũ bảo mật ưu tiên khắc phục cho toàn bộ doanh nghiệp.