private_address_check 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of private_address_check might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/private_address_check/tcpsocket_ext.rb +8 -12
- data/lib/private_address_check/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f750421b67d8f9d5861789e88497b7e46f7bd33
|
4
|
+
data.tar.gz: 2e164ad6417171f6d8a0dbf422ba763405cfd9d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ecd76ef8c342278660b208921604e9b32a620922674455816d925c54383fe6ad6e191d15788703c81d6b66bb580fd7a1123cd1bdd341ce25898e31950c5c304
|
7
|
+
data.tar.gz: 69765c55512fda3ba4e130c8e7e0152c4817edb7705a5e5d849f6d767cba635599f625bbbd15e3420a451c16e256962da78c4e43cd3972f78912886483b5ef2f
|
@@ -9,20 +9,16 @@ module PrivateAddressCheck
|
|
9
9
|
ensure
|
10
10
|
Thread.current[:private_address_check] = false
|
11
11
|
end
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
if Thread.current[:private_address_check]
|
16
|
-
if PrivateAddressCheck.resolves_to_private_address?(remote_host)
|
17
|
-
raise PrivateAddressCheck::PrivateConnectionAttemptedError
|
18
|
-
end
|
14
|
+
TCPSocket.class_eval do
|
15
|
+
alias initialize_without_private_address_check initialize
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
17
|
+
def initialize(remote_host, remote_port, local_host = nil, local_port = nil)
|
18
|
+
if Thread.current[:private_address_check] && PrivateAddressCheck.resolves_to_private_address?(remote_host)
|
19
|
+
raise PrivateAddressCheck::PrivateConnectionAttemptedError
|
24
20
|
end
|
21
|
+
|
22
|
+
initialize_without_private_address_check(remote_host, remote_port, local_host, local_port)
|
25
23
|
end
|
26
24
|
end
|
27
|
-
|
28
|
-
TCPSocket.send(:prepend, PrivateAddressCheck::TCPSocketExt)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: private_address_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Downey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.6.8
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Prevent Server Side Request Forgery attacks by checking the destination
|