Skip to content

Commit b1bb1f7

Browse files
jasnowpostmodern
andauthored
Added rspec check for embedded double newlines (closes #788)
* Added rspec check for embedded double newlines. * Fixed two other advisories with embedded double newlines. --------- Co-authored-by: Postmodern <[email protected]>
1 parent 0049582 commit b1bb1f7

File tree

3 files changed

+47
-18
lines changed

3 files changed

+47
-18
lines changed

gems/avo/CVE-2023-34102.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ date: 2023-06-06
88
description: |
99
### Summary
1010
11-
"The polymorphic field type stores the classes to operate on when updating
11+
The polymorphic field type stores the classes to operate on when updating
1212
a record with user input, and does not validate them in the back end.
1313
This can lead to unexpected behavior, remote code execution, or
1414
application crashes when viewing a manipulated record.
@@ -29,20 +29,38 @@ description: |
2929
3030
### PoC
3131
32-
![image](https://user-images.githubusercontent.com/26464774/243437854-933d94c8-4ae0-43fe-b2da-35b103e28796.png)\n_In the test scenario we choose the demo app and the review resource which has a polymorphic
33-
reviewable field._![image](https://user-images.githubusercontent.com/26464774/243437954-2d947c6d-4e97-4e91-a442-405e553dd047.png)\n_Intercepting
34-
the request and switching the review[reviewable_type] from “Fish”
35-
to “File” which is a real class inside Rails_![image](https://user-images.githubusercontent.com/26464774/243438031-109de6d0-9370-4318-b18e-c5bcea61cf54.png)\n_Corrupting
36-
the database with unusable classes will cause a crash at the
37-
application while viewing the new record or the index
38-
view (partial DoS)_\n\n![image](https://user-images.githubusercontent.com/26464774/243438104-80df5aae-86de-40fc-870d-689a03cae389.png)\n_Manual
39-
delete the corrupted resource in order to recover the applications functionality_\n\n![image](https://user-images.githubusercontent.com/26464774/243438182-1e7eef54-73ba-47d0-b5df-4bad14859af3.png)\n_Of
40-
course it is possible to use other class names or namespaces. The
32+
![image](https://user-images.githubusercontent.com/26464774/243437854-933d94c8-4ae0-43fe-b2da-35b103e28796.png)
33+
34+
In the test scenario we choose the demo app and the review
35+
resource which has a polymorphic reviewable field.
36+
37+
![image](https://user-images.githubusercontent.com/26464774/243437954-2d947c6d-4e97-4e91-a442-405e553dd047.png)
38+
39+
Intercepting the request and switching the review[reviewable_type]
40+
from “Fish” to “File” which is a real class inside Rails
41+
42+
![image](https://user-images.githubusercontent.com/26464774/243438031-109de6d0-9370-4318-b18e-c5bcea61cf54.png)
43+
44+
Corrupting the database with unusable classes will cause a crash
45+
at the application while viewing the new record or the index
46+
view (partial DoS)
47+
48+
![image](https://user-images.githubusercontent.com/26464774/243438104-80df5aae-86de-40fc-870d-689a03cae389.png)
49+
50+
Manual delete the corrupted resource in order to recover the
51+
applications functionality
52+
53+
![image](https://user-images.githubusercontent.com/26464774/243438182-1e7eef54-73ba-47d0-b5df-4bad14859af3.png)
54+
55+
Of course it is possible to use other class names or namespaces. The
4156
local development environment displays the backend error message
4257
when visiting a corrupted record. Avo is trying to apply a scope to
43-
this class that does not exist._\n\n![image](https://user-images.githubusercontent.com/26464774/243438257-dbb59153-58a8-4421-b796-f2a0f2c20083.png)\n_Specifying
44-
an invalid class name in the parameter will cause the application
45-
to crash again while trying constanize the provided string_
58+
this class that does not exist.
59+
60+
![image](https://user-images.githubusercontent.com/26464774/243438257-dbb59153-58a8-4421-b796-f2a0f2c20083.png)
61+
62+
Specifying an invalid class name in the parameter will cause the
63+
application to crash again while trying constanize the provided string
4664
4765
### Impact
4866
@@ -57,7 +75,7 @@ description: |
5775
when defining classes for records. In this particular case, Avo can
5876
evaluate the options list given for the polymorphic field and only allow
5977
strings from that list. With this white-list approach, an attacker
60-
cannot supply unintended classes."
78+
cannot supply unintended classes.
6179
cvss_v3: 8.3
6280
patched_versions:
6381
- ">= 2.33.3"

gems/decidim/CVE-2023-47634.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ url: https://github.com/decidim/decidim/security/advisories/GHSA-r275-j57c-7mf2
66
title: Race condition in Endorsements
77
date: 2024-02-20
88
description: |
9-
"### Impact\n\nA race condition in the endorsement of resources (for
10-
instance, a proposal) allows a user to make more than once endorsement.\n\nTo exploit
11-
this vulnerability, the request to set an endorsement must be sent several times
12-
in parallel.\n \n### Workarounds\n\nDisable the Endorsement feature in the components. "
9+
### Impact
10+
11+
A race condition in the endorsement of resources (for instance,
12+
a proposal) allows a user to make more than once endorsement.
13+
14+
To exploit this vulnerability, the request to set an
15+
endorsement must be sent several times in parallel.
16+
17+
### Workarounds
18+
19+
Disable the Endorsement feature in the components.
1320
cvss_v3: 3.1
1421
unaffected_versions:
1522
- "< 0.10.0"

spec/advisory_example.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
expect(subject).to include("\n")
137137
end
138138

139+
it "must not have double embbedded newlines" do
140+
expect(subject).to_not include("\\n\\n")
141+
end
142+
139143
it { expect(subject).to be_kind_of(String) }
140144
it { expect(subject).not_to be_empty }
141145
end

0 commit comments

Comments
 (0)