Emojify
·
Alpacahack
문제설명Topic: Server-Side주제: Web난이도: Medium:pizza: -> 🍕코드분석frontend / index.jsconst waf = (path) => { if (typeof path !== "string") throw new Error("Invalid types"); if (!path.startsWith("/")) throw new Error("Invalid 1"); if (!path.includes("emoji")) throw new Error("Invalid 2"); return path;};waf은 경로가 문자열이어야 하고, "/" 로 시작하며, emoji를 포함하고 있어야 한다.express() .get("/", (req, res) => res.type("html..
Log Viewer
·
Alpacahack
문제설명Topic: Remote Code Execution분야: Web난이도: MediumSimple log viewer with regex feature.코드분석@app.route("/", methods=["GET", "POST"])def index(): query = "" log = "" if request.method == "POST": query = request.form.get("query", "") command = ["awk", f"/{query}/", "info.log"] result = subprocess.run( command, capture_output=True, timeo..
Prototype Pollution
·
Web Study
Prototype Pollution공격자가 Object.prototype 같은 전역(공통) 프로토타입에 임의의 속성을 추가/변조해서, 이후 생성되는 많은 객체들이 그 속성을 상속받도록 만드는 취약점 JS는 객체에서 속성을 찾을 때 없으면 프로토타입 체인을 따라 올라가며 찾는데, 이때 전역 프로토타입(Object.prototype)이 오염되면, 앱 전체 로직이 예상 밖으로 바뀔 수 있다. 프로토 타입을 오염시키면모든 객체가 영향받음: 새로 만들어지는 모든 객체에 악의적인 속성이 추가됨권한 우회: 접근 제어 로직을 우회할 수 있음원격 코드 실행: 특정 조건에서 임의의 코드를 실행할 수 있음서비스 거부: 애플리케이션을 중단시킬 수 있음Prototype Pollution 발생 원리기본 메커니즘Prototype ..