cannot load media library on wordpress (feat. modsecurity & sql injection ruleset)

in #wordpress7 years ago

cannot load media library on wordpress (feat. modsecurity & sql injection ruleset)

  1. 환경
    OS : LINUX (CentOS-7)
    WEB : apache-2.4 (with mod_security)
    PHP : 7.1

  2. 증상
    어느날 갑자기 워드프레스의 “미디어 라이브러리”를 클릭 하면 아무것도 보이지 않음
    “클릭” 하면 화면은 열리지만 이미 업로드된 미디어 목록이 보이지 않는 문제

  3. 사건발생의 “전” 상황 추정
    워드프레스 쪽에 별다른 수정을 한 내용 없음
    서버 환경에 대해 변경된 내용 없음

  4. 페이지 로딩시 특이 사항
    페이지 로딩중 목록을 체크 해 보니
    /wp/wp-admin/load-scripts.php
    를 로드 하면서 “403” 에러 발생… 잉???

  5. 4번의 검토 사항
    GET /wp/wp-admin/load-scripts.php?c=0&load%5B%5D=hoverIntent,common,admin-bar,underscore,shortcode,backbone,wp-util,wp-backbone,media-models,wp-plupload,jquery-ui-mouse,jquery-u&load%5B%5D=i-sortable,wp-mediaelement,wp-api-request,media-views,media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,media-grid&load%5B%5D=,media,svg-painter,heartbeat,wp-auth-check&ver=4.9.4 HTTP/2.0
    이 GET 액션이 modsecurity 에 걸린것이 확인됨.. ㄷㄷ
    허나… 3번 항목에서 설명 한 것 처럼 서버의 환경을 변경한 사항은 없으며
    특히나 mod_security 룰셋은 아주 오랫동안 변경한 내용이 없었음

  6. 근데 왜 걸린거냐???
    음…
    mod_security 룰셋..
    그 중 sql injection 룰셋중 하나를 좀 타이트한 형태로 (바꿔 말하면 좀 원시적으로다가..)
    설정해 놓은 것이 있었음…
    select, insert, update 뭐 이런걸 막음.. ㅋㅋㅋ
    요기서 GET 인수중 “imgareaselect”를 검출 하면서 이런 사단이….
    불과 얼마전까지 이런 문제가 없었는데… 갑자기… 실화???

  7. 추정
    한것이 없다고는 했지만
    워드프레스의 업데이트는 계속해서 진행해 왔음
    – 마지막 또는 바로전 업데이트에서
    미디어라이브러리 로딩시 던지는 GET 인수가 변경된 것이라고 생각함
    늘 그렇듯.. 정확한 확인은 안됨
    왜? 내가 코드를 볼 줄 모르니까….!

  • 정황상 이것 밖에 없는것 아니겠냐능…. ㅋㅋㅋ
Sort:  

본인의 추정이 완전히 틀림
4.9.4 최신 기준으로 1회 2회 전까지 업데이트에서 이는 변경되지 않았고
그 이전에도 계속 사용되었음.. ㅎㅎㅎㅎ
modsecurity 에서 내가 사용하는 아이피주소를 whitelist 로 등록했기 때문에 문제가 발생하지 않았던것…

테스트 해보길 잘한듯… 잘못된 정보를… ㄷㄷ

Congratulations @jiraknet! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @jiraknet! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.17
TRX 0.24
JST 0.034
BTC 95751.15
ETH 2807.74
SBD 0.67