إرسال #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)
الحالةتمت الموافقة
إدخال VulDB445150 [jarun buku حتى 5.1 bukuserver/views.py BookmarkModelView تزوير طلبات عبر المواقع]
النقاط20

Do you know our Splunk app?

Download it now for free!