GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Many similar sandboxed tests on sockets generated by Fuzzing and not minimized · Issue #1129 · UnitTestBot/UTBotJava

Many similar sandboxed tests on sockets generated by Fuzzing and not minimized #1129

New issue
Copy link
New issue
Copy link
Closed
#1132
Closed
Many similar sandboxed tests on sockets generated by Fuzzing and not minimized#1129
#1132
Copy link
Assignees
Markouttesergeypospelov
Labels
ctg-bugIssue is a bugIssue is a bugspec-release-tailingsFailed to include in the current release, let's include it in the next oneFailed to include in the current release, let's include it in the next one
Milestone
2022.11 Release

Description

@alisevych
alisevych
opened on Oct 10, 2022
Issue body actions

Description

Many similar tests with same coverage are generated and not minimized.
Socket is created inside tests.
Fuzzing only mode is on.

To Reproduce

  1. Run a project in IntelliJ Idea 2022.1.3 - 2022.2.2
  2. Install RC plugin build
  3. Set Fuzzing to 100%

image

  1. Add the following class (originally posted in Add SecurityManager support to block suspicious code #622 #625 ):
public class SecurityCheck {
    public int connect(Socket socket) throws IOException {
        socket.connect(new InetSocketAddress("0.0.0.0", 22));
        return 0;
    }
}
  1. Use plugin to generate tests
  2. Open the generated test

Expected behavior

There should be only one test creating Socket and sandboxed due to an unpermitted operation.

Actual behavior

There are 272 tests generated by Fuzzing with similar arguments. They all have annotation

@Disabled(value = "Disabled due to sandbox")
    ///region FUZZER: EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS for method connect(java.net.Socket)

 @Test
    @DisplayName("connect: socket = Socket(String, int, boolean)")
    @Disabled(value = "Disabled due to sandbox")
    public void testConnect() throws IOException {
        SecurityCheck securityCheck = new SecurityCheck();
        Socket socket = new Socket("jkmqh", 568849899, true);

        /* This test fails because method [org.utbot.examples.SecurityCheck.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "jkmqh" "resolve")] */
    }

    @Test
    @DisplayName("connect: socket = Socket(String, int, boolean)")
    @Disabled(value = "Disabled due to sandbox")
    public void testConnect1() throws IOException {
        SecurityCheck securityCheck = new SecurityCheck();
        Socket socket = new Socket("qylov", -469477656, true);

        /* This test fails because method [org.utbot.examples.SecurityCheck.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "qylov" "resolve")] */
    }

Visual proofs (screenshots, logs, images)

image

There are the following warnings in concrete executor logs: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor to field java.net.Socket.created

Expand for details

19:03:52.187 | Info | DynamicClassTransformer | 16:Scheduler for Client56431 @coroutine#10 | Transforming: org/utbot/examples/SecurityCheck
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.created
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.bound
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.connected
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.closed
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.closeLock
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.shutIn
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.shutOut
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.impl
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.oldImpl
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.factory
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.options
WARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users//AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.10.417.jar) to field java.net.Socket.optionsSet

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.3, 2022.1.4, 2022.2.2

Additional context

Originally posted by @alisevych in #1125 (comment)

Activity

  1. korifey
    added this to UTBot Javaon Oct 10, 2022
  2. korifey
    moved this to Todo in UTBot Javaon Oct 10, 2022
  3. alisevych
    assigned
    Markoutte
    on Oct 10, 2022
  4. alisevych
    added
    ctg-bugIssue is a bugIssue is a bug
    on Oct 10, 2022
  5. alisevych
    changed the title [-]Many similar sandboxed tests on sockets generated by Fuzzing[/-] [+]Many similar sandboxed tests on sockets generated by Fuzzing and not minimized[/+] on Oct 10, 2022
  6. Markoutte
    added a commit that references this issue on Oct 11, 2022

    Many similar sandboxed tests on sockets generated by Fuzzing and not …

    a30b1de
  7. alisevych
    added this to the 2022.10.1 Release milestone on Oct 11, 2022
  8. alisevych
    assigned
    sergeypospelov
    on Oct 11, 2022
  9. alisevych commented on Oct 11, 2022

    @alisevych
    alisevych
    on Oct 11, 2022
    MemberAuthor
    More actions

    @sergeypospelov Could you please check why minimization is not working in this case?

  10. alisevych
    modified the milestones: 2022.10.1 Release, 2022.11 Release on Oct 17, 2022
  11. alisevych
    added
    spec-release-tailingsFailed to include in the current release, let's include it in the next oneFailed to include in the current release, let's include it in the next one
    on Oct 17, 2022
  12. Markoutte
    added a commit that references this issue on Oct 19, 2022

    Many similar sandboxed tests on sockets generated by Fuzzing and not …

    b3ec3da
  13. Markoutte
    closed this as completedin #1132on Oct 19, 2022
  14. Repository owner moved this from Todo to Done in UTBot Javaon Oct 19, 2022
  15. alisevych commented on Oct 20, 2022

    @alisevych
    alisevych
    on Oct 20, 2022
    MemberAuthor
    More actions

    @Markoutte Please advise on the following:
    Currently - when Fuzzing 100% is selected - error test is generated:

     ///region Errors report for connect
    
        public void testConnect_errors() {
            // Couldn't generate some tests. List of errors:
            // 
            // 70 occurrences of:
            // Default concrete execution failed
    
        }
        ///endregion

    There are no errors in concrete executor logs:
    1079427111206960378-1.log

  16. denis-fokin
    added a commit that references this issue on Oct 20, 2022

    Many similar sandboxed tests on sockets generated by Fuzzing and not …

    30edbb4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Markoutte
    Markoutte
  • @sergeypospelov
    sergeypospelov

Labels

ctg-bugIssue is a bugIssue is a bugspec-release-tailingsFailed to include in the current release, let's include it in the next oneFailed to include in the current release, let's include it in the next one

Type

No type

Projects

  • UTBot Java
    Status
    Done
    Show more project fields

Milestone

  • 2022.11 Release

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.