Title: Socket connect should be sandboxed · Issue #792 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Socket connect should be sandboxed · Issue #792 · UnitTestBot/UTBotJava
X Title: Socket connect should be sandboxed · Issue #792 · UnitTestBot/UTBotJava
Description: Description Socket.connect method call is not sandboxed by Security Manager as expected. Default settings, no additional permissions were added. To Reproduce Steps to reproduce the behavior: Open IntelliJ IDEA with installed UTBot plugin...
Open Graph Description: Description Socket.connect method call is not sandboxed by Security Manager as expected. Default settings, no additional permissions were added. To Reproduce Steps to reproduce the behavior: Open I...
X Description: Description Socket.connect method call is not sandboxed by Security Manager as expected. Default settings, no additional permissions were added. To Reproduce Steps to reproduce the behavior: Open I...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/792
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Socket connect should be sandboxed","articleBody":"**Description**\r\n\r\nSocket.connect method call is not sandboxed by Security Manager as expected.\r\nDefault settings, no additional permissions were added.\r\n\r\n**To Reproduce**\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. Open IntelliJ IDEA with installed UTBot plugin (with Security Manager turned on)\r\n2. Open/create a project with JDK 8/11\r\n3. Add the following class:\r\n\r\n~~~java\r\nimport java.io.IOException;\r\nimport java.net.InetSocketAddress;\r\nimport java.net.Socket;\r\n\r\npublic class SecurityCheck {\r\n\r\n public int connect(Socket socket) throws IOException {\r\n socket.connect(new InetSocketAddress(\"0.0.0.0\", 22));\r\n return 0;\r\n }\r\n\r\n}\r\n~~~\r\n\r\n4. Generate tests for this class\r\n\r\n**Expected behavior**\r\n\r\nGenerated test is supposed to be disabled with sandbox-related comment.\r\n\r\n**Actual behavior**\r\n\r\nSuccessful test is generated.\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n~~~java\r\npublic class SecurityCheckTest {\r\n ///region Test suites for executable SecurityCheck.connect\r\n\r\n ///region\r\n\r\n @Test\r\n @DisplayName(\"connect: socket = Socket(String, int, boolean) -\u003e throw SocketException\")\r\n public void testConnectThrowsSE() throws IOException {\r\n SecurityCheck securityCheck = new SecurityCheck();\r\n Socket socket = new Socket(\"\", 0, false);\r\n\r\n assertThrows(SocketException.class, () -\u003e securityCheck.connect(socket));\r\n }\r\n ///endregion\r\n\r\n ///region Errors report for connect\r\n\r\n public void testConnect_errors() {\r\n // Couldn't generate some tests. List of errors:\r\n // \r\n // 4 occurrences of:\r\n // Default concrete execution failed\r\n\r\n }\r\n ///endregion\r\n\r\n ///endregion\r\n\r\n}\r\n~~~\r\n\r\n4 InvocationTargetException are present in Concrete executor log\r\n\r\n**Environment**\r\n\r\nIntelliJ IDEA 2022.1 - 2022.1.4\r\nJDK 8/11\r\n\r\n**Additional context**\r\n\r\nSame result with Fuzzing only and default settings.","author":{"url":"https://github.com/alisevych","@type":"Person","name":"alisevych"},"datePublished":"2022-08-25T15:10:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/792/UTBotJava/issues/792"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dd5b9bcb-ee94-70f2-313a-5e8319bf0507 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0A8:7A7D:B70C36:FCEB25:698E1347 |
| html-safe-nonce | 31fe15aa6b832b2ce1823b6a02ad9b62a95a7a533277085b6dbd325b4e75fd5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEE4OjdBN0Q6QjcwQzM2OkZDRUIyNTo2OThFMTM0NyIsInZpc2l0b3JfaWQiOiIzNDg2NDgwNTU4MDI3ODM4Mjc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f9ef817d7dfacf5562764c3d1cf6a15c48c3dfa1ffa691540b0e5aa77dca7372 |
| hovercard-subject-tag | issue:1351058602 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/792/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d1c4fe46e26321a139ffd2139a39e26f1efeae41d66378e17581c6194579b15/UnitTestBot/UTBotJava/issues/792 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d1c4fe46e26321a139ffd2139a39e26f1efeae41d66378e17581c6194579b15/UnitTestBot/UTBotJava/issues/792 |
| og:image:alt | Description Socket.connect method call is not sandboxed by Security Manager as expected. Default settings, no additional permissions were added. To Reproduce Steps to reproduce the behavior: Open I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alisevych |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdf74c91c9ac187cc5cd7b14d4af2d6ef3e18136d002f5d36253f8538e97ee4c |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1a5a3e7bbfb3486980e340c242368684156fba87 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width