aikido-zen 1.7.1 → 1.7.2.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddee51760626c0c9d7af69137f88286d0b49ac9d5aab02d17bebbff71136bb0f
4
- data.tar.gz: 7b5ea9701c89111b1423c99750495b7a4d85b725e78008d93b110e4a2be9007c
3
+ metadata.gz: 9df9011f3e8f6d0df4ea0b12df6ed7202c0b91eda333f4318a6217b379702fc9
4
+ data.tar.gz: d13cd7f6f6cf72aa8dd0d76ff5bfc44dbb5620701ea3179f10f543587703695c
5
5
  SHA512:
6
- metadata.gz: edada0391a4cc9f6982dddedd67e6972a13ddb60fad9c723cd1c369e36c3ba5699637dbfacce686c1472e6009e9927f69dcb16945ae7c41c65745e110cff614d
7
- data.tar.gz: aa43771cf0fb387c55d35fc1f26b3e765ce0c36ed29764ad677fca7d4f69459310a3115088f73a2df65e35d2bc145dc6a6e2294d20ec4aed35cc81fce96de80a
6
+ metadata.gz: 5853f8f8cb5f74f439d155165ec137a965778741707537bce4dbc035f2f76529ed92910569b89137599f61b9e706f5fcacd95391e0157100f93326417e913df5
7
+ data.tar.gz: 1c742e2f46dde686ae8f70c65d7cfb0dd8fb552d10b9bff5b9b22934e25be3d8cc2c3a92cf7487e2d3c5884ca1803f585a4e7029f90564cb353563bc5960c220
@@ -16,7 +16,26 @@ module Aikido::Zen
16
16
  def self.suspicious_request?(context, status_code)
17
17
  request = context.request
18
18
 
19
- suspicious_method?(request.request_method) || suspicious_path?(request.path_info, status_code)
19
+ suspicious_method?(request.request_method) || suspicious_path?(original_path(request), status_code)
20
+ end
21
+
22
+ # Rails rewrites PATH_INFO to /status before invoking an exceptions_app.
23
+ # Returns the path that Rails rewrote.
24
+ # @param request [Aikido::Zen::Request]
25
+ # @return [String]
26
+ def self.original_path(request)
27
+ request.env["action_dispatch.original_path"] || request.path_info
28
+ end
29
+
30
+ # Rails rewrites PATH_INFO to /status before invoking an exceptions_app.
31
+ # Returns the path that Rails rewrote, including the same query string.
32
+ # @param request [Aikido::Zen::Request]
33
+ # @return [String]
34
+ def self.original_fullpath(request)
35
+ path = original_path(request)
36
+ query = request.query_string
37
+
38
+ query.empty? ? path : "#{path}?#{query}"
20
39
  end
21
40
 
22
41
  def self.suspicious_method?(method)
@@ -35,7 +35,7 @@ module Aikido::Zen
35
35
  context.request.then do |request|
36
36
  @samples[client_ip] <<= Sample.new(
37
37
  verb: request.request_method,
38
- path: request.fullpath
38
+ path: AttackWave::Helpers.original_fullpath(request)
39
39
  )
40
40
  end
41
41
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Aikido
4
4
  module Zen
5
- VERSION = "1.7.1"
5
+ VERSION = "1.7.2.beta.1"
6
6
 
7
7
  # The version of libzen_internals that we build against.
8
8
  LIBZEN_VERSION = "0.1.61"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aikido-zen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aikido Security
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-10 00:00:00.000000000 Z
11
+ date: 2026-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby