Skip to content

Commit

Permalink
Create v.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
rahiCICD authored Aug 24, 2023
1 parent bcc71ca commit 92d1250
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions v.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
object VulnerableCode {
def main(args: Array[String]): Unit = {
val password = "mysecretpassword"
println(s"The password is: $password")

// Critical vulnerability: Writing password to a log file
import java.io.PrintWriter
val writer = new PrintWriter("log.txt")
writer.println(s"Password: $password")
writer.close()
}
}

0 comments on commit 92d1250

Please sign in to comment.