sample-code 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/sample-code.rb +24 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 14b09ecb2bad44fd3aa6c8bc97348d1c84f333de0a339606a24ec1ccce454d70
|
4
|
+
data.tar.gz: aa06e0efda3878a76cda1f5a07e2cd18da2310c7ed50fbfaa8a0f66c72f3ab2a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6c047f21bf05b94e5e5d59aec623292e5f24e405934d490b87e02345d6a4c7e3770fc408fc6cf614e38a6e4a821459ce9a927c3ead50064934b7da1b8abafbb3
|
7
|
+
data.tar.gz: 30c34c1d2e45b80e20f4c85f779415acd82c3e0ad46fcf5ff99afbc490e8439708838e87ccb3f15ab324e13f2a1fd1928797480b89333cc86c3d577d03fd3b36
|
data/lib/sample-code.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require "scan/version"
|
2
|
+
|
3
|
+
module Scan
|
4
|
+
class Error < StandardError; end
|
5
|
+
# frozen_string_literal: true
|
6
|
+
require "spec_helper"
|
7
|
+
|
8
|
+
feature "improper password hashing" do
|
9
|
+
let(:normal_user) { UserFixture.normal_user }
|
10
|
+
|
11
|
+
before do
|
12
|
+
UserFixture.reset_all_users
|
13
|
+
pending unless verifying_fixed?
|
14
|
+
end
|
15
|
+
|
16
|
+
scenario "with just md5\nTutorial: https://github.com/OWASP/railsgoat/wiki/A6-Sensitive-Data-Exposure-Insecure-Password-Storage" do
|
17
|
+
new_pass = "testPassw0rd!"
|
18
|
+
normal_user.password = new_pass
|
19
|
+
normal_user.password_confirmation = new_pass
|
20
|
+
normal_user.save!
|
21
|
+
|
22
|
+
expect(normal_user.password).not_to eq(Digest::MD5.hexdigest(new_pass))
|
23
|
+
end
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sample-code
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- avishek
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: This gem is vulnerable code.
|
14
|
+
email:
|
15
|
+
- your.email@example.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/sample-code.rb
|
21
|
+
homepage: http://example.com/hello_world_gem
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubygems_version: 3.1.2
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Mirror website
|
44
|
+
test_files: []
|