Skip to content

Commit 9da0df1

Browse files
rishabhkeshanbkimminichImgBotApperic-nieuwlandparthn2
authored
feat: added Riches on Juice Shop challenge (juice-shop#2029)
* feat: added Riches on Juice Shop challenge, implemented ethers seedphrase to private key conversion for challenge page routing, added new product 'NFT Me' on Juice Shop along with a new page for the challenge * feat: added backend route for seedphrase leak challenge, added new user and feedback with seed phrase, implemented conditional rendering on form submission * added css for the inputs, added new route for challenge solved check * fixed response destructuring, remoted console logs, fixed check for challenge solved or successful input * fix: added country mapping for seedPhraseLeakChallenge * fix: repeat country code, added route path in feedback, fixed linting * fix: added checks for input with special cases, made changes to the challenge details * fix: lint fix * feat: discarded .DS_store * fix: rsn fix * feat(challenge): Updated 'Juicy NFT Seed Saga' challenge with seed phrase leak - Updated challenge name and description to 'Juicy NFT Seed Saga' - Improved clarity in the challenge description - Named the Angular component 'nft-unlock-component' * feat: made changes to challenge name and description, changed static colors to material UI classes, changed error messages * feat: removed unused comments * Add Dublin AppSec 2023 video link Be advised that the video and audio are severely out of sync on this one unfortunately. * Update 2023 conference appearances * Update GitHub contributor stats * [ImgBot] Optimize images /screenshots/git-stats.png -- 74.39kb -> 26.26kb (64.71%) Signed-off-by: ImgBotApp <[email protected]> * First bunch * Next bunch * Next bunch * Next bunch * Next bunch * Next bunch * Last bunch * New translations en.json (German, Switzerland) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Dutch) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (German, Switzerland) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Dutch) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * More translation and improved consistency * added timout to make scroll correct for chatbot Signed-off-by: Parth Nanda <[email protected]> * Corrected lint error * Remove semicolon * New translations en.json (Dutch) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Dutch) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Dutch) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * Bump to v15.1.0-SNAPSHOT * Run `dom.watch()` only once Previously a lot of component registered this watch. Each of them created a MutationObserver running on dom modifications. This slows down the page way more then it needs to as the action this performs is global and should not be triggered more than once. Signed-off-by: Jannik Hollenbach <[email protected]> * Double scroll timeout to 1/4 sec (to allow non-localhost systems to respond before scrolling happens) * Clear timeout chat scroll down timeout on ngDestroy * Auto-fix linting issues Signed-off-by: JuiceShopBot <[email protected]> * Fix incorrect hardcoded node.js version in action name * Update version to auto-commit action * Upgrade to juicy-chat-bot version with en lang support Signed-off-by: Jannik Hollenbach <[email protected]> * build: add BOM files to dist packages fixes juice-shop#2028 Signed-off-by: Jan Kowalleck <[email protected]> * ci workflow version streamline Signed-off-by: Jan Kowalleck <[email protected]> * bom in docker image Signed-off-by: Jan Kowalleck <[email protected]> * New translations en.json (Portuguese, Brazilian) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Portuguese, Brazilian) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Portuguese, Brazilian) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Portuguese, Brazilian) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * Upgrade to latest cpu & memory improved version of swagger-ui-express Signed-off-by: Jannik Hollenbach <[email protected]> * New translations en.json (Turkish) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * New translations en.json (Turkish) [ci skip] Signed-off-by: Björn Kimminich <[email protected]> * Pin flag-icons library to 6.8.x version (fixes juice-shop#2047) * Update browsers list and Karma config for Angular 15 * Fix linting issues * Switch to Windows Server 2019 OS (to debug test runner issues not reproducable on local Win 11) * Revert "Switch to Windows Server 2019 OS" This reverts commit 48ca0c8. * Remove Windows from build matrix for unit tests (due to 'Error: ENOENT: no such file or directory, open' error breaking at least on Node 20.5.0 constantly) * Switch wallet tests to demo user (to avoid conflicts with shopping tests where Jim is used. Fixes juice-shop#2030) --------- Signed-off-by: ImgBotApp <[email protected]> Signed-off-by: Parth Nanda <[email protected]> Signed-off-by: Jannik Hollenbach <[email protected]> Signed-off-by: JuiceShopBot <[email protected]> Signed-off-by: Jan Kowalleck <[email protected]> Co-authored-by: Björn Kimminich <[email protected]> Co-authored-by: Bjoern Kimminich <[email protected]> Co-authored-by: ImgBotApp <[email protected]> Co-authored-by: Eric Nieuwland <[email protected]> Co-authored-by: Parth Nanda <[email protected]> Co-authored-by: Parth Nanda <[email protected]> Co-authored-by: Jannik Hollenbach <[email protected]> Co-authored-by: JuiceShopBot <[email protected]> Co-authored-by: Jan Kowalleck <[email protected]>
1 parent 516ce13 commit 9da0df1

22 files changed

+366
-3
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ config/*.yml
6161
!config/unsafe.yml
6262
!config/tutorial.yml
6363
!config/oss.yml
64+
65+
# System Files
66+
.DS_Store

config.schema.yml

+5
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ ctf:
499499
type: string
500500
code:
501501
type: string
502+
nftUnlockChallenge:
503+
name:
504+
type: string
505+
code:
506+
type: string
502507
securityPolicyChallenge:
503508
name:
504509
type: string

config/fbctf.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,7 @@ ctf:
320320
code: ZM
321321
emptyUserRegistration:
322322
name: Kenya
323-
code: KE
323+
code: KE
324+
nftUnlockChallenge:
325+
name: Afghanistan
326+
code: AF

data/static/challenges.yml

+12
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@
8181
hintUrl: 'https://pwning.owasp-juice.shop/part2/security-through-obscurity.html#learn-about-the-token-sale-before-its-official-announcement'
8282
mitigationUrl: ~
8383
key: tokenSaleChallenge
84+
-
85+
name: 'NFT Takeover'
86+
category: 'Sensitive Data Exposure'
87+
tags:
88+
- Contraption
89+
- Good for Demos
90+
description: 'Take over the wallet containing our official Soul Bound Token (NFT).'
91+
difficulty: 2
92+
hint: 'Find the seedphrase posted accidentally.'
93+
hintUrl: ''
94+
mitigationUrl: ~
95+
key: nftUnlockChallenge
8496
-
8597
name: 'Blocked RCE DoS'
8698
category: 'Insecure Deserialization'

data/static/codefixes/adminSectionChallenge_1_correct.ts

+4
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ const routes: Routes = [
157157
component: LastLoginIpComponent
158158
}
159159
]
160+
},
161+
{
162+
path: 'juicy-nft',
163+
component: NFTUnlockComponent
160164
},
161165
{
162166
matcher: oauthMatcher,

data/static/codefixes/adminSectionChallenge_2.ts

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ const routes: Routes = [
154154
component: LastLoginIpComponent
155155
}
156156
]
157+
},
158+
{
159+
path: 'juicy-nft',
160+
component: NFTUnlockComponent
157161
},
158162
{
159163
matcher: oauthMatcher,

data/static/codefixes/adminSectionChallenge_3.ts

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ const routes: Routes = [
154154
component: LastLoginIpComponent
155155
}
156156
]
157+
},
158+
{
159+
path: 'juicy-nft',
160+
component: NFTUnlockComponent
157161
},
158162
{
159163
matcher: oauthMatcher,

data/static/codefixes/adminSectionChallenge_4.ts

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ const routes: Routes = [
154154
component: LastLoginIpComponent
155155
}
156156
]
157+
},
158+
{
159+
path: 'juicy-nft',
160+
component: NFTUnlockComponent
157161
},
158162
{
159163
matcher: oauthMatcher,

data/static/codefixes/scoreBoardChallenge_1_correct.ts

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ const routes: Routes = [
154154
component: LastLoginIpComponent
155155
}
156156
]
157+
},
158+
{
159+
path: 'juicy-nft',
160+
component: NFTUnlockComponent
157161
},
158162
{
159163
matcher: oauthMatcher,

data/static/codefixes/scoreBoardChallenge_2.ts

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ const routes: Routes = [
154154
component: LastLoginIpComponent
155155
}
156156
]
157+
},
158+
{
159+
path: 'juicy-nft',
160+
component: NFTUnlockComponent
157161
},
158162
{
159163
matcher: oauthMatcher,

data/static/codefixes/scoreBoardChallenge_3.ts

+4
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ const routes: Routes = [
150150
component: LastLoginIpComponent
151151
}
152152
]
153+
},
154+
{
155+
path: 'juicy-nft',
156+
component: NFTUnlockComponent
153157
},
154158
{
155159
matcher: oauthMatcher,

data/static/users.yml

+12
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,15 @@
253253
securityQuestion:
254254
id: 10
255255
answer: "Used Ship Emporium" # https://monkeyisland.fandom.com/wiki/Stan_S._Stanman
256+
-
257+
email: ethereum
258+
username: evmrox
259+
password: 'private'
260+
key: evm
261+
role: 'deluxe'
262+
feedback:
263+
comment: 'Please send me the juicy chatbot NFT in my wallet at /juicy-nft : "purpose betray marriage blame crunch monitor spin slide donate sport lift clutch"'
264+
rating: 1
265+
securityQuestion:
266+
id: 10
267+
answer: "Used Emporium"
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Injectable } from '@angular/core'
2+
import { HttpClient } from '@angular/common/http'
3+
import { catchError, map } from 'rxjs/operators'
4+
import { environment } from '../../environments/environment'
5+
6+
@Injectable({
7+
providedIn: 'root'
8+
})
9+
export class KeysService {
10+
private readonly hostServer = environment.hostServer
11+
private readonly host = this.hostServer + '/rest/web3'
12+
13+
constructor (private readonly http: HttpClient) {}
14+
15+
nftUnlocked () {
16+
return this.http.get(this.host + '/nftUnlocked').pipe(
17+
map((response: any) => response),
18+
catchError((err) => {
19+
throw err
20+
})
21+
)
22+
}
23+
24+
submitKey (privateKey: string) {
25+
const endpoint = this.host + '/submitKey'
26+
const params = { privateKey: privateKey }
27+
return this.http.post(endpoint, params).pipe(
28+
map((response: any) => response),
29+
catchError((err) => {
30+
throw err
31+
})
32+
)
33+
}
34+
}

frontend/src/app/app.module.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { BrowserModule } from '@angular/platform-browser'
77
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'
88
import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http'
99
import { CookieModule, CookieService } from 'ngx-cookie'
10-
import { ReactiveFormsModule } from '@angular/forms'
10+
import { ReactiveFormsModule, FormsModule } from '@angular/forms'
1111
import { Routing } from './app.routing'
1212
import { OverlayContainer } from '@angular/cdk/overlay'
1313
import { TranslateLoader, TranslateModule } from '@ngx-translate/core'
@@ -43,6 +43,7 @@ import {
4343
ChallengeSolvedNotificationComponent
4444
} from './challenge-solved-notification/challenge-solved-notification.component'
4545
import { OAuthComponent } from './oauth/oauth.component'
46+
import { NFTUnlockComponent } from './nft-unlock/nft-unlock.component'
4647
import { TokenSaleComponent } from './token-sale/token-sale.component'
4748
import { ProductReviewEditComponent } from './product-review-edit/product-review-edit.component'
4849
import { TwoFactorAuthEnterComponent } from './two-factor-auth-enter/two-factor-auth-enter.component'
@@ -68,6 +69,7 @@ import { BasketService } from './Services/basket.service'
6869
import { ChallengeService } from './Services/challenge.service'
6970
import { DataSubjectService } from './Services/data-subject.service'
7071
import { ImageCaptchaService } from './Services/image-captcha.service'
72+
import { KeysService } from './Services/keys.service'
7173
import { AddressService } from './Services/address.service'
7274
import { QuantityService } from './Services/quantity.service'
7375
import { FlexLayoutModule } from '@angular/flex-layout'
@@ -169,6 +171,7 @@ export function HttpLoaderFactory (http: HttpClient) {
169171
ChallengeSolvedNotificationComponent,
170172
OAuthComponent,
171173
TokenSaleComponent,
174+
NFTUnlockComponent,
172175
ProductReviewEditComponent,
173176
TwoFactorAuthEnterComponent,
174177
SidenavComponent,
@@ -226,6 +229,7 @@ export function HttpLoaderFactory (http: HttpClient) {
226229
NgxSpinnerModule,
227230
MatToolbarModule,
228231
MatIconModule,
232+
FormsModule,
229233
MatFormFieldModule,
230234
MatSelectModule,
231235
MatButtonModule,
@@ -301,6 +305,7 @@ export function HttpLoaderFactory (http: HttpClient) {
301305
AccountingGuard,
302306
DeluxeGuard,
303307
ImageCaptchaService,
308+
KeysService,
304309
AddressService,
305310
QuantityService,
306311
WalletService,
@@ -310,7 +315,6 @@ export function HttpLoaderFactory (http: HttpClient) {
310315
],
311316
bootstrap: [AppComponent]
312317
})
313-
314318
export class AppModule {
315319
constructor (public configurationService: ConfigurationService, public overlayContainer: OverlayContainer) {
316320
configurationService.getApplicationConfiguration().subscribe((conf) => {

frontend/src/app/app.routing.ts

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { DeliveryMethodComponent } from './delivery-method/delivery-method.compo
4141
import { PhotoWallComponent } from './photo-wall/photo-wall.component'
4242
import { DeluxeUserComponent } from './deluxe-user/deluxe-user.component'
4343
import { AccountingGuard, AdminGuard, LoginGuard } from './app.guard'
44+
import { NFTUnlockComponent } from './nft-unlock/nft-unlock.component'
4445

4546
// vuln-code-snippet start adminSectionChallenge scoreBoardChallenge
4647
const routes: Routes = [
@@ -200,6 +201,10 @@ const routes: Routes = [
200201
}
201202
]
202203
},
204+
{
205+
path: 'juicy-nft',
206+
component: NFTUnlockComponent
207+
},
203208
// vuln-code-snippet start tokenSaleChallenge
204209
{
205210
matcher: oauthMatcher,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<mat-card>
2+
<div class="container" fxLayout="column" fxLayoutGap="20px">
3+
<button
4+
class="detail-container offer-container warning-container"
5+
mat-raised-button
6+
color="warn"
7+
fxFlexAlign="center"
8+
>
9+
Note: Never reveal your personal private keys and seed phrase to anyone
10+
</button>
11+
<div
12+
class="detail-container offer-container"
13+
fxFlexAlign="center"
14+
fxLayout="row"
15+
fxLayout.lt-lg="column"
16+
>
17+
<div>
18+
<img src="assets/public/images/products/juicy_chatbot.jpg" />
19+
</div>
20+
<div *ngIf="!successResponse">
21+
<div>
22+
<mat-card-title>Juicy Chatbot SBT</mat-card-title>
23+
</div>
24+
<form (ngSubmit)="submitForm()">
25+
<div class="form-group">
26+
<mat-form-field
27+
style="width: 350px"
28+
color="accent"
29+
appearance="outline"
30+
>
31+
<mat-label>Enter Private Key</mat-label>
32+
<input
33+
matInput
34+
[(ngModel)]="privateKey"
35+
id="privateKey"
36+
name="privateKey"
37+
required
38+
type="text"
39+
aria-label="Text field for the private key"
40+
/>
41+
</mat-form-field>
42+
<h5 class="error">{{ errorMessage }}</h5>
43+
</div>
44+
45+
<button
46+
type="submit"
47+
class="btn btn-primary"
48+
mat-raised-button
49+
color="accent"
50+
>
51+
Authenticate
52+
</button>
53+
</form>
54+
</div>
55+
<div *ngIf="successResponse">
56+
<div>
57+
<mat-card-title>Juicy Chatbot SBT</mat-card-title>
58+
</div>
59+
<div class="owner-text">
60+
Owned by
61+
<a
62+
target="_blank"
63+
href="https://testnets.opensea.io/0x8343d2eb2B13A2495De435a1b15e85b98115Ce05"
64+
>8343D2</a
65+
>
66+
</div>
67+
<mat-divider class="detail-divider"></mat-divider>
68+
<div class="detail-box mat-elevation-z6">
69+
<div class="box-title">Account Address</div>
70+
<mat-divider class="detail-divider"></mat-divider>
71+
<p class="box-text">0x8343d2eb2B13A2495De435a1b15e85b98115Ce05</p>
72+
</div>
73+
<div class="detail-box mat-elevation-z6">
74+
<div class="box-title">Description</div>
75+
<mat-divider class="detail-divider"></mat-divider>
76+
<p class="box-text">
77+
Hurray! Find the Juice Shop SBT on
78+
<a
79+
target="_blank"
80+
href="https://testnets.opensea.io/assets/mumbai/0xf4817631372dca68a25a18eb7a0b36d54f3dbcf7/0"
81+
>Opensea here.</a
82+
>
83+
This is a non-transferable token and is here to stay forever.
84+
</p>
85+
</div>
86+
</div>
87+
</div>
88+
</div>
89+
</mat-card>

0 commit comments

Comments
 (0)