🇰🇷 한글 설명
MariaDB Connector/Node.js의 특정 버전에서 permitSetMultiParamEntries 옵션이 활성화된 경우, 입력된 객체의 키가 적절히 이스케이프되지 않아 SQL 인젝션이 발생할 수 있습니다. 공격자가 백틱(`)을 포함한 키를 전달하면 SQL 구문을 조작하여 의도하지 않은 컬럼을 수정하거나 임의의 SQL 명령을 실행할 수 있습니다.
💡 쉬운 설명
데이터베이스에 정보를 저장할 때 입력값 검사가 제대로 되지 않아, 나쁜 의도를 가진 코드를 섞어 넣으면 데이터베이스를 마음대로 조작할 수 있는 보안 약점입니다. 공격자가 데이터베이스의 중요한 정보를 몰래 바꾸거나 삭제할 위험이 있습니다.
🇺🇸 원문 (English)
MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. From 3.2.0 until 3.2.5, 3.3.4, 3.4.7, and 3.5.4, applications that enable permitSetMultiParamEntries can pass objects whose keys are expanded into a SQL SET clause without being processed by escapeId. An attacker-controlled key containing a backtick can close the quoted identifier and cause the remainder of the key to be interpreted as SQL. This can update columns the application did not intend to expose and can append arbitrary SQL with the database user's privileges. The option is disabled by default, and serialized-object handling used when it is disabled is not affected. This issue is fixed in versions 3.2.5, 3.3.4, 3.4.7, and 3.5.4.
📍 영향받는 시스템
MariaDB Connector/Node.js 3.2.0~3.2.5, 3.3.4, 3.4.7, 3.5.4 (permitSetMultiParamEntries 옵션 활성화 시)
⚔️ 공격 벡터
permitSetMultiParamEntries 옵션이 활성화된 상태에서 백틱(`)이 포함된 조작된 객체 키를 전달하여 SQL 구문을 탈취
🛡️ 대응 방법
MariaDB Connector/Node.js를 수정된 버전(3.2.5, 3.3.4, 3.4.7, 3.5.4 이상)으로 업데이트하거나 해당 옵션을 비활성화
🔧 검증 코드
출력된 버전이 취약한 버전 범위(3.2.0-3.2.5, 3.3.4, 3.4.7, 3.5.4)에 해당하는지 확인
npm list mariadb-connector-nodejs