Description General
Missing SECURITY.md file
JS Dependencies are not locked via a lock file, nor within the package.json file
"dependencies" : {
"next" : " latest" ,
"next-auth" : " latest" ,
"react" : " ^18.2.0" ,
"react-dom" : " ^18.2.0" ,
"apollo-server-micro" : " ^3.7.0" ,
"graphql" : " ^16.6.0" ,
"jsonwebtoken" : " ^9.0.0" ,
"@apollo/client" : " ^3.7.0"
},
"devDependencies" : {
"typescript" : " ^4.9.4" ,
"@types/node" : " ^18.11.9" ,
"@types/react" : " ^18.0.24"
},
Public repository
Backend
3P dependencies used -- unsure if the deps are reviewed
Unsanitized logs
logger .info ("user Info" + DB_USER + ", " + API_KEY );
System .out .println ("Connecting to DB with user: " + DB_USER );
System .out .printf ("%s: $%.2f%n" , name , balance )
Non atomic amount transfer
if (!balances .containsKey (from ) || !balances .containsKey (to )) {
logger .warning ("Invalid transaction: Account not found for " + from + " or " + to );
throw new Exception ("Invalid transaction: Account not found for " + from + " or " + to );
}
if (balances .get (from ) < amount ) {
logger .warning ("Transaction failed: Insufficient funds in account: " + from );
throw new Exception ("Insufficient funds in account: " + from );
}
balances .put (from , balances .get (from ) - amount );
balances .put (to , balances .get (to ) + amount );
API keys stored in plain text
api :
paymentGatewayKey : " Fg7H2yLdM8VpQz3N6RbXtPWaK4CsJ9T5"
smsProviderKey : " X1Y2Z3A4B5C6D7E8F9G0H1I2J3K4L5M6"
Frontend
Too permissive perms for the User role
CAN_VIEW_SENSITIVE_DATA : true ,
UserId passed in as params, allow any users to view any other user's data
const { userId } = context . params ;
Able to view any user's loans
const Loan = ( { username } : { username : string } ) => {
Able to read all users' transaction history
const FETCH_TRANSACTION_HISTORY = gql `
query fetchTransactionHistory {
fetchTransactionHistory {
transactionId
sender
receiver
amount
}
}
` ;
APIs are public? / do not have authentication schemes?
const response = await fetch ( `https://circle-api.com/user/${ userId } /details` , {
method : 'GET' ,
headers : {
'Content-Type' : 'application/json'
}
} ) ;
Reactions are currently unavailable
You can’t perform that action at this time.
General
nextJSGraphQLapp_sanitized/package.json
Lines 11 to 25 in 0b341a6
Backend
nextJSGraphQLapp_sanitized/backend/FinancialAccountManager.java
Line 24 in 0b341a6
nextJSGraphQLapp_sanitized/backend/FinancialAccountManager.java
Line 33 in 0b341a6
nextJSGraphQLapp_sanitized/backend/FinancialAccountManager.java
Line 43 in 0b341a6
nextJSGraphQLapp_sanitized/backend/FinancialAccountManager.java
Lines 58 to 69 in 0b341a6
nextJSGraphQLapp_sanitized/config/config.yaml
Lines 9 to 11 in 0b341a6
Frontend
nextJSGraphQLapp_sanitized/permissions/check.ts
Line 18 in 0b341a6
nextJSGraphQLapp_sanitized/pages/profile/[userId].tsx
Line 26 in 0b341a6
nextJSGraphQLapp_sanitized/components/Loan.tsx
Line 11 in 0b341a6
nextJSGraphQLapp_sanitized/components/Transactions.tsx
Lines 5 to 14 in 0b341a6
nextJSGraphQLapp_sanitized/graphql/dataSources.ts
Lines 9 to 14 in 0b341a6