🇰🇷 한글 설명
Sequelize Node.js ORM의 Oracle 방언 사용 시 SQL 인젝션 취약점이 존재합니다. sql-string.js의 escape 함수가 TO_TIMESTAMP 또는 TO_DATE로 시작하는 문자열의 따옴표를 제대로 이스케이프하지 않아 임의의 SQL 실행이 가능합니다.
💡 쉬운 설명
데이터베이스에 날짜를 입력할 때 특정 단어로 시작하면 보안 검사를 건너뛰는 허점이 있습니다. 이를 통해 해커가 데이터베이스를 조작하거나 정보를 훔칠 수 있습니다.
🇺🇸 원문 (English)
Sequelize is a Node.js ORM tool. Prior to 6.37.4, SQL injection is possible with strings only if dialect is set to oracle. The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE. In the Oracle dialect, when val is a string and starts with TO_TIMESTAMP or TO_DATE, escape returns val directly instead of replacing single quotes. An attacker can inject arbitrary SQL expressions through an application value that reaches this escape path. This issue is fixed in version 6.37.4.
📍 영향받는 시스템
Sequelize version < 6.37.4 (Oracle dialect 사용 시)
⚔️ 공격 벡터
TO_TIMESTAMP 또는 TO_DATE로 시작하는 특수 문자열을 입력값으로 전달하여 SQL 인젝션 수행
🛡️ 대응 방법
Sequelize를 버전 6.37.4 이상으로 업데이트
🔧 검증 코드
출력된 Sequelize 버전이 6.37.4 미만인지 확인
npm list sequelize | grep sequelize