<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/re-check-authorization-on-the-write-not-only-when-the-form-opened-hdenmg8sv" -->

---
title: Re-check authorization on the write, not only when the...
description: Authorization checks should be re-verified at the moment of a mutating request (PATCH/POST/DELETE), not just when a form or edit screen was first loaded....
canonical: https://daily.dev/posts/re-check-authorization-on-the-write-not-only-when-the-form-opened-hdenmg8sv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Re-check authorization on the write, not only when the form opened | daily.dev
og:description: Authorization checks should be re-verified at the moment of a mutating request (PATCH/POST/DELETE), not just when a form or edit screen was first loaded....
og:url: https://daily.dev/posts/re-check-authorization-on-the-write-not-only-when-the-form-opened-hdenmg8sv
og:image: https://api.daily.dev/og/posts/HdENmG8SV.png
og:image:alt: Re-check authorization on the write, not only when the form opened
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Re-check authorization on the write, not only when the form opened

**[Auth By Example](https://daily.dev/sources/7eadcwhmohx0bchehapmt)** · [@authbyexample](https://daily.dev/authbyexample) · 1 min read · 0 upvotes · 0 comments

## Summary

Authorization checks should be re-verified at the moment of a mutating request (PATCH/POST/DELETE), not just when a form or edit screen was first loaded. Roles, membership, or policy can change between opening a form and submitting it, creating a time-of-check to time-of-use (TOCTOU) gap. The fix is to authorize against the current subject and specific object at write time, rather than trusting a stale 'allowed' flag captured earlier.

## Content

Opening an edit screen and submitting the change are two different moments. Roles, membership, or policy can change in between. Authorize again on the mutating request (PATCH/POST/DELETE), against the current subject and the specific object — not against a stale “allowed” flag from page load. That closes a common TOCTOU gap in access control.

## Similar posts on daily.dev

- [Time-of-check Time-of-use \(TOCTOU\) Race Condition Leads to Broken Authentication](https://daily.dev/posts/time-of-check-time-of-use-toctou-race-condition-leads-to-broken-authentication-d8whpvyfv) · InfoSec Write-ups · 1 upvotes · 0 comments
- [Authorization testing in Rails](https://daily.dev/posts/authorization-testing-in-rails-wcdiqgboi) · Ruby Flow · 0 upvotes · 0 comments
- [Access control for AI agents on Rails: gating SQL with Action Policy—Martian Chronicles, Evil Martians’ team blog](https://daily.dev/posts/access-control-for-ai-agents-on-rails-gating-sql-with-action-policy-martian-chronicles-evil-martia-efskld2gj) · Martian Chronicles · 0 upvotes · 0 comments
- [The Authorization Hole Nobody Noticed](https://daily.dev/posts/the-authorization-hole-nobody-noticed-b5cjqoqsw) · Larablog · 0 upvotes · 0 comments
- [Why AI Agents Write Broken Access Control](https://daily.dev/posts/why-ai-agents-write-broken-access-control-7drb4bp0v) · Snyk · 1 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#appsec](https://daily.dev/tags/appsec), [#authorization](https://daily.dev/tags/authorization)

[View this post on daily.dev](https://daily.dev/posts/re-check-authorization-on-the-write-not-only-when-the-form-opened-hdenmg8sv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/re-check-authorization-on-the-write-not-only-when-the-form-opened-hdenmg8sv","headline":"Re-check authorization on the write, not only when the form opened","text":"Authorization checks should be re-verified at the moment of a mutating request (PATCH/POST/DELETE), not just when a form or edit screen was first loaded. Roles, membership, or policy can change between opening a form and submitting it, creating a time-of-check to time-of-use (TOCTOU) gap. The fix is to authorize against the current subject and specific object at write time, rather than trusting a stale 'allowed' flag captured earlier.","url":"https://daily.dev/posts/re-check-authorization-on-the-write-not-only-when-the-form-opened-hdenmg8sv","datePublished":"2026-09-19T14:21:12.994Z","dateModified":"2026-09-19T14:21:26.623Z","author":{"@type":"Person","name":"Auth By Example","url":"https://daily.dev/authbyexample","image":"https://media.daily.dev/image/upload/s--Fgz7IgGQ--/f_auto/v1789653205/avatars/avatar_7EADCwHmOHX0bChEhAPmt?_a=BAMAMicg0","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":60}},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/7eadcwhmohx0bchehapmt","name":"Auth By Example"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Auth By Example","item":"https://daily.dev/sources/7eadcwhmohx0bchehapmt"},{"@type":"ListItem","position":3,"name":"Re-check authorization on the write, not only when the form opened"}]}
```

