जमा करें #1078365: https://github.com/jarun/ buku commit 062cf40bc90462aa1fae215ca1abd877804649c Cross-Site Request Forgeryजानकारी

शीर्षकhttps://github.com/jarun/ buku commit 062cf40bc90462aa1fae215ca1abd877804649c Cross-Site Request Forgery
विवरणCSRF on bukuserver bookmark reorder and swap endpoints Affected versions: confirmed on commit `062cf40bc90462aa1fae215ca1abd877804649c` (34 commits past tag `v5.1.1`, current `master`). ## Summary bukuserver's bookmark reorder (`POST /bookmark/reorder`) and swap (`POST /bookmark/swap`) view handlers perform their database mutation directly from `request.form` without ever validating a CSRF token, even though both are registered as plain form-POST endpoints reachable from a cross-origin HTML form. `flask_wtf.CSRFProtect` is never instantiated anywhere in the application. ## Details `bukuserver/views.py`: ```python @expose('/reorder', methods=['POST']) def refresh(self): filters = json.loads(request.form['filters']) order = bs_filters.BookmarkOrderFilter.value(self._filters, filters) self.bukudb.reorder(order) flash(_('Reordered bookmarks in DB'), 'success') return redirect(url_for('.index_view')) @expose('/swap', methods=['POST']) def swap(self): form = forms.SwapForm() self.bukudb.swap_recs(form.id1.data, form.id2.data) redirect_url = request.form.get('url', url_for('bookmark.index_view')) if redirect_url.startswith('//') or '://' in redirect_url: redirect_url = url_for('bookmark.index_view') return redirect(redirect_url) ``` Neither handler calls `form.validate()` or `form.validate_on_submit()`, which is where Flask-WTF's CSRF check runs. There is no `CSRFProtect(app)` registered anywhere under `bukuserver/`. `reorder` does not use a `FlaskForm` at all. Both endpoints accept a standard `application/x-www-form-urlencoded` POST, the shape a plain cross-origin HTML `<form>` submission produces without any preflight. ## Steps To Reproduce (available upon request) ## Impact A malicious web page can forge a bookmark reorder or position swap against any bukuserver instance a victim's browser can reach, using only a plain HTML form submission. Where bukuserver is reachable with no application authentication (the documented default), this requires no victim interaction with bukuserver itself beyond having their browser visit the attacker's page; where an operator has added a reverse-proxy Basic Auth in front of bukuserver, the forged request still succeeds as long as the victim's browser has that credential cached. The same missing-CSRF-check pattern extends to the fetch/refresh endpoints, meaning a forged cross-origin form submission can also trigger blind outbound SSRF requests and bulk refresh operations through a victim's browser.
स्रोत⚠️ https://github.com/jarun/buku/issues/912
उपयोगकर्ता
 carfeii (UID 97470)
सबमिशन06/11/2026 06:12 PM (22 दिन पहले)
संयम29/11/2026 03:36 AM (22 days later)
स्थितिस्वीकृत
VulDB प्रविष्टि445150 [jarun buku तक 5.1 bukuserver/views.py BookmarkModelView क्रॉस साइट रिक्वेस्ट फॉर्जरी]
अंक20

Do you need the next level of professionalism?

Upgrade your account now!