<commit_before>## security

#### XSRF (Cross-Site Request Forgery)

client side

```ruby
= csrf_meta_tags

```

server side

```ruby
class ApplicationController
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead. 
  protect_from_forgery with: :exception
end
```


Cross-Site Request Forgery (usually abbreviated as CSRF or XSRF) is a type of web application vulnerability that allows an attacker to modify application state on behalf of a user that is logged into the application by luring the user to click on a carefully crafted link, visit a page, or even just open an email with embedded images.
Lets say that an intern at a banking institution implemented account fund transfer functionality as an HTTP GET method, like so:


` GET/transfers?from_account_id=123&to_account_id=456&amount=1000`
<commit_msg>Update chapter15.markdown<commit_after>## security

#### XSRF (Cross-Site Request Forgery)

client side

```ruby
= csrf_meta_tags
```

server side

```ruby
class ApplicationController
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead. 
  protect_from_forgery with: :exception
end
```


Cross-Site Request Forgery (usually abbreviated as CSRF or XSRF) is a type of web application vulnerability that allows an attacker to modify application state on behalf of a user that is logged into the application by luring the user to click on a carefully crafted link, visit a page, or even just open an email with embedded images.
Lets say that an intern at a banking institution implemented account fund transfer functionality as an HTTP GET method, like so:


` GET/transfers?from_account_id=123&to_account_id=456&amount=1000`

{'fraction_non_alphanumeric': 0.058280438545874204, 'fraction_numerical': 0.012694748990190421, 'mean_word_length': 5.105633802816901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4012162', 'n_tokens_mistral': 508, 'n_tokens_neox': 457, 'n_words': 231}